From e153f6e88c50315b1f0a194782c997736600ea68 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Tue, 13 Sep 2022 20:49:35 -0700 Subject: [PATCH 01/48] updates to the chart description --- reference/SpaceTraders.yaml | 427 ++++++++++++++++++------------------ 1 file changed, 217 insertions(+), 210 deletions(-) diff --git a/reference/SpaceTraders.yaml b/reference/SpaceTraders.yaml index 3efb1d6..b6bd22d 100644 --- a/reference/SpaceTraders.yaml +++ b/reference/SpaceTraders.yaml @@ -7,14 +7,14 @@ info: name: Joel Brubaker email: joel@spacetraders.io license: - name: "No" - url: "https://choosealicense.com/no-permission/" + name: 'No' + url: 'https://choosealicense.com/no-permission/' description: |- SpaceTraders is a multiplayer sci-fi strategy game where you acquire and manage a fleet of ships across a growing and dynamic universe. Similar to games such as Eve Online, you work with or against other players to establish trade routes, chart new systems, mine precious ores, patrol for pirates, spy on factions, and discover hidden treasures. - But what makes our game unique? SpaceTraders is entirely accessible through open and well-documented Web API endpoints. In fact, SpaceTraders doesn't have a first-class client to play the game - if you want to take it for a spin, you should try one of our community-created web clients, or use the API documentation to see how you might play a game through an API. + But what makes SpaceTraders unique is that the game is entirely accessible through open and well-documented API endpoints. In fact, SpaceTraders doesn't have a first-class client to play the game - if you want to take it for a spin, you should try one of our community-created web clients, or use the API documentation to see how you might play a game through an API. If this sounds fun and interesting to you, please drop into our Discord and get to know the community. We are actively working on new clients, new ideas and sharing tips for how to play the game. @@ -26,7 +26,7 @@ info: } ``` servers: - - url: "https://v2-0-0.alpha.spacetraders.io" + - url: 'https://v2-0-0.alpha.spacetraders.io' description: v2.0.0-alpha paths: /agents: @@ -35,7 +35,7 @@ paths: tags: - agents responses: - "201": + '201': description: OK content: application/json: @@ -80,7 +80,7 @@ paths: faction: COMMERCE_REPUBLIC type: PROCUREMENT terms: - deadline: "2022-03-11T05:16:59.113Z" + deadline: '2022-03-11T05:16:59.113Z' payment: onAccepted: 20000 onFulfilled: 100000 @@ -91,7 +91,7 @@ paths: fulfilled: 0 accepted: false fulfilled: false - expiresAt: "2022-03-09T05:16:59.112Z" + expiresAt: '2022-03-09T05:16:59.112Z' ship: symbol: string frame: string @@ -149,14 +149,14 @@ paths: type: string default: COMMERCE_REPUBLIC description: The faction you choose determines your headquarters. - description: "" + description: '' /my/agent: get: summary: My Agent Details tags: - agents responses: - "200": + '200': description: OK content: application/json: @@ -177,11 +177,11 @@ paths: security: - AgentToken: [] description: Fetch your agent's details. - "/my/ships/{shipSymbol}/chart": + '/my/ships/{shipSymbol}/chart': post: summary: Chart Waypoint responses: - "200": + '200': description: OK content: application/json: @@ -202,8 +202,15 @@ paths: submitted: - X1-ZZ - X1-ZZ-7-EE - operationId: "post-my-ships-:shipSymbol-chart" - description: "Chart a new system or waypoint. Returns an array of the symbols that have been charted, including the system and the waypoint if both were uncharted, or just the waypoint." + operationId: 'post-my-ships-:shipSymbol-chart' + description: |- + Command a ship to chart the current system and/or waypoint. + + Systems and waypoints in the universe are uncharted by default. These locations will not show up in the API until they have been charted by a ship. + + Charting a location will record your agent as the one who created the chart. + + Returns an array of system / waypoint symbols that have been charted. security: - AgentToken: [] tags: @@ -215,7 +222,7 @@ paths: in: path required: true description: The symbol of the ship - "/my/ships/{shipSymbol}/deliver": + '/my/ships/{shipSymbol}/deliver': parameters: - schema: type: string @@ -228,12 +235,12 @@ paths: tags: - contracts responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -266,7 +273,7 @@ paths: - contractId - tradeSymbol description: Deliver cargo on a given contract. - "/my/ships/{shipSymbol}/dock": + '/my/ships/{shipSymbol}/dock': parameters: - schema: type: string @@ -279,12 +286,12 @@ paths: tags: - navigation responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object properties: data: @@ -309,7 +316,7 @@ paths: security: - AgentToken: [] description: Transition your ship from orbit to docked. Consecutive calls to this endpoint will succeed. - "/my/ships/{shipSymbol}/orbit": + '/my/ships/{shipSymbol}/orbit': parameters: - schema: type: string @@ -320,12 +327,12 @@ paths: post: summary: Orbit Ship responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -350,7 +357,7 @@ paths: description: Transition your ship from docked into orbit. Ships are placed into orbit by default when arriving at a destination. Consecutive calls to this endpoint will continue to return a 200 response status. tags: - navigation - "/my/ships/{shipSymbol}/jettison": + '/my/ships/{shipSymbol}/jettison': parameters: - schema: type: string @@ -362,12 +369,12 @@ paths: tags: - ships responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object properties: data: @@ -409,7 +416,7 @@ paths: units: type: integer minimum: 1 - "/my/ships/{shipSymbol}/extract": + '/my/ships/{shipSymbol}/extract': parameters: - schema: type: string @@ -420,12 +427,12 @@ paths: post: summary: Extract Resources responses: - "201": + '201': description: Created content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -437,7 +444,7 @@ paths: units: 16 cooldown: duration: 119 - expiration: "2022-03-12T00:41:29.371Z" + expiration: '2022-03-12T00:41:29.371Z' properties: data: type: object @@ -462,7 +469,7 @@ paths: units: 16 cooldown: duration: 119 - expiration: "2022-03-12T00:41:29.371Z" + expiration: '2022-03-12T00:41:29.371Z' operationId: post-my-ships-shipSymbol-extract requestBody: content: @@ -470,7 +477,7 @@ paths: schema: type: - object - - "null" + - 'null' properties: survey: $ref: ../models/Survey.yaml @@ -483,8 +490,8 @@ paths: signature: X1-OE-D2DD38 deposits: - COPPER_ORE - expiration: "2022-03-08T05:41:55.514Z" - description: "" + expiration: '2022-03-08T05:41:55.514Z' + description: '' description: Extract resources from the waypoint into your ship. Send a survey as the payload to target specific yields. The entire survey must be sent as it contains a signature that the backend verifies. security: - AgentToken: [] @@ -494,19 +501,19 @@ paths: summary: Extraction Cooldown operationId: get-my-ships-shipSymbol-extract responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: data: cooldown: duration: 119 - expiration: "2022-03-12T00:41:29.285Z" + expiration: '2022-03-12T00:41:29.285Z' properties: data: type: object @@ -523,13 +530,13 @@ paths: data: cooldown: duration: 119 - expiration: "2022-03-12T00:41:29.285Z" + expiration: '2022-03-12T00:41:29.285Z' description: Get the status of your last extraction. security: - AgentToken: [] tags: - extract - "/my/ships/{shipSymbol}/survey": + '/my/ships/{shipSymbol}/survey': parameters: - schema: type: string @@ -539,12 +546,12 @@ paths: post: summary: Survey Waypoint responses: - "201": + '201': description: Created content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -552,47 +559,47 @@ paths: - signature: X1-OE-D2DD38 deposits: - COPPER_ORE - expiration: "2022-03-08T05:41:55.514Z" + expiration: '2022-03-08T05:41:55.514Z' - signature: X1-OE-B58FEB deposits: - ALUMINUM_ORE - ALUMINUM_ORE - ALUMINUM_ORE - expiration: "2022-03-08T05:39:15.519Z" + expiration: '2022-03-08T05:39:15.519Z' - signature: X1-OE-0E326C deposits: - ALUMINUM_ORE - SILICON - expiration: "2022-03-08T05:20:27.521Z" + expiration: '2022-03-08T05:20:27.521Z' - signature: X1-OE-5CDFA4 deposits: - COPPER_ORE - COPPER_ORE - COPPER_ORE - IRON_ORE - expiration: "2022-03-08T05:44:34.522Z" + expiration: '2022-03-08T05:44:34.522Z' - signature: X1-OE-86C3A1 deposits: - COPPER_ORE - COPPER_ORE - IRON_ORE - expiration: "2022-03-08T05:43:45.522Z" + expiration: '2022-03-08T05:43:45.522Z' - signature: X1-OE-C97BEA deposits: - ALUMINUM_ORE - COPPER_ORE - QUARTZ - QUARTZ - expiration: "2022-03-08T05:22:39.523Z" + expiration: '2022-03-08T05:22:39.523Z' - signature: X1-OE-9913BD deposits: - QUARTZ - expiration: "2022-03-08T05:37:45.523Z" + expiration: '2022-03-08T05:37:45.523Z' - signature: X1-OE-8D87D2 deposits: - COPPER_ORE - SILICON - expiration: "2022-03-08T05:32:57.524Z" + expiration: '2022-03-08T05:32:57.524Z' properties: data: type: object @@ -611,40 +618,40 @@ paths: data: cooldown: duration: 899 - expiration: "2022-03-12T02:11:35.618Z" + expiration: '2022-03-12T02:11:35.618Z' surveys: - signature: X1-OE-397C82 deposits: - SILICON - expiration: "2022-03-12T02:00:19.622Z" + 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" + 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" + expiration: '2022-03-12T02:18:00.626Z' - signature: X1-OE-660BE9 deposits: - ALUMINUM_ORE - expiration: "2022-03-12T02:20:45.626Z" + expiration: '2022-03-12T02:20:45.626Z' - signature: X1-OE-D64798 deposits: - COPPER_ORE - QUARTZ - SILICON - expiration: "2022-03-12T02:07:33.626Z" + expiration: '2022-03-12T02:07:33.626Z' - signature: X1-OE-F799F3 deposits: - IRON_ORE - expiration: "2022-03-12T02:23:16.627Z" + expiration: '2022-03-12T02:23:16.627Z' operationId: post-my-ships-shipSymbol-survey security: - AgentToken: [] @@ -659,7 +666,7 @@ paths: tags: - extract responses: - "200": + '200': description: OK content: application/json: @@ -677,10 +684,10 @@ paths: data: cooldown: duration: 899 - expiration: "2022-03-12T02:11:35.618Z" + expiration: '2022-03-12T02:11:35.618Z' operationId: get-my-ships-shipSymbol-survey - description: "Executing a survey will initiate a cooldown for a number of seconds before you can call it again. This endpoint returns the details of your cooldown, or a 404 if there is no cooldown for the survey action." - "/my/ships/{shipSymbol}/jump": + description: 'Executing a survey will initiate a cooldown for a number of seconds before you can call it again. This endpoint returns the details of your cooldown, or a 404 if there is no cooldown for the survey action.' + '/my/ships/{shipSymbol}/jump': parameters: - schema: type: string @@ -692,12 +699,12 @@ paths: tags: - navigation responses: - "201": + '201': description: Created content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -707,7 +714,7 @@ paths: destination: 00E0B1 cooldown: duration: 719 - expiration: "2022-03-12T00:52:56.735Z" + expiration: '2022-03-12T00:52:56.735Z' properties: data: type: object @@ -740,7 +747,7 @@ paths: destination: 00E0B1 cooldown: duration: 719 - expiration: "2022-03-12T00:52:56.735Z" + expiration: '2022-03-12T00:52:56.735Z' operationId: post-my-ships-shipSymbol-jump security: - AgentToken: [] @@ -757,19 +764,19 @@ paths: summary: Jump Cooldown operationId: get-my-ships-shipSymbol-jump responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: data: cooldown: duration: 719 - expiration: "2022-03-12T00:52:56.735Z" + expiration: '2022-03-12T00:52:56.735Z' properties: data: type: object @@ -784,7 +791,7 @@ paths: - AgentToken: [] tags: - navigation - "/my/ships/{shipSymbol}/purchase": + '/my/ships/{shipSymbol}/purchase': parameters: - schema: type: string @@ -796,12 +803,12 @@ paths: tags: - trade responses: - "201": + '201': description: Created content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -836,7 +843,7 @@ paths: type: string units: type: integer - "/my/ships/{shipSymbol}/sell": + '/my/ships/{shipSymbol}/sell': parameters: - schema: type: string @@ -848,12 +855,12 @@ paths: tags: - trade responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -889,8 +896,8 @@ paths: type: string units: type: integer - description: "" - "/my/ships/{shipSymbol}/refuel": + description: '' + '/my/ships/{shipSymbol}/refuel': parameters: - schema: type: string @@ -902,12 +909,12 @@ paths: tags: - navigation responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object properties: data: @@ -936,7 +943,7 @@ paths: operationId: post-my-ships-shipSymbol-refuel security: - AgentToken: [] - "/my/ships/{shipSymbol}/deploy": + '/my/ships/{shipSymbol}/deploy': parameters: - schema: type: string @@ -949,7 +956,7 @@ paths: tags: - markets responses: - "204": + '204': description: OK operationId: post-my-ships-shipSymbol-deploy security: @@ -968,7 +975,7 @@ paths: type: string required: - tradeSymbol - "/my/ships/{shipSymbol}/scan": + '/my/ships/{shipSymbol}/scan': parameters: - schema: type: string @@ -980,12 +987,12 @@ paths: tags: - ships responses: - "201": + '201': description: Created content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -998,7 +1005,7 @@ paths: frameSymbol: FRAME_HEAVY_FREIGHTER reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_I - expiration: "2022-03-08T05:20:14.725Z" + expiration: '2022-03-08T05:20:14.725Z' - symbol: ZANZIBAR_TRIKES-DF0AAF registration: factionSymbol: ZANZIBAR_TRIKES @@ -1006,7 +1013,7 @@ paths: frameSymbol: FRAME_SHUTTLE reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_II - expiration: "2022-03-08T05:20:00.725Z" + expiration: '2022-03-08T05:20:00.725Z' - symbol: ZANZIBAR_TRIKES-9B80BE registration: factionSymbol: ZANZIBAR_TRIKES @@ -1014,7 +1021,7 @@ paths: frameSymbol: FRAME_TRANSPORT reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_I - expiration: "2022-03-08T05:20:06.725Z" + expiration: '2022-03-08T05:20:06.725Z' - symbol: COMMERCE_REPUBLIC-117520 registration: factionSymbol: COMMERCE_REPUBLIC @@ -1022,7 +1029,7 @@ paths: frameSymbol: FRAME_SHUTTLE reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_II - expiration: "2022-03-08T05:19:55.725Z" + expiration: '2022-03-08T05:19:55.725Z' - symbol: SPACERS_GUILD-609AA5 registration: factionSymbol: SPACERS_GUILD @@ -1030,7 +1037,7 @@ paths: frameSymbol: FRAME_FRIGATE reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_I - expiration: "2022-03-08T05:19:38.725Z" + expiration: '2022-03-08T05:19:38.725Z' - symbol: MINERS_COLLECTIVE-7AD322 registration: factionSymbol: MINERS_COLLECTIVE @@ -1038,7 +1045,7 @@ paths: frameSymbol: FRAME_SHUTTLE reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_I - expiration: "2022-03-08T05:19:11.725Z" + expiration: '2022-03-08T05:19:11.725Z' - symbol: ZANZIBAR_TRIKES-AE6D78 registration: factionSymbol: ZANZIBAR_TRIKES @@ -1046,7 +1053,7 @@ paths: frameSymbol: FRAME_SHUTTLE reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_II - expiration: "2022-03-08T05:20:44.725Z" + expiration: '2022-03-08T05:20:44.725Z' - symbol: SPACERS_GUILD-92828B registration: factionSymbol: SPACERS_GUILD @@ -1054,7 +1061,7 @@ paths: frameSymbol: FRAME_LIGHT_FREIGHTER reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_II - expiration: "2022-03-08T05:20:49.726Z" + expiration: '2022-03-08T05:20:49.726Z' - symbol: ZANZIBAR_TRIKES-B5EAD1 registration: factionSymbol: ZANZIBAR_TRIKES @@ -1062,7 +1069,7 @@ paths: frameSymbol: FRAME_TRANSPORT reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_I - expiration: "2022-03-08T05:20:25.726Z" + expiration: '2022-03-08T05:20:25.726Z' - symbol: ZANZIBAR_TRIKES-6A4E0D registration: factionSymbol: ZANZIBAR_TRIKES @@ -1070,7 +1077,7 @@ paths: frameSymbol: FRAME_EXPLORER reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_II - expiration: "2022-03-08T05:19:19.726Z" + expiration: '2022-03-08T05:19:19.726Z' cooldown: 60 properties: data: @@ -1106,7 +1113,7 @@ paths: data: cooldown: duration: 59 - expiration: "2022-03-12T00:42:44.220Z" + expiration: '2022-03-12T00:42:44.220Z' ships: - symbol: SPACERS_GUILD-65E1BA registration: @@ -1115,7 +1122,7 @@ paths: frameSymbol: FRAME_LIGHT_FREIGHTER reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_I - expiration: "2022-03-12T00:44:14.222Z" + expiration: '2022-03-12T00:44:14.222Z' - symbol: MINERS_COLLECTIVE-C6ACCA registration: factionSymbol: MINERS_COLLECTIVE @@ -1123,7 +1130,7 @@ paths: frameSymbol: FRAME_INTERCEPTOR reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_I - expiration: "2022-03-12T00:44:38.222Z" + expiration: '2022-03-12T00:44:38.222Z' - symbol: COMMERCE_REPUBLIC-866DC7 registration: factionSymbol: COMMERCE_REPUBLIC @@ -1131,7 +1138,7 @@ paths: frameSymbol: FRAME_LIGHT_FREIGHTER reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_I - expiration: "2022-03-12T00:45:21.222Z" + expiration: '2022-03-12T00:45:21.222Z' - symbol: SPACERS_GUILD-2B1D01 registration: factionSymbol: SPACERS_GUILD @@ -1139,7 +1146,7 @@ paths: frameSymbol: FRAME_HEAVY_FREIGHTER reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_I - expiration: "2022-03-12T00:44:53.222Z" + expiration: '2022-03-12T00:44:53.222Z' - symbol: MINERS_COLLECTIVE-2F238C registration: factionSymbol: MINERS_COLLECTIVE @@ -1147,7 +1154,7 @@ paths: frameSymbol: FRAME_SHUTTLE reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_II - expiration: "2022-03-12T00:44:07.222Z" + expiration: '2022-03-12T00:44:07.222Z' - symbol: ZANZIBAR_TRIKES-ACF237 registration: factionSymbol: ZANZIBAR_TRIKES @@ -1155,7 +1162,7 @@ paths: frameSymbol: FRAME_INTERCEPTOR reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_II - expiration: "2022-03-12T00:44:22.223Z" + expiration: '2022-03-12T00:44:22.223Z' - symbol: SPACERS_GUILD-94A474 registration: factionSymbol: SPACERS_GUILD @@ -1163,7 +1170,7 @@ paths: frameSymbol: FRAME_SHUTTLE reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_I - expiration: "2022-03-12T00:43:51.223Z" + expiration: '2022-03-12T00:43:51.223Z' - symbol: ZANZIBAR_TRIKES-648BA8 registration: factionSymbol: ZANZIBAR_TRIKES @@ -1171,7 +1178,7 @@ paths: frameSymbol: FRAME_SHUTTLE reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_I - expiration: "2022-03-12T00:44:56.223Z" + expiration: '2022-03-12T00:44:56.223Z' - symbol: COMMERCE_REPUBLIC-1EED24 registration: factionSymbol: COMMERCE_REPUBLIC @@ -1179,7 +1186,7 @@ paths: frameSymbol: FRAME_EXPLORER reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_II - expiration: "2022-03-12T00:45:23.223Z" + expiration: '2022-03-12T00:45:23.223Z' - symbol: ZANZIBAR_TRIKES-A5600D registration: factionSymbol: ZANZIBAR_TRIKES @@ -1187,13 +1194,13 @@ paths: frameSymbol: FRAME_FRIGATE reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_II - expiration: "2022-03-12T00:44:00.223Z" + expiration: '2022-03-12T00:44:00.223Z' Departing Ships: value: data: cooldown: duration: 59 - expiration: "2022-03-12T00:42:44.220Z" + expiration: '2022-03-12T00:42:44.220Z' ships: - symbol: SPACERS_GUILD-65E1BA registration: @@ -1202,7 +1209,7 @@ paths: frameSymbol: FRAME_LIGHT_FREIGHTER reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_I - expiration: "2022-03-12T00:44:14.222Z" + expiration: '2022-03-12T00:44:14.222Z' - symbol: MINERS_COLLECTIVE-C6ACCA registration: factionSymbol: MINERS_COLLECTIVE @@ -1210,7 +1217,7 @@ paths: frameSymbol: FRAME_INTERCEPTOR reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_I - expiration: "2022-03-12T00:44:38.222Z" + expiration: '2022-03-12T00:44:38.222Z' - symbol: COMMERCE_REPUBLIC-866DC7 registration: factionSymbol: COMMERCE_REPUBLIC @@ -1218,7 +1225,7 @@ paths: frameSymbol: FRAME_LIGHT_FREIGHTER reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_I - expiration: "2022-03-12T00:45:21.222Z" + expiration: '2022-03-12T00:45:21.222Z' - symbol: SPACERS_GUILD-2B1D01 registration: factionSymbol: SPACERS_GUILD @@ -1226,7 +1233,7 @@ paths: frameSymbol: FRAME_HEAVY_FREIGHTER reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_I - expiration: "2022-03-12T00:44:53.222Z" + expiration: '2022-03-12T00:44:53.222Z' - symbol: MINERS_COLLECTIVE-2F238C registration: factionSymbol: MINERS_COLLECTIVE @@ -1234,7 +1241,7 @@ paths: frameSymbol: FRAME_SHUTTLE reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_II - expiration: "2022-03-12T00:44:07.222Z" + expiration: '2022-03-12T00:44:07.222Z' - symbol: ZANZIBAR_TRIKES-ACF237 registration: factionSymbol: ZANZIBAR_TRIKES @@ -1242,7 +1249,7 @@ paths: frameSymbol: FRAME_INTERCEPTOR reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_II - expiration: "2022-03-12T00:44:22.223Z" + expiration: '2022-03-12T00:44:22.223Z' - symbol: SPACERS_GUILD-94A474 registration: factionSymbol: SPACERS_GUILD @@ -1250,7 +1257,7 @@ paths: frameSymbol: FRAME_SHUTTLE reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_I - expiration: "2022-03-12T00:43:51.223Z" + expiration: '2022-03-12T00:43:51.223Z' - symbol: ZANZIBAR_TRIKES-648BA8 registration: factionSymbol: ZANZIBAR_TRIKES @@ -1258,7 +1265,7 @@ paths: frameSymbol: FRAME_SHUTTLE reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_I - expiration: "2022-03-12T00:44:56.223Z" + expiration: '2022-03-12T00:44:56.223Z' - symbol: COMMERCE_REPUBLIC-1EED24 registration: factionSymbol: COMMERCE_REPUBLIC @@ -1266,7 +1273,7 @@ paths: frameSymbol: FRAME_EXPLORER reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_II - expiration: "2022-03-12T00:45:23.223Z" + expiration: '2022-03-12T00:45:23.223Z' - symbol: ZANZIBAR_TRIKES-A5600D registration: factionSymbol: ZANZIBAR_TRIKES @@ -1274,19 +1281,19 @@ paths: frameSymbol: FRAME_FRIGATE reactorSymbol: REACTOR_FUSION_I engineSymbol: ENGINE_ION_DRIVE_II - expiration: "2022-03-12T00:44:00.223Z" + expiration: '2022-03-12T00:44:00.223Z' System Scan: value: data: cooldown: duration: 0 - expiration: "2022-03-12T00:42:44.220Z" + expiration: '2022-03-12T00:42:44.220Z' system: symbol: X1-OE sector: X1 type: RED_STAR x: 0 - "y": 0 + 'y': 0 waypoints: - X1-OE-PM - X1-OE-PM01 @@ -1303,13 +1310,13 @@ paths: data: cooldown: duration: 0 - expiration: "2022-03-12T00:42:44.220Z" + expiration: '2022-03-12T00:42:44.220Z' waypoint: system: X1-OE symbol: X1-OE-25X type: JUMP_GATE x: -1 - "y": -59 + 'y': -59 orbitals: [] faction: SPACERS_GUILD features: [] @@ -1319,7 +1326,7 @@ paths: operationId: post-my-ships-shipSymbol-scan security: - AgentToken: [] - description: "Execute a ship scan to view approach / departing ships, system information or details about a waypoint. Send a scan mode to select the type of scan performed by your ship." + description: 'Execute a ship scan to view approach / departing ships, system information or details about a waypoint. Send a scan mode to select the type of scan performed by your ship.' requestBody: content: application/json: @@ -1342,12 +1349,12 @@ paths: Departing Ships: value: mode: APPROACHING_SHIPS - description: "" + description: '' get: summary: Scan Cooldown operationId: get-my-ships-shipSymbol-scan responses: - "200": + '200': description: OK content: application/json: @@ -1365,12 +1372,12 @@ paths: data: cooldown: duration: 59 - expiration: "2022-03-12T00:42:44.220Z" + expiration: '2022-03-12T00:42:44.220Z' security: - AgentToken: [] tags: - ships - "/my/ships/{shipSymbol}/navigate": + '/my/ships/{shipSymbol}/navigate': parameters: - schema: type: string @@ -1383,12 +1390,12 @@ paths: tags: - navigation responses: - "201": + '201': description: Created content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -1435,12 +1442,12 @@ paths: summary: Navigation Status operationId: get-my-ships-shipSymbol-navigate responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -1473,7 +1480,7 @@ paths: - AgentToken: [] tags: - navigation - "/my/ships/{shipSymbol}": + '/my/ships/{shipSymbol}': parameters: - schema: type: string @@ -1485,12 +1492,12 @@ paths: tags: - ships responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -1507,7 +1514,7 @@ paths: - MOUNT_MINING_LASER_I registration: factionSymbol: COMMERCE_REPUBLIC - agentSymbol: "653298" + agentSymbol: '653298' fee: 100 role: EXCAVATOR integrity: @@ -1532,12 +1539,12 @@ paths: tags: - ships responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -1554,7 +1561,7 @@ paths: - MOUNT_MINING_LASER_I registration: factionSymbol: COMMERCE_REPUBLIC - agentSymbol: "653298" + agentSymbol: '653298' fee: 100 role: EXCAVATOR integrity: @@ -1576,7 +1583,7 @@ paths: - MOUNT_MINING_LASER_I registration: factionSymbol: COMMERCE_REPUBLIC - agentSymbol: "653298" + agentSymbol: '653298' fee: 100 role: EXCAVATOR integrity: @@ -1598,7 +1605,7 @@ paths: - MOUNT_MINING_LASER_I registration: factionSymbol: COMMERCE_REPUBLIC - agentSymbol: "653298" + agentSymbol: '653298' fee: 100 role: EXCAVATOR integrity: @@ -1620,7 +1627,7 @@ paths: - MOUNT_MINING_LASER_I registration: factionSymbol: COMMERCE_REPUBLIC - agentSymbol: "653298" + agentSymbol: '653298' fee: 100 role: EXCAVATOR integrity: @@ -1642,7 +1649,7 @@ paths: - MOUNT_MINING_LASER_I registration: factionSymbol: COMMERCE_REPUBLIC - agentSymbol: "653298" + agentSymbol: '653298' fee: 100 role: EXCAVATOR integrity: @@ -1664,7 +1671,7 @@ paths: - MOUNT_MINING_LASER_I registration: factionSymbol: COMMERCE_REPUBLIC - agentSymbol: "653298" + agentSymbol: '653298' fee: 100 role: EXCAVATOR integrity: @@ -1845,12 +1852,12 @@ paths: tags: - shipyards responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -1907,12 +1914,12 @@ paths: tags: - contracts responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -1921,7 +1928,7 @@ paths: faction: COMMERCE_REPUBLIC type: PROCUREMENT terms: - deadline: "2022-03-11T05:16:59.113Z" + deadline: '2022-03-11T05:16:59.113Z' payment: onAccepted: 20000 onFulfilled: 100000 @@ -1932,12 +1939,12 @@ paths: fulfilled: 0 accepted: false fulfilled: false - expiresAt: "2022-03-09T05:16:59.112Z" + expiresAt: '2022-03-09T05:16:59.112Z' - id: cl0hok3920023kv0jflbjpltg faction: COMMERCE_REPUBLIC type: PROCUREMENT terms: - deadline: "2022-03-11T05:16:59.123Z" + deadline: '2022-03-11T05:16:59.123Z' payment: onAccepted: 20000 onFulfilled: 100000 @@ -1948,7 +1955,7 @@ paths: fulfilled: 0 accepted: false fulfilled: false - expiresAt: "2022-03-09T05:16:59.122Z" + expiresAt: '2022-03-09T05:16:59.122Z' meta: total: 2 page: 1 @@ -1973,7 +1980,7 @@ paths: faction: COMMERCE_REPUBLIC type: PROCUREMENT terms: - deadline: "2022-03-11T05:16:59.113Z" + deadline: '2022-03-11T05:16:59.113Z' payment: onAccepted: 20000 onFulfilled: 100000 @@ -1984,7 +1991,7 @@ paths: fulfilled: 0 accepted: false fulfilled: false - expiresAt: "2022-03-09T05:16:59.112Z" + expiresAt: '2022-03-09T05:16:59.112Z' meta: total: 10 page: 1 @@ -1993,7 +2000,7 @@ paths: security: - AgentToken: [] description: List all of your contracts. - "/my/contracts/{contractId}": + '/my/contracts/{contractId}': parameters: - schema: type: string @@ -2006,7 +2013,7 @@ paths: tags: - contracts responses: - "200": + '200': description: OK content: application/json: @@ -2023,7 +2030,7 @@ paths: faction: COMMERCE_REPUBLIC type: PROCUREMENT terms: - deadline: "2022-03-11T05:16:59.113Z" + deadline: '2022-03-11T05:16:59.113Z' payment: onAccepted: 20000 onFulfilled: 100000 @@ -2034,12 +2041,12 @@ paths: fulfilled: 0 accepted: false fulfilled: false - expiresAt: "2022-03-09T05:16:59.112Z" + expiresAt: '2022-03-09T05:16:59.112Z' operationId: get-my-contracts-contractId security: - AgentToken: [] description: Get the details of a contract by ID. - "/my/contracts/{contractId}/accept": + '/my/contracts/{contractId}/accept': parameters: - schema: type: string @@ -2051,7 +2058,7 @@ paths: tags: - contracts responses: - "200": + '200': description: OK content: application/json: @@ -2070,12 +2077,12 @@ paths: tags: - systems responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -2084,7 +2091,7 @@ paths: sector: X1 type: RED_STAR x: 0 - "y": 0 + 'y': 0 waypoints: - X1-OE-PM - X1-OE-PM01 @@ -2100,7 +2107,7 @@ paths: sector: X1 type: ORANGE_STAR x: 3 - "y": 4 + 'y': 4 waypoints: - X1-EV-A004 factions: @@ -2111,7 +2118,7 @@ paths: sector: X1 type: BLUE_STAR x: -2 - "y": 11 + 'y': 11 waypoints: [] factions: [] charted: false @@ -2140,7 +2147,7 @@ paths: sector: X1 type: RED_STAR x: 0 - "y": 0 + 'y': 0 waypoints: - X1-OE-PM - X1-OE-PM01 @@ -2160,7 +2167,7 @@ paths: description: Return a list of all systems. security: - AgentToken: [] - "/systems/{systemSymbol}": + '/systems/{systemSymbol}': parameters: - schema: type: string @@ -2174,12 +2181,12 @@ paths: tags: - systems responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -2188,7 +2195,7 @@ paths: sector: X1 type: BLUE_STAR x: -2 - "y": 9 + 'y': 9 waypoints: [] factions: [] charted: false @@ -2206,7 +2213,7 @@ paths: sector: X1 type: BLUE_STAR x: -2 - "y": 9 + 'y': 9 waypoints: [] factions: [] charted: false @@ -2214,7 +2221,7 @@ paths: operationId: get-systems-systemSymbol security: - AgentToken: [] - "/systems/{systemSymbol}/shipyards": + '/systems/{systemSymbol}/shipyards': parameters: - schema: type: string @@ -2227,12 +2234,12 @@ paths: tags: - shipyards responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -2259,7 +2266,7 @@ paths: security: - AgentToken: [] description: Returns a list of all shipyards in a system. - "/systems/{systemSymbol}/shipyards/{waypointSymbol}": + '/systems/{systemSymbol}/shipyards/{waypointSymbol}': parameters: - schema: type: string @@ -2278,7 +2285,7 @@ paths: tags: - shipyards responses: - "200": + '200': description: OK content: application/json: @@ -2290,7 +2297,7 @@ paths: operationId: get-systems-systemSymbol-shipyards-waypointSymbol security: - AgentToken: [] - "/systems/{systemSymbol}/shipyards/{waypointSymbol}/ships": + '/systems/{systemSymbol}/shipyards/{waypointSymbol}/ships': parameters: - schema: type: string @@ -2309,12 +2316,12 @@ paths: tags: - shipyards responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -2350,7 +2357,7 @@ paths: operationId: get-systems-systemSymbol-shipyards-waypointSymbol-ships security: - AgentToken: [] - "/trade/{tradeSymbol}/imports": + '/trade/{tradeSymbol}/imports': parameters: - schema: type: string @@ -2363,12 +2370,12 @@ paths: tags: - markets responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object properties: data: @@ -2386,7 +2393,7 @@ paths: operationId: get-trade-tradeSymbol-imports security: - AgentToken: [] - "/trade/{tradeSymbol}/exports": + '/trade/{tradeSymbol}/exports': parameters: - schema: type: string @@ -2399,12 +2406,12 @@ paths: tags: - markets responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object properties: data: @@ -2422,7 +2429,7 @@ paths: operationId: get-trade-tradeSymbol-exports security: - AgentToken: [] - "/trade/{tradeSymbol}/exchange": + '/trade/{tradeSymbol}/exchange': parameters: - schema: type: string @@ -2435,12 +2442,12 @@ paths: tags: - markets responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object properties: data: @@ -2458,7 +2465,7 @@ paths: operationId: get-trade-tradeSymbol-exchange security: - AgentToken: [] - "/systems/{systemSymbol}/markets": + '/systems/{systemSymbol}/markets': parameters: - schema: type: string @@ -2471,12 +2478,12 @@ paths: tags: - markets responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -2519,7 +2526,7 @@ paths: To install a communications relay at a market, look at the `my/ships/{shipSymbol}/deploy` endpoint. security: - AgentToken: [] - "/systems/{systemSymbol}/markets/{waypointSymbol}": + '/systems/{systemSymbol}/markets/{waypointSymbol}': parameters: - schema: type: string @@ -2538,12 +2545,12 @@ paths: tags: - markets responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -2617,7 +2624,7 @@ paths: See `/my/ships/{shipSymbol}/deploy` for deploying relays at a location. security: - AgentToken: [] - "/systems/{systemSymbol}/waypoints": + '/systems/{systemSymbol}/waypoints': parameters: - schema: type: string @@ -2630,12 +2637,12 @@ paths: tags: - systems responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -2644,7 +2651,7 @@ paths: symbol: X1-OE-PM type: PLANET x: 10 - "y": 5 + 'y': 5 orbitals: - X1-OE-PM01 faction: COMMERCE_REPUBLIC @@ -2663,7 +2670,7 @@ paths: symbol: X1-OE-PM01 type: MOON x: 10 - "y": 5 + 'y': 5 orbitals: [] faction: COMMERCE_REPUBLIC features: @@ -2676,7 +2683,7 @@ paths: symbol: X1-OE-A005 type: ASTEROID_FIELD x: -1 - "y": -29 + 'y': -29 orbitals: [] faction: MINERS_COLLECTIVE features: [] @@ -2688,7 +2695,7 @@ paths: symbol: X1-OE-25X type: JUMP_GATE x: -38 - "y": 47 + 'y': 47 orbitals: [] faction: SPACERS_GUILD features: [] @@ -2719,7 +2726,7 @@ paths: symbol: X1-OE-PM type: PLANET x: 10 - "y": 5 + 'y': 5 orbitals: - X1-OE-PM01 faction: COMMERCE_REPUBLIC @@ -2738,7 +2745,7 @@ paths: symbol: X1-OE-PM01 type: MOON x: 10 - "y": 5 + 'y': 5 orbitals: [] faction: COMMERCE_REPUBLIC features: @@ -2751,7 +2758,7 @@ paths: symbol: X1-OE-A005 type: ASTEROID_FIELD x: -1 - "y": -29 + 'y': -29 orbitals: [] faction: MINERS_COLLECTIVE features: [] @@ -2763,7 +2770,7 @@ paths: symbol: X1-OE-25X type: JUMP_GATE x: -38 - "y": 47 + 'y': 47 orbitals: [] faction: SPACERS_GUILD features: [] @@ -2778,7 +2785,7 @@ paths: security: - AgentToken: [] description: Fetch all of the waypoints for a given system. System must be charted or a ship must be present to return waypoint details. - "/systems/{systemSymbol}/waypoints/{waypointSymbol}": + '/systems/{systemSymbol}/waypoints/{waypointSymbol}': parameters: - schema: type: string @@ -2797,12 +2804,12 @@ paths: tags: - systems responses: - "200": + '200': description: OK content: application/json: schema: - description: "" + description: '' type: object x-examples: example-1: @@ -2811,7 +2818,7 @@ paths: symbol: X1-OE-PM type: PLANET x: 10 - "y": 5 + 'y': 5 orbitals: - X1-OE-PM01 faction: COMMERCE_REPUBLIC @@ -2830,7 +2837,7 @@ paths: symbol: X1-OE-PM01 type: MOON x: 10 - "y": 5 + 'y': 5 orbitals: [] faction: COMMERCE_REPUBLIC features: @@ -2843,7 +2850,7 @@ paths: symbol: X1-OE-A005 type: ASTEROID_FIELD x: -1 - "y": -29 + 'y': -29 orbitals: [] faction: MINERS_COLLECTIVE features: [] @@ -2855,7 +2862,7 @@ paths: symbol: X1-OE-25X type: JUMP_GATE x: -38 - "y": 47 + 'y': 47 orbitals: [] faction: SPACERS_GUILD features: [] @@ -2886,7 +2893,7 @@ paths: symbol: X1-OE-PM type: PLANET x: 10 - "y": 5 + 'y': 5 orbitals: - X1-OE-PM01 faction: COMMERCE_REPUBLIC @@ -2905,7 +2912,7 @@ paths: symbol: X1-OE-PM01 type: MOON x: 10 - "y": 5 + 'y': 5 orbitals: [] faction: COMMERCE_REPUBLIC features: @@ -2918,7 +2925,7 @@ paths: symbol: X1-OE-A005 type: ASTEROID_FIELD x: -1 - "y": -29 + 'y': -29 orbitals: [] faction: MINERS_COLLECTIVE features: [] @@ -2930,7 +2937,7 @@ paths: symbol: X1-OE-25X type: JUMP_GATE x: -38 - "y": 47 + 'y': 47 orbitals: [] faction: SPACERS_GUILD features: [] From eea39e49c0da18eeb0f134328bb889e5ceff8f87 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Sun, 18 Sep 2022 08:49:41 -0700 Subject: [PATCH 02/48] feat: update ship schema --- .gitignore | 1 + models/Cooldown.json | 22 + models/Ship.json | 54 + models/Ship.yaml | 161 -- models/ShipCargo.json | 46 + models/ShipCondition.json | 6 + models/ShipCrew.json | 46 + models/ShipFrame.json | 60 + models/ShipFuel.json | 35 + models/ShipModule.json | 33 + models/ShipMount.json | 37 + models/ShipNav.json | 20 + models/ShipNavRoute.json | 34 + models/ShipNavSpeed.json | 10 + models/ShipNavStatus.json | 9 + models/ShipNavigation.yaml | 33 - models/ShipReactor.json | 39 + models/ShipRegistration.json | 32 + models/ShipRequirements.json | 18 + models/ShipRole.json | 16 + models/ShipThrusters.json | 34 + redocly.yaml | 18 + reference/SpaceTraders.json | 3803 ++++++++++++++++++++++++++++ reference/SpaceTraders.yaml | 2986 ---------------------- resources/agent/MyAgent.json | 44 + resources/agent/RegisterAgent.json | 68 + 26 files changed, 4485 insertions(+), 3180 deletions(-) create mode 100644 .gitignore create mode 100644 models/Cooldown.json create mode 100644 models/Ship.json delete mode 100644 models/Ship.yaml create mode 100644 models/ShipCargo.json create mode 100644 models/ShipCondition.json create mode 100644 models/ShipCrew.json create mode 100644 models/ShipFrame.json create mode 100644 models/ShipFuel.json create mode 100644 models/ShipModule.json create mode 100644 models/ShipMount.json create mode 100644 models/ShipNav.json create mode 100644 models/ShipNavRoute.json create mode 100644 models/ShipNavSpeed.json create mode 100644 models/ShipNavStatus.json delete mode 100644 models/ShipNavigation.yaml create mode 100644 models/ShipReactor.json create mode 100644 models/ShipRegistration.json create mode 100644 models/ShipRequirements.json create mode 100644 models/ShipRole.json create mode 100644 models/ShipThrusters.json create mode 100644 redocly.yaml create mode 100644 reference/SpaceTraders.json delete mode 100644 reference/SpaceTraders.yaml create mode 100644 resources/agent/MyAgent.json create mode 100644 resources/agent/RegisterAgent.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..496ee2c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store \ No newline at end of file diff --git a/models/Cooldown.json b/models/Cooldown.json new file mode 100644 index 0000000..cec9ffe --- /dev/null +++ b/models/Cooldown.json @@ -0,0 +1,22 @@ +{ + "type": "object", + "description": "A cooldown is a period of time in which a ship cannot perform certain actions.", + "properties": { + "totalSeconds": { + "type": "integer", + "description": "The total duration of the cooldown in seconds", + "minimum": 0 + }, + "remainingSeconds": { + "type": "integer", + "description": "The remaining duration of the cooldown in seconds", + "minimum": 0 + }, + "expiresAt": { + "type": "string", + "format": "date-time", + "description": "The date and time when the cooldown expires in ISO 8601 format", + "minimum": 0 + } + } +} \ No newline at end of file diff --git a/models/Ship.json b/models/Ship.json new file mode 100644 index 0000000..2b7175e --- /dev/null +++ b/models/Ship.json @@ -0,0 +1,54 @@ +{ + "description": "A ship", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "The globally unique identifier of the ship in the following format: `[AGENT_SYMBOL]_[HEX_ID]`", + "minLength": 8, + "examples": [ + "FALCON_0A1", + "FALCON_00A" + ] + }, + "registration": { + "$ref": "./ShipRegistration.json" + }, + "nav": { + "$ref": "./ShipNav.json" + }, + "crew": { + "$ref": "./ShipCrew.json" + }, + "frame": { + "$ref": "./ShipFrame.json" + }, + "reactor": { + "$ref": "./ShipReactor.json" + }, + "thrusters": { + "$ref": "./ShipThrusters.json" + }, + "modules": { + "type": "array", + "items": { + "$ref": "./ShipModule.json" + } + }, + "mounts": { + "type": "array", + "items": { + "$ref": "./ShipMount.json" + } + }, + "cargo": { + "$ref": "./ShipCargo.json" + }, + "fuel": { + "$ref": "./ShipFuel.json" + } + }, + "required": [ + "symbol" + ] +} \ No newline at end of file diff --git a/models/Ship.yaml b/models/Ship.yaml deleted file mode 100644 index 2ad4179..0000000 --- a/models/Ship.yaml +++ /dev/null @@ -1,161 +0,0 @@ -description: "" -type: object -x-examples: - example-1: - symbol: 2C52AD-1 - crew: null - officers: null - frame: FRAME_FRIGATE - reactor: REACTOR_FUSION_I - engine: ENGINE_ION_DRIVE_II - modules: - - MODULE_GAS_TANK - - MODULE_CARGO_HOLD - - MODULE_CARGO_HOLD - - MODULE_CREW_QUARTERS - - MODULE_ENVOY_QUARTERS - - MODULE_JUMP_DRIVE_I - mounts: - - MOUNT_SENSOR_ARRAY_II - - MOUNT_MINING_LASER_II - - MOUNT_GAS_SIPHON_II - registration: - factionSymbol: COMMERCE_REPUBLIC - agentSymbol: 2C52AD - fee: 0 - role: COMMAND - integrity: - frame: 1 - reactor: 1 - engine: 1 - status: DOCKED - location: X1-OE-PM - cargo: - - tradeSymbol: IRON_ORE - units: 100 -examples: - - symbol: 55B261-1 - crew: null - officers: null - fuel: 100 - frame: FRAME_DRONE - reactor: REACTOR_SOLAR_I - engine: ENGINE_SOLAR_PROPULSION - modules: - - MODULE_CARGO_HOLD - mounts: - - MOUNT_MINING_LASER_I - registration: - factionSymbol: COMMERCE_REPUBLIC - agentSymbol: 55B261 - fee: 100 - role: EXCAVATOR - integrity: - frame: 1 - reactor: 1 - engine: 1 - status: DOCKED - location: X1-OE-PM - cargo: [] -properties: - symbol: - type: string - minLength: 1 - frame: - type: string - minLength: 1 - reactor: - type: string - minLength: 1 - engine: - type: string - minLength: 1 - modules: - type: array - items: - type: string - mounts: - type: array - items: - type: string - registration: - type: object - required: - - factionSymbol - - agentSymbol - - fee - - role - properties: - factionSymbol: - type: string - minLength: 1 - agentSymbol: - type: string - minLength: 1 - fee: - type: integer - role: - type: string - minLength: 1 - integrity: - type: object - required: - - frame - - reactor - - engine - properties: - frame: - type: number - reactor: - type: number - engine: - type: number - stats: - type: object - required: - - fuelTank - - cargoLimit - - jumpRange - properties: - fuelTank: - type: integer - cargoLimit: - type: integer - jumpRange: - type: integer - status: - type: string - minLength: 1 - location: - type: string - minLength: 1 - cargo: - type: array - uniqueItems: true - minItems: 0 - items: - type: object - properties: - tradeSymbol: - type: string - minLength: 1 - units: - type: integer - required: - - tradeSymbol - - units - fuel: - type: integer -required: - - symbol - - frame - - reactor - - engine - - modules - - mounts - - registration - - integrity - - status - - location - - cargo - - fuel diff --git a/models/ShipCargo.json b/models/ShipCargo.json new file mode 100644 index 0000000..4f8edbd --- /dev/null +++ b/models/ShipCargo.json @@ -0,0 +1,46 @@ +{ + "type": "object", + "properties": { + "size": { + "type": "integer", + "minimum": 0 + }, + "inventory": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "examples": [ + "ORE_COPPER", + "MICROPROCESSORS", + "FOOD" + ] + }, + "name": { + "type": "string", + "examples": [ + "Copper Ore", + "Microprocessors", + "Food" + ] + }, + "units": { + "type": "integer", + "minimum": 1 + } + }, + "required": [ + "symbol", + "name", + "units" + ] + }, + "required": [ + "size", + "inventory" + ] + } + } +} \ No newline at end of file diff --git a/models/ShipCondition.json b/models/ShipCondition.json new file mode 100644 index 0000000..b1b2c01 --- /dev/null +++ b/models/ShipCondition.json @@ -0,0 +1,6 @@ +{ + "type": "integer", + "description": "Condition is a range of 0 to 100 where 0 is completely worn out and 100 is brand new.", + "minimum": 0, + "maximum": 100 +} \ No newline at end of file diff --git a/models/ShipCrew.json b/models/ShipCrew.json new file mode 100644 index 0000000..ca6ee29 --- /dev/null +++ b/models/ShipCrew.json @@ -0,0 +1,46 @@ +{ + "type": "object", + "required": [ + "count", + "min", + "max", + "rotation", + "morale" + ], + "description": "The ship's crew service and maintain the ship's systems and equipment.", + "properties": { + "count": { + "type": "integer", + "description": "The total number of crew members on the ship." + }, + "min": { + "type": "integer", + "description": "The minimum number of crew members required to maintain the ship." + }, + "max": { + "type": "integer", + "description": "The maximum number of crew members the ship can support." + }, + "rotation": { + "type": "string", + "description": "The rotation of crew shifts. Stricter shifts can improve the ship's performance, and more relaxed shifts can improve the crew's morale.", + "enum": [ + "STRICT", + "STANDARD", + "RELAXED" + ], + "default": "STANDARD" + }, + "morale": { + "type": "integer", + "description": "A rough measure of the crew's morale. A higher morale means the crew is happier and more productive. A lower morale means the ship is more prone to accidents.", + "minimum": 0, + "maximum": 100 + }, + "wages": { + "type": "integer", + "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 + } + } +} \ No newline at end of file diff --git a/models/ShipFrame.json b/models/ShipFrame.json new file mode 100644 index 0000000..ea51b29 --- /dev/null +++ b/models/ShipFrame.json @@ -0,0 +1,60 @@ +{ + "type": "object", + "description": "The frame of the ship. The frame determines the number of modules and mounting points of the ship, as well as base fuel capacity. As the condition of the frame takes more wear, the ship will become more sluggish and less maneuverable.", + "properties": { + "symbol": { + "type": "string", + "enum": [ + "FRAME_DRONE", + "FRAME_INTERCEPTOR", + "FRAME_RACER", + "FRAME_FIGHTER", + "FRAME_FRIGATE", + "FRAME_SHUTTLE", + "FRAME_EXPLORER", + "FRAME_LIGHT_FREIGHTER", + "FRAME_HEAVY_FREIGHTER", + "FRAME_TRANSPORT", + "FRAME_DESTROYER", + "FRAME_CRUISER", + "FRAME_CARRIER" + ] + }, + "name": { + "type": "string", + "enum": [ + "Drone", + "Interceptor", + "Racer", + "Fighter", + "Frigate", + "Shuttle", + "Explorer", + "Light Freighter", + "Heavy Freighter", + "Transport", + "Destroyer", + "Cruiser", + "Carrier" + ] + }, + "condition": { + "$ref": "./ShipCondition.json" + }, + "moduleSlots": { + "type": "integer", + "minimum": 0 + }, + "mountingPoints": { + "type": "integer", + "minimum": 0 + }, + "fuelCapacity": { + "type": "integer", + "minimum": 0 + }, + "requirements": { + "$ref": "./ShipRequirements.json" + } + } +} \ No newline at end of file diff --git a/models/ShipFuel.json b/models/ShipFuel.json new file mode 100644 index 0000000..94f3f1e --- /dev/null +++ b/models/ShipFuel.json @@ -0,0 +1,35 @@ +{ + "type": "object", + "description": "Details of the ship's fuel tanks including how much fuel was consumed during the last transit or action.", + "properties": { + "amount": { + "type": "integer", + "description": "The amount of fuel in the ship's tanks.", + "minimum": 0 + }, + "max": { + "type": "integer", + "description": "The maximum amount of fuel the ship's tanks can hold.", + "minimum": 0 + }, + "consumed": { + "type": "object", + "properties": { + "amount": { + "type": "integer", + "description": "The amount of fuel consumed by the most recent transit or action.", + "minimum": 0 + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The time at which the fuel was consumed." + } + }, + "required": [ + "amount", + "timestamp" + ] + } + } +} \ No newline at end of file diff --git a/models/ShipModule.json b/models/ShipModule.json new file mode 100644 index 0000000..0de418a --- /dev/null +++ b/models/ShipModule.json @@ -0,0 +1,33 @@ +{ + "type": "object", + "description": "A module can be installed in a ship and provides a set of capabilities such as storage space or quarters for crew.", + "properties": { + "symbol": { + "type": "string", + "enum": [ + "MODULE_FUEL_TANK", + "MODULE_CARGO_HOLD", + "MODULE_CREW_QUARTERS", + "MODULE_ENVOY_QUARTERS", + "MODULE_PASSENGER_CABIN", + "MODULE_MICRO_REFINERY", + "MODULE_JUMP_DRIVE" + ] + }, + "name": { + "type": "string", + "enum": [ + "Fuel Tank", + "Cargo Hold", + "Crew Quarters", + "Envoy Quarters", + "Passenger Cabin", + "Micro Refinery", + "Jump Drive" + ] + }, + "requirements": { + "$ref": "./ShipRequirements.json" + } + } +} \ No newline at end of file diff --git a/models/ShipMount.json b/models/ShipMount.json new file mode 100644 index 0000000..e79051a --- /dev/null +++ b/models/ShipMount.json @@ -0,0 +1,37 @@ +{ + "type": "object", + "description": "A mount is installed on the exterier of a ship.", + "properties": { + "symbol": { + "type": "string", + "enum": [ + "MOUNT_GAS_SIPHON_I", + "MOUNT_GAS_SIPHON_II", + "MOUNT_GAS_SIPHON_III", + "MOUNT_SENSOR_ARRAY_I", + "MOUNT_SENSOR_ARRAY_II", + "MOUNT_SENSOR_ARRAY_III", + "MOUNT_MINING_LASER_I", + "MOUNT_MINING_LASER_II", + "MOUNT_MINING_LASER_III" + ] + }, + "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" + ] + }, + "requirements": { + "$ref": "./ShipRequirements.json" + } + } +} \ No newline at end of file diff --git a/models/ShipNav.json b/models/ShipNav.json new file mode 100644 index 0000000..e92cf1d --- /dev/null +++ b/models/ShipNav.json @@ -0,0 +1,20 @@ +{ + "type": "object", + "description": "The navigation information of the ship.", + "properties": { + "route": { + "$ref": "./ShipNavRoute.json" + }, + "status": { + "$ref": "./ShipNavStatus.json" + }, + "speed": { + "$ref": "./ShipNavSpeed.json" + } + }, + "required": [ + "route", + "status", + "speed" + ] +} \ No newline at end of file diff --git a/models/ShipNavRoute.json b/models/ShipNavRoute.json new file mode 100644 index 0000000..eefe049 --- /dev/null +++ b/models/ShipNavRoute.json @@ -0,0 +1,34 @@ +{ + "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." + }, + "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." + }, + "arrival": { + "type": "string", + "format": "date-time", + "description": "The date time of the ship's arrival. If the ship is in-transit, this is the expected time of arrival." + } + }, + "required": [ + "symbol", + "name", + "x", + "y", + "arrival" + ] +} \ No newline at end of file diff --git a/models/ShipNavSpeed.json b/models/ShipNavSpeed.json new file mode 100644 index 0000000..84e626c --- /dev/null +++ b/models/ShipNavSpeed.json @@ -0,0 +1,10 @@ +{ + "type": "string", + "description": "The ship's set speed when travelling between waypoints. Nav speed can wear down the ship's engines and lower crew morale but improves travel time.", + "enum": [ + "CONSERVATIVE", + "CRUISE", + "MAX" + ], + "default": "CRUISE" +} \ No newline at end of file diff --git a/models/ShipNavStatus.json b/models/ShipNavStatus.json new file mode 100644 index 0000000..26768f0 --- /dev/null +++ b/models/ShipNavStatus.json @@ -0,0 +1,9 @@ +{ + "type": "string", + "description": "The current status of the ship", + "enum": [ + "IN_TRANSIT", + "IN_ORBIT", + "DOCKED" + ] +} \ No newline at end of file diff --git a/models/ShipNavigation.yaml b/models/ShipNavigation.yaml deleted file mode 100644 index b142d4e..0000000 --- a/models/ShipNavigation.yaml +++ /dev/null @@ -1,33 +0,0 @@ -description: "" -type: object -properties: - shipSymbol: - type: string - minLength: 1 - departure: - type: string - minLength: 1 - destination: - type: string - minLength: 1 - durationRemaining: - type: integer - arrivedAt: {} -required: - - shipSymbol - - departure - - destination - - durationRemaining -x-examples: - example-1: - shipSymbol: 3AE434-1 - departure: X1-OE-PM - destination: X1-OE-A005 - durationRemaining: 2159 - arrivedAt: null -examples: - - shipSymbol: 3AE434-1 - departure: X1-OE-PM - destination: X1-OE-A005 - durationRemaining: 2159 - arrivedAt: null diff --git a/models/ShipReactor.json b/models/ShipReactor.json new file mode 100644 index 0000000..8352b3f --- /dev/null +++ b/models/ShipReactor.json @@ -0,0 +1,39 @@ +{ + "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.", + "properties": { + "symbol": { + "type": "string", + "enum": [ + "SOLAR_REACTOR", + "FUSION_REACTOR", + "FISSION_REACTOR", + "CHEMICAL_REACTOR", + "DARK_MATTER_REACTOR" + ] + }, + "name": { + "type": "string", + "enum": [ + "Solar Reactor", + "Fusion Reactor", + "Fission Reactor", + "Chemical Reactor", + "Dark Matter Reactor" + ] + }, + "condition": { + "$ref": "./ShipCondition.json" + }, + "powerOutput": { + "type": "integer", + "minimum": 1 + }, + "cooldown": { + "$ref": "./Cooldown.json" + }, + "requirements": { + "$ref": "./ShipRequirements.json" + } + } +} \ No newline at end of file diff --git a/models/ShipRegistration.json b/models/ShipRegistration.json new file mode 100644 index 0000000..b682a33 --- /dev/null +++ b/models/ShipRegistration.json @@ -0,0 +1,32 @@ +{ + "type": "object", + "required": [ + "name", + "faction", + "role" + ], + "description": "The public registration information of the ship", + "properties": { + "name": { + "type": "string", + "description": "The agent's registered name of the ship", + "minLength": 1, + "examples": [ + "Red Falcon", + "Black Pearl IV", + "The Flying Dutchman" + ] + }, + "faction": { + "type": "string", + "description": "The symbol of the faction the ship is registered with", + "minLength": 1, + "examples": [ + "F_COMM" + ] + }, + "role": { + "$ref": "./ShipRole.json" + } + } +} \ No newline at end of file diff --git a/models/ShipRequirements.json b/models/ShipRequirements.json new file mode 100644 index 0000000..4a65b3f --- /dev/null +++ b/models/ShipRequirements.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "description": "The requirements for installation on a ship", + "properties": { + "power": { + "type": "integer", + "minimum": 0 + }, + "crew": { + "type": "integer", + "minimum": 0 + } + }, + "required": [ + "power", + "crew" + ] +} \ No newline at end of file diff --git a/models/ShipRole.json b/models/ShipRole.json new file mode 100644 index 0000000..b6867b7 --- /dev/null +++ b/models/ShipRole.json @@ -0,0 +1,16 @@ +{ + "type": "string", + "description": "The registered role of the ship", + "enum": [ + "FABRICATOR", + "HARVESTER", + "HAULER", + "EXCAVATOR", + "TRANSPORT", + "REPAIR", + "SURVEYOR", + "COMMAND", + "CARRIER", + "PATROL" + ] +} \ No newline at end of file diff --git a/models/ShipThrusters.json b/models/ShipThrusters.json new file mode 100644 index 0000000..6cf169a --- /dev/null +++ b/models/ShipThrusters.json @@ -0,0 +1,34 @@ +{ + "type": "object", + "description": "The thrusters determine how quickly a ship travels between waypoints.", + "properties": { + "symbol": { + "type": "string", + "enum": [ + "IMPULSE_DRIVE", + "ION_DRIVE_I", + "ION_DRIVE_II", + "HYPER_DRIVE" + ] + }, + "name": { + "type": "string", + "enum": [ + "Impulse Drive", + "Ion Drive", + "Advanced Ion Drive", + "Hyper Drive" + ] + }, + "condition": { + "$ref": "./ShipCondition.json" + }, + "speed": { + "type": "number", + "minimum": 1 + }, + "requirements": { + "$ref": "./ShipRequirements.json" + } + } +} \ No newline at end of file diff --git a/redocly.yaml b/redocly.yaml new file mode 100644 index 0000000..a40ea95 --- /dev/null +++ b/redocly.yaml @@ -0,0 +1,18 @@ +# See https://redocly.com/docs/cli/configuration/ + +apis: + # Update the apiName with your actual API name, and the version with your actual API version. + SpaceTraders@2.1.0: + # Update the path to your OpenAPI root file + root: ./reference/SpaceTraders.json + +lint: + extends: + - recommended + +features.openapi: + generateCodeSamples: + languages: + - lang: curl + - lang: Node.js + - lang: Python diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json new file mode 100644 index 0000000..b4bf174 --- /dev/null +++ b/reference/SpaceTraders.json @@ -0,0 +1,3803 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "SpaceTraders API", + "version": "2.1.0", + "summary": "SpaceTraders is a unique multiplayer game built on a free Web API.", + "contact": { + "name": "Joel Brubaker", + "email": "joel@spacetraders.io" + }, + "license": { + "name": "No Permission", + "url": "https://choosealicense.com/no-permission/" + }, + "description": "SpaceTraders is a multiplayer sci-fi strategy game where you acquire and manage a fleet of ships across a growing and dynamic universe.\n\nSimilar to games such as Eve Online, you work with or against other players to establish trade routes, chart new systems, mine precious ores, patrol for pirates, spy on factions, and discover hidden treasures.\n\nBut what makes SpaceTraders unique is that the game is entirely accessible through open and well-documented API endpoints. In fact, SpaceTraders doesn't have a first-class client to play the game - if you want to take it for a spin, you should try one of our community-created web clients, or use the API documentation to see how you might play a game through an API.\n\nIf this sounds fun and interesting to you, please drop into our Discord and get to know the community. We are actively working on new clients, new ideas and sharing tips for how to play the game.\n\n\n```json http\n{\n \"method\": \"GET\",\n \"url\": \"https://v2-0-0.alpha.spacetraders.io\",\n}\n```" + }, + "servers": [ + { + "url": "https://v2-1-0.spacetraders.io", + "description": "v2.1.0" + } + ], + "paths": { + "/agents": { + "post": { + "summary": "Register New Agent", + "tags": [ + "agents" + ], + "responses": { + "201": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "token": { + "type": "string" + }, + "agent": { + "$ref": "../models/Agent.yaml" + }, + "faction": { + "$ref": "../models/Faction.yaml" + }, + "contract": { + "$ref": "../models/Contract.yaml" + }, + "ship": { + "$ref": "../models/Ship.json" + } + } + } + } + } + } + } + } + }, + "operationId": "post-agents", + "description": "Creates a new agent and ties it to a temporary Account. Use `COMMERCE_REPUBLIC` as your starting faction if you don't know any other factions to choose from.\n\nThe agent symbol is a 4-8 character string that will represent your agent. This symbol will prefix the symbol of every ship you own. Agent symbols will be cast to all uppercase characters.\n\nA new agent will be granted an authorization token, a contract with their starting faction, a command ship with a jump drive, and one hundred thousand credits.\n\n> #### Keep your token safe and secure\n>\n> Save your token during the alpha phase. There is no way to regenerate this token without starting a new agent. In the future you will be able to generate and manage your tokens from the SpaceTraders website.\n\nYou can accept your contract using the `/my/contracts/{contractId}/accept` endpoint. You will want to navigate your command ship to a nearby asteroid field waypoint, and execute the `/my/ships/{shipSymbol}/accept` endpoint to mine various types of ores and minerals.\n\nReturn to the contract destination and execute the `/my/ships/{shipSymbol}/deliver` endpoint to deposit goods into the contract.\n\nWhen your contract is fulfilled, you can call `/my/contracts/{contractId}/fulfill` to retrieve payment.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "How other agents will see your ships and information.", + "minLength": 4, + "maxLength": 8, + "example": "BADGER" + }, + "faction": { + "type": "string", + "default": "COMMERCE_REPUBLIC", + "description": "The faction you choose determines your headquarters." + } + } + } + } + }, + "description": "" + } + } + }, + "/my/agent": { + "get": { + "summary": "My Agent Details", + "tags": [ + "agents" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "../models/Agent.yaml" + } + } + }, + "examples": { + "Agent": { + "value": { + "data": { + "accountId": "cl0hok34m0003ks0jjql5q8f2", + "symbol": "EMBER", + "headquarters": "X1-OE-PM", + "credits": 0 + } + } + } + } + } + } + } + }, + "operationId": "get-my-agent", + "security": [ + { + "AgentToken": [] + } + ], + "description": "Fetch your agent's details." + } + }, + "/my/ships/{shipSymbol}/chart": { + "post": { + "summary": "Chart Waypoint", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "submitted": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "examples": { + "Success": { + "value": { + "data": { + "submitted": [ + "X1-ZZ", + "X1-ZZ-7-EE" + ] + } + } + } + } + } + } + } + }, + "operationId": "post-my-ships-:shipSymbol-chart", + "description": "Command a ship to chart the current system and/or waypoint.\n\nSystems and waypoints in the universe are uncharted by default. These locations will not show up in the API until they have been charted by a ship.\n\nCharting a location will record your agent as the one who created the chart.\n\nReturns an array of system / waypoint symbols that have been charted.", + "security": [ + { + "AgentToken": [] + } + ], + "tags": [ + "systems" + ] + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true, + "description": "The symbol of the ship" + } + ] + }, + "/my/ships/{shipSymbol}/deliver": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true, + "description": "The symbol of the ship" + } + ], + "post": { + "summary": "Deliver on Contract", + "tags": [ + "contracts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "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" + } + }, + "required": [ + "data" + ] + } + } + } + } + }, + "operationId": "post-my-ships-shipSymbol-deliver", + "security": [ + { + "AgentToken": [] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "contractId": { + "type": "string" + }, + "tradeSymbol": { + "type": "string" + }, + "units": { + "type": "integer" + } + }, + "required": [ + "contractId", + "tradeSymbol" + ] + } + } + } + }, + "description": "Deliver cargo on a given contract." + } + }, + "/my/ships/{shipSymbol}/nav/transit": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true, + "description": "The ship symbol" + } + ], + "post": { + "summary": "Navigate Ship", + "tags": [ + "navigation" + ], + "responses": { + "201": { + "description": "The successful transit information including the route details and changes to ship fuel, supplies, and crew wages paid. The route includes the expected time of arrival.", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": { + "shipSymbol": "3AE434-1", + "departure": "X1-OE-PM", + "destination": "X1-OE-A005", + "durationRemaining": 2159, + "arrivedAt": null + } + } + }, + "properties": { + "data": { + "type": "object", + "properties": { + "route": { + "$ref": "../models/ShipNavRoute.json" + }, + "shipFuel": { + "$ref": "../models/ShipFuel.json" + } + } + } + }, + "required": [ + "data" + ] + }, + "examples": { + "Success": { + "value": { + "data": { + "fuelCost": 38, + "navigation": { + "shipSymbol": "BA03F2-1", + "departure": "X1-OE-PM", + "destination": "X1-OE-A005", + "durationRemaining": 2279, + "arrivedAt": null + } + } + } + } + } + } + } + } + }, + "operationId": "post-my-ships-shipSymbol-navigate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "waypointSymbol": { + "type": "string", + "description": "The target destination." + } + }, + "required": [ + "waypointSymbol" + ] + } + } + }, + "description": "" + }, + "security": [ + { + "AgentToken": [] + } + ], + "description": "Navigate to a target destination. The destination must be located within the same system as the ship. Navigating will consume the necessary fuel and supplies from the ship's manifest, and will pay out crew wages from the agent's account.\n\nThe returned response will detail the route information including the expected time of arrival. Most ship actions are unavailable until the ship has arrived at it's destination.\n\nFor faster-than-light travel between systems, see the ship's jump action." + } + }, + "/my/ships/{shipSymbol}/nav/dock": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true, + "description": "The symbol of the ship" + } + ], + "post": { + "summary": "Dock Ship", + "tags": [ + "navigation" + ], + "responses": { + "200": { + "description": "The ship has successfully docked at it's current location.", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": { + "status": "DOCKED" + } + } + }, + "properties": { + "data": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "$ref": "../models/ShipNavStatus.json" + } + } + } + }, + "required": [ + "data" + ] + }, + "examples": { + "Success": { + "value": { + "data": { + "status": "DOCKED" + } + } + } + } + } + } + } + }, + "operationId": "post-my-ships-shipSymbol-dock", + "security": [ + { + "AgentToken": [] + } + ], + "description": "Attempt to dock your ship at it's current location. Docking will only succeed if the waypoint is a dockable location, and your ship is capable of docking at the time of the request.\n\nThe endpoint is idempotent - successive calls will succeed even if the ship is already docked." + } + }, + "/my/ships/{shipSymbol}/nav/orbit": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true, + "description": "The symbol of the ship" + } + ], + "post": { + "summary": "Orbit Ship", + "responses": { + "200": { + "description": "The ship has successfully moved into orbit at it's current location.", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": { + "status": "ORBIT" + } + } + }, + "properties": { + "data": { + "type": "object", + "properties": { + "status": { + "$ref": "../models/ShipNavStatus.json" + } + } + } + }, + "required": [ + "data" + ] + }, + "examples": { + "Success": { + "value": { + "data": { + "status": "ORBIT" + } + } + } + } + } + } + } + }, + "operationId": "post-my-ships-shipSymbol-orbit", + "security": [ + { + "AgentToken": [] + } + ], + "description": "Attempt to move your ship into orbit at it's current location. The request will only succeed if your ship is capable of moving into orbit at the time of the request.\n\nThe endpoint is idempotent - successive calls will succeed even if the ship is already in orbit.", + "tags": [ + "navigation" + ] + } + }, + "/my/ships/{shipSymbol}/jettison": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true + } + ], + "post": { + "summary": "Jettison Cargo", + "tags": [ + "ships" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "tradeSymbol": { + "type": "string", + "minLength": 1 + }, + "units": { + "type": "integer" + } + }, + "required": [ + "tradeSymbol", + "units" + ] + } + }, + "required": [ + "data" + ], + "x-examples": { + "example-1": { + "data": { + "tradeSymbol": "ALUMINUM", + "units": 95 + } + } + } + }, + "examples": { + "Success": { + "value": { + "data": { + "tradeSymbol": "ALUMINUM", + "units": 95 + } + } + } + } + } + } + } + }, + "operationId": "post-my-ships-shipSymbol-jettison", + "description": "Jettison cargo from your ship's cargo hold.", + "security": [ + { + "AgentToken": [] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tradeSymbol": { + "type": "string" + }, + "units": { + "type": "integer", + "minimum": 1 + } + } + } + } + } + } + } + }, + "/my/ships/{shipSymbol}/extract": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true, + "description": "The ship symbol" + } + ], + "post": { + "summary": "Extract Resources", + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": { + "extraction": { + "shipSymbol": "4B902A-1", + "yield": { + "tradeSymbol": "SILICON", + "units": 16 + } + }, + "cooldown": { + "duration": 119, + "expiration": "2022-03-12T00:41:29.371Z" + } + } + } + }, + "properties": { + "data": { + "type": "object", + "required": [ + "extraction", + "cooldown" + ], + "properties": { + "extraction": { + "$ref": "../models/Extraction.yaml" + }, + "cooldown": { + "$ref": "../models/Cooldown.yaml" + } + } + } + }, + "required": [ + "data" + ] + }, + "examples": { + "Success": { + "value": { + "data": { + "extraction": { + "shipSymbol": "4B902A-1", + "yield": { + "tradeSymbol": "SILICON", + "units": 16 + } + }, + "cooldown": { + "duration": 119, + "expiration": "2022-03-12T00:41:29.371Z" + } + } + } + } + } + } + } + } + }, + "operationId": "post-my-ships-shipSymbol-extract", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": [ + "object", + "null" + ], + "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" + } + } + } + } + } + }, + "description": "" + }, + "description": "Extract resources from the waypoint into your ship. Send a survey as the payload to target specific yields. The entire survey must be sent as it contains a signature that the backend verifies.", + "security": [ + { + "AgentToken": [] + } + ], + "tags": [ + "extract" + ] + }, + "get": { + "summary": "Extraction Cooldown", + "operationId": "get-my-ships-shipSymbol-extract", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": { + "cooldown": { + "duration": 119, + "expiration": "2022-03-12T00:41:29.285Z" + } + } + } + }, + "properties": { + "data": { + "type": "object", + "required": [ + "cooldown" + ], + "properties": { + "cooldown": { + "$ref": "../models/Cooldown.yaml" + } + } + } + }, + "required": [ + "data" + ] + }, + "examples": { + "Success": { + "value": { + "data": { + "cooldown": { + "duration": 119, + "expiration": "2022-03-12T00:41:29.285Z" + } + } + } + } + } + } + } + } + }, + "description": "Get the status of your last extraction.", + "security": [ + { + "AgentToken": [] + } + ], + "tags": [ + "extract" + ] + } + }, + "/my/ships/{shipSymbol}/survey": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true + } + ], + "post": { + "summary": "Survey Waypoint", + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": [ + { + "signature": "X1-OE-D2DD38", + "deposits": [ + "COPPER_ORE" + ], + "expiration": "2022-03-08T05:41:55.514Z" + }, + { + "signature": "X1-OE-B58FEB", + "deposits": [ + "ALUMINUM_ORE", + "ALUMINUM_ORE", + "ALUMINUM_ORE" + ], + "expiration": "2022-03-08T05:39:15.519Z" + }, + { + "signature": "X1-OE-0E326C", + "deposits": [ + "ALUMINUM_ORE", + "SILICON" + ], + "expiration": "2022-03-08T05:20:27.521Z" + }, + { + "signature": "X1-OE-5CDFA4", + "deposits": [ + "COPPER_ORE", + "COPPER_ORE", + "COPPER_ORE", + "IRON_ORE" + ], + "expiration": "2022-03-08T05:44:34.522Z" + }, + { + "signature": "X1-OE-86C3A1", + "deposits": [ + "COPPER_ORE", + "COPPER_ORE", + "IRON_ORE" + ], + "expiration": "2022-03-08T05:43:45.522Z" + }, + { + "signature": "X1-OE-C97BEA", + "deposits": [ + "ALUMINUM_ORE", + "COPPER_ORE", + "QUARTZ", + "QUARTZ" + ], + "expiration": "2022-03-08T05:22:39.523Z" + }, + { + "signature": "X1-OE-9913BD", + "deposits": [ + "QUARTZ" + ], + "expiration": "2022-03-08T05:37:45.523Z" + }, + { + "signature": "X1-OE-8D87D2", + "deposits": [ + "COPPER_ORE", + "SILICON" + ], + "expiration": "2022-03-08T05:32:57.524Z" + } + ] + } + }, + "properties": { + "data": { + "type": "object", + "properties": { + "surveys": { + "type": "array", + "items": { + "$ref": "../models/Survey.yaml" + } + }, + "cooldown": { + "$ref": "../models/Cooldown.yaml" + } + } + } + }, + "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" + } + ] + } + } + } + } + } + } + } + }, + "operationId": "post-my-ships-shipSymbol-survey", + "security": [ + { + "AgentToken": [] + } + ], + "description": "If you want to target specific yields for an extraction, you can survey a waypoint, such as an asteroid field, and send the survey in the body of the extract request. Each survey may have multiple deposits, and if a symbol shows up more than once, that indicates a higher chance of extracting that resource.\n\nYour ship will enter a cooldown between consecutive survey requests. Surveys will eventually expire after a period of time. Multiple ships can use the same survey for extraction.", + "tags": [ + "extract" + ] + }, + "get": { + "summary": "Survey Cooldown", + "tags": [ + "extract" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "cooldown": { + "$ref": "../models/Cooldown.yaml" + } + } + } + } + }, + "examples": { + "Success": { + "value": { + "data": { + "cooldown": { + "duration": 899, + "expiration": "2022-03-12T02:11:35.618Z" + } + } + } + } + } + } + } + } + }, + "operationId": "get-my-ships-shipSymbol-survey", + "description": "Executing a survey will initiate a cooldown for a number of seconds before you can call it again. This endpoint returns the details of your cooldown, or a 404 if there is no cooldown for the survey action." + } + }, + "/my/ships/{shipSymbol}/jump": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true + } + ], + "post": { + "summary": "Jump Ship", + "tags": [ + "navigation" + ], + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "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 + } + } + }, + "cooldown": { + "$ref": "../models/Cooldown.yaml" + } + } + } + }, + "required": [ + "data" + ] + }, + "examples": { + "Success": { + "value": { + "data": { + "jump": { + "shipSymbol": "1D7FDA-1", + "destination": "00E0B1" + }, + "cooldown": { + "duration": 719, + "expiration": "2022-03-12T00:52:56.735Z" + } + } + } + } + } + } + } + } + }, + "operationId": "post-my-ships-shipSymbol-jump", + "security": [ + { + "AgentToken": [] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "destination": { + "type": "string", + "description": "The system symbol to jump to." + } + } + } + } + } + } + }, + "get": { + "summary": "Jump Cooldown", + "operationId": "get-my-ships-shipSymbol-jump", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": { + "cooldown": { + "duration": 719, + "expiration": "2022-03-12T00:52:56.735Z" + } + } + } + }, + "properties": { + "data": { + "type": "object", + "required": [ + "cooldown" + ], + "properties": { + "cooldown": { + "$ref": "../models/Cooldown.yaml" + } + } + } + }, + "required": [ + "data" + ] + } + } + } + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "tags": [ + "navigation" + ] + } + }, + "/my/ships/{shipSymbol}/purchase": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true + } + ], + "post": { + "summary": "Purchase Cargo", + "tags": [ + "trade" + ], + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "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" + } + }, + "required": [ + "data" + ] + }, + "examples": { + "Success": { + "value": { + "data": { + "waypointSymbol": "X1-OE-PM", + "tradeSymbol": "MICROPROCESSORS", + "credits": -843, + "units": 1 + } + } + } + } + } + } + } + }, + "operationId": "post-my-ships-shipSymbol-purchase", + "security": [ + { + "AgentToken": [] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tradeSymbol": { + "type": "string" + }, + "units": { + "type": "integer" + } + } + } + } + } + } + } + }, + "/my/ships/{shipSymbol}/sell": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true + } + ], + "post": { + "summary": "Sell Cargo", + "tags": [ + "trade" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": { + "waypointSymbol": "X1-OE-PM", + "tradeSymbol": "SILICON", + "credits": 144, + "units": -1 + } + } + }, + "properties": { + "data": { + "$ref": "../models/Trade.yaml" + } + }, + "required": [ + "data" + ] + }, + "examples": { + "Success": { + "value": { + "data": { + "waypointSymbol": "X1-OE-PM", + "tradeSymbol": "SILICON", + "credits": 144, + "units": -1 + } + } + } + } + } + } + } + }, + "operationId": "post-my-ships-shipSymbol-sell", + "description": "Sell cargo from your ship's hold to the local market.", + "security": [ + { + "AgentToken": [] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tradeSymbol": { + "type": "string" + }, + "units": { + "type": "integer" + } + } + } + } + }, + "description": "" + } + } + }, + "/my/ships/{shipSymbol}/refuel": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true + } + ], + "post": { + "summary": "Refuel Ship", + "tags": [ + "navigation" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "credits": { + "type": "integer" + }, + "fuel": { + "type": "integer" + } + }, + "required": [ + "credits", + "fuel" + ] + } + }, + "required": [ + "data" + ], + "x-examples": { + "example-1": { + "data": { + "credits": 0, + "fuel": 0 + } + } + } + }, + "examples": { + "Success": { + "value": { + "data": { + "credits": -1920, + "fuel": 800 + } + } + } + } + } + } + } + }, + "operationId": "post-my-ships-shipSymbol-refuel", + "security": [ + { + "AgentToken": [] + } + ] + } + }, + "/my/ships/{shipSymbol}/deploy": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true, + "description": "The ship symbol" + } + ], + "post": { + "summary": "Deploy Asset", + "tags": [ + "markets" + ], + "responses": { + "204": { + "description": "OK" + } + }, + "operationId": "post-my-ships-shipSymbol-deploy", + "security": [ + { + "AgentToken": [] + } + ], + "description": "Use this endpoint to deploy a Communications Relay to a waypoint. A waypoint with a communications relay will allow agents to retrieve price information from the market. Without a relay, agents must send a ship to a market to retrieve price information.\n\nCommunication relays can be purchased from a market that exports `COMM_RELAY_I`.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tradeSymbol": { + "type": "string" + } + }, + "required": [ + "tradeSymbol" + ] + } + } + } + } + } + }, + "/my/ships/{shipSymbol}/scan": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true + } + ], + "post": { + "summary": "Scan", + "tags": [ + "ships" + ], + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": { + "ships": [ + { + "symbol": "COMMERCE_REPUBLIC-0060A0", + "registration": { + "factionSymbol": "COMMERCE_REPUBLIC", + "role": "EXCAVATOR" + }, + "frameSymbol": "FRAME_HEAVY_FREIGHTER", + "reactorSymbol": "REACTOR_FUSION_I", + "engineSymbol": "ENGINE_ION_DRIVE_I", + "expiration": "2022-03-08T05:20:14.725Z" + }, + { + "symbol": "ZANZIBAR_TRIKES-DF0AAF", + "registration": { + "factionSymbol": "ZANZIBAR_TRIKES", + "role": "HAULER" + }, + "frameSymbol": "FRAME_SHUTTLE", + "reactorSymbol": "REACTOR_FUSION_I", + "engineSymbol": "ENGINE_ION_DRIVE_II", + "expiration": "2022-03-08T05:20:00.725Z" + }, + { + "symbol": "ZANZIBAR_TRIKES-9B80BE", + "registration": { + "factionSymbol": "ZANZIBAR_TRIKES", + "role": "TRANSPORT" + }, + "frameSymbol": "FRAME_TRANSPORT", + "reactorSymbol": "REACTOR_FUSION_I", + "engineSymbol": "ENGINE_ION_DRIVE_I", + "expiration": "2022-03-08T05:20:06.725Z" + }, + { + "symbol": "COMMERCE_REPUBLIC-117520", + "registration": { + "factionSymbol": "COMMERCE_REPUBLIC", + "role": "HARVESTER" + }, + "frameSymbol": "FRAME_SHUTTLE", + "reactorSymbol": "REACTOR_FUSION_I", + "engineSymbol": "ENGINE_ION_DRIVE_II", + "expiration": "2022-03-08T05:19:55.725Z" + }, + { + "symbol": "SPACERS_GUILD-609AA5", + "registration": { + "factionSymbol": "SPACERS_GUILD", + "role": "HAULER" + }, + "frameSymbol": "FRAME_FRIGATE", + "reactorSymbol": "REACTOR_FUSION_I", + "engineSymbol": "ENGINE_ION_DRIVE_I", + "expiration": "2022-03-08T05:19:38.725Z" + }, + { + "symbol": "MINERS_COLLECTIVE-7AD322", + "registration": { + "factionSymbol": "MINERS_COLLECTIVE", + "role": "EXCAVATOR" + }, + "frameSymbol": "FRAME_SHUTTLE", + "reactorSymbol": "REACTOR_FUSION_I", + "engineSymbol": "ENGINE_ION_DRIVE_I", + "expiration": "2022-03-08T05:19:11.725Z" + }, + { + "symbol": "ZANZIBAR_TRIKES-AE6D78", + "registration": { + "factionSymbol": "ZANZIBAR_TRIKES", + "role": "HAULER" + }, + "frameSymbol": "FRAME_SHUTTLE", + "reactorSymbol": "REACTOR_FUSION_I", + "engineSymbol": "ENGINE_ION_DRIVE_II", + "expiration": "2022-03-08T05:20:44.725Z" + }, + { + "symbol": "SPACERS_GUILD-92828B", + "registration": { + "factionSymbol": "SPACERS_GUILD", + "role": "SURVEYOR" + }, + "frameSymbol": "FRAME_LIGHT_FREIGHTER", + "reactorSymbol": "REACTOR_FUSION_I", + "engineSymbol": "ENGINE_ION_DRIVE_II", + "expiration": "2022-03-08T05:20:49.726Z" + }, + { + "symbol": "ZANZIBAR_TRIKES-B5EAD1", + "registration": { + "factionSymbol": "ZANZIBAR_TRIKES", + "role": "TRANSPORT" + }, + "frameSymbol": "FRAME_TRANSPORT", + "reactorSymbol": "REACTOR_FUSION_I", + "engineSymbol": "ENGINE_ION_DRIVE_I", + "expiration": "2022-03-08T05:20:25.726Z" + }, + { + "symbol": "ZANZIBAR_TRIKES-6A4E0D", + "registration": { + "factionSymbol": "ZANZIBAR_TRIKES", + "role": "HAULER" + }, + "frameSymbol": "FRAME_EXPLORER", + "reactorSymbol": "REACTOR_FUSION_I", + "engineSymbol": "ENGINE_ION_DRIVE_II", + "expiration": "2022-03-08T05:19:19.726Z" + } + ], + "cooldown": 60 + } + } + }, + "properties": { + "data": { + "oneOf": [ + { + "properties": { + "ships": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "$ref": "../models/ScannedShip.yaml" + } + }, + "cooldown": { + "$ref": "../models/Cooldown.yaml" + } + }, + "required": [ + "ships", + "cooldown" + ] + }, + { + "properties": { + "cooldown": { + "$ref": "../models/Cooldown.yaml" + }, + "system": { + "$ref": "../models/System.yaml" + } + } + }, + { + "properties": { + "cooldown": { + "$ref": "../models/Cooldown.yaml" + }, + "waypoint": { + "$ref": "../models/Waypoint.yaml" + } + } + } + ], + "type": "object" + } + }, + "required": [ + "data" + ] + } + } + } + } + }, + "operationId": "post-my-ships-shipSymbol-scan", + "security": [ + { + "AgentToken": [] + } + ], + "description": "Execute a ship scan to view approach / departing ships, system information or details about a waypoint. Send a scan mode to select the type of scan performed by your ship.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "enum": [ + "APPROACHING_SHIPS", + "DEPARTING_SHIPS", + "SYSTEM", + "WAYPOINT" + ] + } + }, + "required": [ + "mode" + ] + }, + "examples": { + "Approaching Ships": { + "value": { + "mode": "APPROACHING_SHIPS" + } + }, + "Departing Ships": { + "value": { + "mode": "APPROACHING_SHIPS" + } + } + } + } + }, + "description": "" + } + }, + "get": { + "summary": "Scan Cooldown", + "operationId": "get-my-ships-shipSymbol-scan", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "cooldown": { + "$ref": "../models/Cooldown.yaml" + } + } + } + } + }, + "examples": { + "Success": { + "value": { + "data": { + "cooldown": { + "duration": 59, + "expiration": "2022-03-12T00:42:44.220Z" + } + } + } + } + } + } + } + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "tags": [ + "ships" + ] + } + }, + "/my/ships/{shipSymbol}": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true + } + ], + "get": { + "summary": "View Ship", + "tags": [ + "ships" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": { + "symbol": "653298-1", + "crew": null, + "officers": null, + "frame": "FRAME_DRONE", + "reactor": "REACTOR_SOLAR_I", + "engine": "ENGINE_SOLAR_PROPULSION", + "modules": [ + "MODULE_CARGO_HOLD" + ], + "mounts": [ + "MOUNT_MINING_LASER_I" + ], + "registration": { + "factionSymbol": "COMMERCE_REPUBLIC", + "agentSymbol": "653298", + "fee": 100, + "role": "EXCAVATOR" + }, + "integrity": { + "frame": 1, + "reactor": 1, + "engine": 1 + }, + "status": "DOCKED", + "location": "X1-OE-PM", + "cargo": [] + } + } + }, + "properties": { + "data": { + "$ref": "../models/Ship.json" + } + }, + "required": [ + "data" + ] + } + } + } + } + }, + "operationId": "get-my-ships-shipSymbol", + "description": "Retrieve the details of your ship.", + "security": [ + { + "AgentToken": [] + } + ] + } + }, + "/my/ships": { + "get": { + "summary": "List Ships", + "tags": [ + "ships" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": [ + { + "symbol": "653298-1", + "crew": null, + "officers": null, + "frame": "FRAME_DRONE", + "reactor": "REACTOR_SOLAR_I", + "engine": "ENGINE_SOLAR_PROPULSION", + "modules": [ + "MODULE_CARGO_HOLD" + ], + "mounts": [ + "MOUNT_MINING_LASER_I" + ], + "registration": { + "factionSymbol": "COMMERCE_REPUBLIC", + "agentSymbol": "653298", + "fee": 100, + "role": "EXCAVATOR" + }, + "integrity": { + "frame": 1, + "reactor": 1, + "engine": 1 + }, + "status": "DOCKED", + "location": "X1-OE-PM", + "cargo": [] + }, + { + "symbol": "653298-2", + "crew": null, + "officers": null, + "frame": "FRAME_DRONE", + "reactor": "REACTOR_SOLAR_I", + "engine": "ENGINE_SOLAR_PROPULSION", + "modules": [ + "MODULE_CARGO_HOLD" + ], + "mounts": [ + "MOUNT_MINING_LASER_I" + ], + "registration": { + "factionSymbol": "COMMERCE_REPUBLIC", + "agentSymbol": "653298", + "fee": 100, + "role": "EXCAVATOR" + }, + "integrity": { + "frame": 1, + "reactor": 1, + "engine": 1 + }, + "status": "DOCKED", + "location": "X1-OE-PM", + "cargo": [] + }, + { + "symbol": "653298-3", + "crew": null, + "officers": null, + "frame": "FRAME_DRONE", + "reactor": "REACTOR_SOLAR_I", + "engine": "ENGINE_SOLAR_PROPULSION", + "modules": [ + "MODULE_CARGO_HOLD" + ], + "mounts": [ + "MOUNT_MINING_LASER_I" + ], + "registration": { + "factionSymbol": "COMMERCE_REPUBLIC", + "agentSymbol": "653298", + "fee": 100, + "role": "EXCAVATOR" + }, + "integrity": { + "frame": 1, + "reactor": 1, + "engine": 1 + }, + "status": "DOCKED", + "location": "X1-OE-PM", + "cargo": [] + }, + { + "symbol": "653298-4", + "crew": null, + "officers": null, + "frame": "FRAME_DRONE", + "reactor": "REACTOR_SOLAR_I", + "engine": "ENGINE_SOLAR_PROPULSION", + "modules": [ + "MODULE_CARGO_HOLD" + ], + "mounts": [ + "MOUNT_MINING_LASER_I" + ], + "registration": { + "factionSymbol": "COMMERCE_REPUBLIC", + "agentSymbol": "653298", + "fee": 100, + "role": "EXCAVATOR" + }, + "integrity": { + "frame": 1, + "reactor": 1, + "engine": 1 + }, + "status": "DOCKED", + "location": "X1-OE-PM", + "cargo": [] + }, + { + "symbol": "653298-5", + "crew": null, + "officers": null, + "frame": "FRAME_DRONE", + "reactor": "REACTOR_SOLAR_I", + "engine": "ENGINE_SOLAR_PROPULSION", + "modules": [ + "MODULE_CARGO_HOLD" + ], + "mounts": [ + "MOUNT_MINING_LASER_I" + ], + "registration": { + "factionSymbol": "COMMERCE_REPUBLIC", + "agentSymbol": "653298", + "fee": 100, + "role": "EXCAVATOR" + }, + "integrity": { + "frame": 1, + "reactor": 1, + "engine": 1 + }, + "status": "DOCKED", + "location": "X1-OE-PM", + "cargo": [] + }, + { + "symbol": "653298-6", + "crew": null, + "officers": null, + "frame": "FRAME_DRONE", + "reactor": "REACTOR_SOLAR_I", + "engine": "ENGINE_SOLAR_PROPULSION", + "modules": [ + "MODULE_CARGO_HOLD" + ], + "mounts": [ + "MOUNT_MINING_LASER_I" + ], + "registration": { + "factionSymbol": "COMMERCE_REPUBLIC", + "agentSymbol": "653298", + "fee": 100, + "role": "EXCAVATOR" + }, + "integrity": { + "frame": 1, + "reactor": 1, + "engine": 1 + }, + "status": "DOCKED", + "location": "X1-OE-PM", + "cargo": [] + } + ], + "meta": { + "total": 6, + "page": 1, + "limit": 20 + } + } + }, + "properties": { + "data": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "$ref": "../models/Ship.json" + } + }, + "meta": { + "$ref": "../models/Meta.yaml" + } + }, + "required": [ + "data", + "meta" + ] + } + } + } + } + }, + "operationId": "get-my-ships", + "description": "Retrieve all of your ships.", + "security": [ + { + "AgentToken": [] + } + ] + }, + "post": { + "summary": "Purchase Ship", + "tags": [ + "shipyards" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": { + "symbol": "4F4D44-1", + "crew": null, + "officers": null, + "fuel": 100, + "frame": "FRAME_DRONE", + "reactor": "REACTOR_SOLAR_I", + "engine": "ENGINE_SOLAR_PROPULSION", + "modules": [ + "MODULE_CARGO_HOLD" + ], + "mounts": [ + "MOUNT_MINING_LASER_I" + ], + "registration": { + "factionSymbol": "COMMERCE_REPUBLIC", + "agentSymbol": "4F4D44", + "fee": 100, + "role": "EXCAVATOR" + }, + "integrity": { + "frame": 1, + "reactor": 1, + "engine": 1 + }, + "status": "DOCKED", + "location": "X1-OE-PM", + "cargo": [] + } + } + }, + "properties": { + "data": { + "type": "object", + "properties": { + "ship": { + "$ref": "../models/Ship.json" + }, + "credits": { + "type": "integer" + } + } + } + }, + "required": [ + "data" + ] + } + } + } + } + }, + "operationId": "post-my-ships", + "security": [ + { + "AgentToken": [] + } + ], + "description": "Purchase a ship", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The id of the shipyard listing you want to purchase." + } + } + } + } + } + } + } + }, + "/my/contracts": { + "get": { + "summary": "List Contracts", + "tags": [ + "contracts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "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" + }, + { + "id": "cl0hok3920023kv0jflbjpltg", + "faction": "COMMERCE_REPUBLIC", + "type": "PROCUREMENT", + "terms": { + "deadline": "2022-03-11T05:16:59.123Z", + "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.122Z" + } + ], + "meta": { + "total": 2, + "page": 1, + "limit": 20 + } + } + }, + "properties": { + "data": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "$ref": "../models/Contract.yaml" + } + }, + "meta": { + "$ref": "../models/Meta.yaml" + } + }, + "required": [ + "data", + "meta" + ] + }, + "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" + } + ], + "meta": { + "total": 10, + "page": 1, + "limit": 10 + } + } + } + } + } + } + } + }, + "operationId": "get-my-contracts", + "security": [ + { + "AgentToken": [] + } + ], + "description": "List all of your contracts." + } + }, + "/my/contracts/{contractId}": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "contractId", + "in": "path", + "required": true, + "description": "The contract ID" + } + ], + "get": { + "summary": "Contract Details", + "tags": [ + "contracts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "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" + } + } + } + } + } + } + } + }, + "operationId": "get-my-contracts-contractId", + "security": [ + { + "AgentToken": [] + } + ], + "description": "Get the details of a contract by ID." + } + }, + "/my/contracts/{contractId}/accept": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "contractId", + "in": "path", + "required": true + } + ], + "post": { + "summary": "Accept Contract", + "tags": [ + "contracts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "../models/Contract.yaml" + } + } + } + } + } + } + }, + "operationId": "post-my-contracts-contractId-accept", + "security": [ + { + "AgentToken": [] + } + ], + "description": "Accept a contract." + } + }, + "/systems": { + "get": { + "summary": "List Systems", + "tags": [ + "systems" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "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, + "chartedBy": null + }, + { + "symbol": "X1-EV", + "sector": "X1", + "type": "ORANGE_STAR", + "x": 3, + "y": 4, + "waypoints": [ + "X1-EV-A004" + ], + "factions": [ + "COMMERCE_REPUBLIC" + ], + "charted": true, + "chartedBy": null + }, + { + "symbol": "X1-ZZ", + "sector": "X1", + "type": "BLUE_STAR", + "x": -2, + "y": 11, + "waypoints": [], + "factions": [], + "charted": false, + "chartedBy": null + } + ], + "meta": { + "total": 3, + "page": 1, + "limit": 20 + } + } + }, + "properties": { + "data": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "$ref": "../models/System.yaml" + } + }, + "meta": { + "$ref": "../models/Meta.yaml" + } + }, + "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, + "chartedBy": null + } + ], + "meta": { + "total": 0, + "page": 0, + "limit": 0 + } + } + } + } + } + } + } + }, + "operationId": "get-systems", + "description": "Return a list of all systems.", + "security": [ + { + "AgentToken": [] + } + ] + } + }, + "/systems/{systemSymbol}": { + "parameters": [ + { + "schema": { + "type": "string", + "default": "X1-OE" + }, + "name": "systemSymbol", + "in": "path", + "required": true, + "description": "The system symbol" + } + ], + "get": { + "summary": "View System", + "tags": [ + "systems" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": { + "symbol": "X1-ZZ", + "sector": "X1", + "type": "BLUE_STAR", + "x": -2, + "y": 9, + "waypoints": [], + "factions": [], + "charted": false, + "chartedBy": null + } + } + }, + "properties": { + "data": { + "$ref": "../models/System.yaml" + } + }, + "required": [ + "data" + ] + }, + "examples": { + "Success": { + "value": { + "data": { + "symbol": "X1-ZZ", + "sector": "X1", + "type": "BLUE_STAR", + "x": -2, + "y": 9, + "waypoints": [], + "factions": [], + "charted": false, + "chartedBy": null + } + } + } + } + } + } + } + }, + "operationId": "get-systems-systemSymbol", + "security": [ + { + "AgentToken": [] + } + ] + } + }, + "/systems/{systemSymbol}/shipyards": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "systemSymbol", + "in": "path", + "required": true, + "description": "the system symbol" + } + ], + "get": { + "summary": "List Shipyards", + "tags": [ + "shipyards" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": [ + { + "symbol": "X1-OE-PM", + "faction": "COMMERCE_REPUBLIC" + } + ], + "meta": { + "total": 1, + "page": 1, + "limit": 20 + } + } + }, + "properties": { + "data": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "$ref": "../models/Shipyard.yaml" + } + }, + "meta": { + "$ref": "../models/Meta.yaml" + } + }, + "required": [ + "data", + "meta" + ] + } + } + } + } + }, + "operationId": "get-systems-systemSymbol-shipyards", + "security": [ + { + "AgentToken": [] + } + ], + "description": "Returns a list of all shipyards in a system." + } + }, + "/systems/{systemSymbol}/shipyards/{waypointSymbol}": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "systemSymbol", + "in": "path", + "required": true, + "description": "The system symbol" + }, + { + "schema": { + "type": "string" + }, + "name": "waypointSymbol", + "in": "path", + "required": true, + "description": "The waypoint symbol" + } + ], + "get": { + "summary": "Shipyard Details", + "tags": [ + "shipyards" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "../models/Shipyard.yaml" + } + } + } + } + } + } + }, + "operationId": "get-systems-systemSymbol-shipyards-waypointSymbol", + "security": [ + { + "AgentToken": [] + } + ] + } + }, + "/systems/{systemSymbol}/shipyards/{waypointSymbol}/ships": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "systemSymbol", + "in": "path", + "required": true, + "description": "The system symbol" + }, + { + "schema": { + "type": "string" + }, + "name": "waypointSymbol", + "in": "path", + "required": true, + "description": "The waypoint symbol" + } + ], + "get": { + "summary": "Shipyard Listings", + "tags": [ + "shipyards" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": [ + { + "id": "cl0nahta90000aq0jonm1nprl", + "waypoint": "X1-OE-PM", + "price": 58191, + "role": "EXCAVATOR", + "frame": "FRAME_DRONE", + "reactor": "REACTOR_SOLAR_I", + "engine": "ENGINE_SOLAR_PROPULSION", + "modules": [ + "MODULE_CARGO_HOLD" + ], + "mounts": [ + "MOUNT_MINING_LASER_I" + ] + } + ], + "meta": { + "total": 1, + "page": 1, + "limit": 20 + } + } + }, + "properties": { + "data": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "$ref": "../models/ShipyardListing.yaml" + } + }, + "meta": { + "$ref": "../models/Meta.yaml" + } + }, + "required": [ + "data", + "meta" + ] + }, + "examples": {} + } + } + } + }, + "operationId": "get-systems-systemSymbol-shipyards-waypointSymbol-ships", + "security": [ + { + "AgentToken": [] + } + ] + } + }, + "/trade/{tradeSymbol}/imports": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "tradeSymbol", + "in": "path", + "required": true, + "description": "The trade symbol" + } + ], + "get": { + "summary": "Trade Imports", + "tags": [ + "markets" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "properties": { + "data": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "$ref": "../models/MarketTrade.yaml" + } + }, + "meta": { + "$ref": "../models/Meta.yaml" + } + }, + "required": [ + "data", + "meta" + ] + }, + "examples": {} + } + } + } + }, + "operationId": "get-trade-tradeSymbol-imports", + "security": [ + { + "AgentToken": [] + } + ] + } + }, + "/trade/{tradeSymbol}/exports": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "tradeSymbol", + "in": "path", + "required": true, + "description": "The trade symbol" + } + ], + "get": { + "summary": "Trade Exports", + "tags": [ + "markets" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "properties": { + "data": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "$ref": "../models/MarketTrade.yaml" + } + }, + "meta": { + "$ref": "../models/Meta.yaml" + } + }, + "required": [ + "data", + "meta" + ] + }, + "examples": {} + } + } + } + }, + "operationId": "get-trade-tradeSymbol-exports", + "security": [ + { + "AgentToken": [] + } + ] + } + }, + "/trade/{tradeSymbol}/exchange": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "tradeSymbol", + "in": "path", + "required": true, + "description": "The trade symbol" + } + ], + "get": { + "summary": "Trade Exchanges", + "tags": [ + "markets" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "properties": { + "data": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "$ref": "../models/MarketTrade.yaml" + } + }, + "meta": { + "$ref": "../models/Meta.yaml" + } + }, + "required": [ + "data", + "meta" + ] + }, + "examples": {} + } + } + } + }, + "operationId": "get-trade-tradeSymbol-exchange", + "security": [ + { + "AgentToken": [] + } + ] + } + }, + "/systems/{systemSymbol}/markets": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "systemSymbol", + "in": "path", + "required": true, + "description": "The system symbol" + } + ], + "get": { + "summary": "List Markets", + "tags": [ + "markets" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": { + "exports": [ + { + "waypointSymbol": "X1-OE-PM", + "tradeSymbol": "MICROPROCESSORS", + "price": 834, + "tariff": 0 + } + ], + "imports": [ + { + "waypointSymbol": "X1-OE-PM", + "tradeSymbol": "SILICON", + "price": 144, + "tariff": 0 + }, + { + "waypointSymbol": "X1-OE-PM", + "tradeSymbol": "QUARTZ", + "price": 286, + "tariff": 0 + } + ], + "exchange": [] + } + } + }, + "properties": { + "data": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "data" + ] + }, + "examples": { + "Success": { + "value": { + "data": [ + "X1-AK3-88760F" + ], + "meta": { + "total": 1, + "page": 1, + "limit": 20 + } + } + } + } + } + } + } + }, + "operationId": "get-systems-systemSymbol-markets", + "description": "Retrieve a list of all charted markets in the given system. Markets are only available if the waypoint is charted and contains a communications relay.\n\nTo install a communications relay at a market, look at the `my/ships/{shipSymbol}/deploy` endpoint.", + "security": [ + { + "AgentToken": [] + } + ] + } + }, + "/systems/{systemSymbol}/markets/{waypointSymbol}": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "systemSymbol", + "in": "path", + "required": true, + "description": "The system symbol" + }, + { + "schema": { + "type": "string" + }, + "name": "waypointSymbol", + "in": "path", + "required": true, + "description": "The waypoint symbol" + } + ], + "get": { + "summary": "View Market", + "tags": [ + "markets" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": { + "exports": [ + { + "waypointSymbol": "X1-OE-PM", + "tradeSymbol": "MICROPROCESSORS", + "price": 834, + "tariff": 0 + } + ], + "imports": [ + { + "waypointSymbol": "X1-OE-PM", + "tradeSymbol": "SILICON", + "price": 144, + "tariff": 0 + }, + { + "waypointSymbol": "X1-OE-PM", + "tradeSymbol": "QUARTZ", + "price": 286, + "tariff": 0 + } + ], + "exchange": [] + } + } + }, + "properties": { + "data": { + "type": "object", + "required": [ + "exports", + "imports", + "exchange" + ], + "properties": { + "exports": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "$ref": "../models/MarketTrade.yaml" + } + }, + "imports": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "$ref": "../models/MarketTrade.yaml" + } + }, + "exchange": { + "type": "array", + "items": { + "$ref": "../models/MarketTrade.yaml" + } + } + } + } + }, + "required": [ + "data" + ] + }, + "examples": { + "Success": { + "value": { + "data": { + "exports": [ + { + "waypointSymbol": "X1-OE-PM", + "tradeSymbol": "MICROPROCESSORS", + "price": 834, + "tariff": 0 + } + ], + "imports": [ + { + "waypointSymbol": "X1-OE-PM", + "tradeSymbol": "SILICON", + "price": 144, + "tariff": 0 + }, + { + "waypointSymbol": "X1-OE-PM", + "tradeSymbol": "QUARTZ", + "price": 286, + "tariff": 0 + } + ], + "exchange": [] + } + } + } + } + } + } + } + }, + "operationId": "get-systems-systemSymbol-markets-waypointSymbol", + "description": "Retrieve imports, exports and exchange data from a marketplace. Imports can be sold, exports can be purchased, and exchange trades can be purchased or sold.\n\nMarket data is only available if you have a ship at the location, or the location is charted and has a communications relay deployed.\n\nSee `/my/ships/{shipSymbol}/deploy` for deploying relays at a location.", + "security": [ + { + "AgentToken": [] + } + ] + } + }, + "/systems/{systemSymbol}/waypoints": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "systemSymbol", + "in": "path", + "required": true, + "description": "The system symbol" + } + ], + "get": { + "summary": "List Waypoints", + "tags": [ + "systems" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": [ + { + "system": "X1-OE", + "symbol": "X1-OE-PM", + "type": "PLANET", + "x": 10, + "y": 5, + "orbitals": [ + "X1-OE-PM01" + ], + "faction": "COMMERCE_REPUBLIC", + "features": [ + "MARKETPLACE", + "SHIPYARD" + ], + "traits": [ + "OVERCROWDED", + "HIGH_TECH", + "BUREAUCRATIC", + "TRADING_HUB", + "TEMPERATE" + ], + "charted": true, + "chartedBy": null + }, + { + "system": "X1-OE", + "symbol": "X1-OE-PM01", + "type": "MOON", + "x": 10, + "y": 5, + "orbitals": [], + "faction": "COMMERCE_REPUBLIC", + "features": [ + "MARKETPLACE" + ], + "traits": [ + "WEAK_GRAVITY" + ], + "charted": true, + "chartedBy": null + }, + { + "system": "X1-OE", + "symbol": "X1-OE-A005", + "type": "ASTEROID_FIELD", + "x": -1, + "y": -29, + "orbitals": [], + "faction": "MINERS_COLLECTIVE", + "features": [], + "traits": [ + "COMMON_METAL_DEPOSITS" + ], + "charted": true, + "chartedBy": null + }, + { + "system": "X1-OE", + "symbol": "X1-OE-25X", + "type": "JUMP_GATE", + "x": -38, + "y": 47, + "orbitals": [], + "faction": "SPACERS_GUILD", + "features": [], + "traits": [], + "charted": true, + "chartedBy": null + } + ], + "meta": { + "total": 4, + "page": 1, + "limit": 20 + } + } + }, + "properties": { + "data": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "$ref": "../models/Waypoint.yaml" + } + }, + "meta": { + "$ref": "../models/Meta.yaml" + } + }, + "required": [ + "data", + "meta" + ] + }, + "examples": { + "Success": { + "value": { + "data": [ + { + "system": "X1-OE", + "symbol": "X1-OE-PM", + "type": "PLANET", + "x": 10, + "y": 5, + "orbitals": [ + "X1-OE-PM01" + ], + "faction": "COMMERCE_REPUBLIC", + "features": [ + "MARKETPLACE", + "SHIPYARD" + ], + "traits": [ + "OVERCROWDED", + "HIGH_TECH", + "BUREAUCRATIC", + "TRADING_HUB", + "TEMPERATE" + ], + "charted": true, + "chartedBy": null + }, + { + "system": "X1-OE", + "symbol": "X1-OE-PM01", + "type": "MOON", + "x": 10, + "y": 5, + "orbitals": [], + "faction": "COMMERCE_REPUBLIC", + "features": [ + "MARKETPLACE" + ], + "traits": [ + "WEAK_GRAVITY" + ], + "charted": true, + "chartedBy": null + }, + { + "system": "X1-OE", + "symbol": "X1-OE-A005", + "type": "ASTEROID_FIELD", + "x": -1, + "y": -29, + "orbitals": [], + "faction": "MINERS_COLLECTIVE", + "features": [], + "traits": [ + "COMMON_METAL_DEPOSITS" + ], + "charted": true, + "chartedBy": null + }, + { + "system": "X1-OE", + "symbol": "X1-OE-25X", + "type": "JUMP_GATE", + "x": -38, + "y": 47, + "orbitals": [], + "faction": "SPACERS_GUILD", + "features": [], + "traits": [], + "charted": true, + "chartedBy": null + } + ], + "meta": { + "total": 4, + "page": 1, + "limit": 20 + } + } + } + } + } + } + } + }, + "operationId": "get-systems-systemSymbol-waypoints-waypointSymbol", + "security": [ + { + "AgentToken": [] + } + ], + "description": "Fetch all of the waypoints for a given system. System must be charted or a ship must be present to return waypoint details." + } + }, + "/systems/{systemSymbol}/waypoints/{waypointSymbol}": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "systemSymbol", + "in": "path", + "required": true, + "description": "The system symbol" + }, + { + "schema": { + "type": "string" + }, + "name": "waypointSymbol", + "in": "path", + "required": true, + "description": "The waypoint symbol" + } + ], + "get": { + "summary": "View Waypoint", + "tags": [ + "systems" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": [ + { + "system": "X1-OE", + "symbol": "X1-OE-PM", + "type": "PLANET", + "x": 10, + "y": 5, + "orbitals": [ + "X1-OE-PM01" + ], + "faction": "COMMERCE_REPUBLIC", + "features": [ + "MARKETPLACE", + "SHIPYARD" + ], + "traits": [ + "OVERCROWDED", + "HIGH_TECH", + "BUREAUCRATIC", + "TRADING_HUB", + "TEMPERATE" + ], + "charted": true, + "chartedBy": null + }, + { + "system": "X1-OE", + "symbol": "X1-OE-PM01", + "type": "MOON", + "x": 10, + "y": 5, + "orbitals": [], + "faction": "COMMERCE_REPUBLIC", + "features": [ + "MARKETPLACE" + ], + "traits": [ + "WEAK_GRAVITY" + ], + "charted": true, + "chartedBy": null + }, + { + "system": "X1-OE", + "symbol": "X1-OE-A005", + "type": "ASTEROID_FIELD", + "x": -1, + "y": -29, + "orbitals": [], + "faction": "MINERS_COLLECTIVE", + "features": [], + "traits": [ + "COMMON_METAL_DEPOSITS" + ], + "charted": true, + "chartedBy": null + }, + { + "system": "X1-OE", + "symbol": "X1-OE-25X", + "type": "JUMP_GATE", + "x": -38, + "y": 47, + "orbitals": [], + "faction": "SPACERS_GUILD", + "features": [], + "traits": [], + "charted": true, + "chartedBy": null + } + ], + "meta": { + "total": 4, + "page": 1, + "limit": 20 + } + } + }, + "properties": { + "data": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "$ref": "../models/Waypoint.yaml" + } + }, + "meta": { + "$ref": "../models/Meta.yaml" + } + }, + "required": [ + "data", + "meta" + ] + }, + "examples": { + "Success": { + "value": { + "data": [ + { + "system": "X1-OE", + "symbol": "X1-OE-PM", + "type": "PLANET", + "x": 10, + "y": 5, + "orbitals": [ + "X1-OE-PM01" + ], + "faction": "COMMERCE_REPUBLIC", + "features": [ + "MARKETPLACE", + "SHIPYARD" + ], + "traits": [ + "OVERCROWDED", + "HIGH_TECH", + "BUREAUCRATIC", + "TRADING_HUB", + "TEMPERATE" + ], + "charted": true, + "chartedBy": null + }, + { + "system": "X1-OE", + "symbol": "X1-OE-PM01", + "type": "MOON", + "x": 10, + "y": 5, + "orbitals": [], + "faction": "COMMERCE_REPUBLIC", + "features": [ + "MARKETPLACE" + ], + "traits": [ + "WEAK_GRAVITY" + ], + "charted": true, + "chartedBy": null + }, + { + "system": "X1-OE", + "symbol": "X1-OE-A005", + "type": "ASTEROID_FIELD", + "x": -1, + "y": -29, + "orbitals": [], + "faction": "MINERS_COLLECTIVE", + "features": [], + "traits": [ + "COMMON_METAL_DEPOSITS" + ], + "charted": true, + "chartedBy": null + }, + { + "system": "X1-OE", + "symbol": "X1-OE-25X", + "type": "JUMP_GATE", + "x": -38, + "y": 47, + "orbitals": [], + "faction": "SPACERS_GUILD", + "features": [], + "traits": [], + "charted": true, + "chartedBy": null + } + ], + "meta": { + "total": 4, + "page": 1, + "limit": 20 + } + } + } + } + } + } + } + }, + "operationId": "get-systems-systemSymbol-waypoints", + "security": [ + { + "AgentToken": [] + } + ], + "description": "View the details of a waypoint." + } + } + }, + "tags": [ + { + "name": "ships" + }, + { + "name": "markets" + }, + { + "name": "trade" + }, + { + "name": "sell" + }, + { + "name": "purchase" + }, + { + "name": "navigation" + }, + { + "name": "agents" + }, + { + "name": "dock" + }, + { + "name": "orbit" + }, + { + "name": "jettison" + }, + { + "name": "jump" + }, + { + "name": "refuel" + }, + { + "name": "scan" + }, + { + "name": "contracts" + }, + { + "name": "chart" + }, + { + "name": "extract" + }, + { + "name": "mining" + }, + { + "name": "deliver" + }, + { + "name": "survey" + }, + { + "name": "systems" + }, + { + "name": "waypoints" + }, + { + "name": "shipyards" + }, + { + "name": "markets" + } + ], + "components": { + "schemas": {}, + "securitySchemes": { + "AgentToken": { + "type": "http", + "scheme": "bearer", + "description": "When you register a new agent you will be granted a private bearer token which grants authorization to use the API." + } + }, + "requestBodies": {} + }, + "security": [ + { + "AgentToken": [] + } + ] +} \ No newline at end of file diff --git a/reference/SpaceTraders.yaml b/reference/SpaceTraders.yaml deleted file mode 100644 index b6bd22d..0000000 --- a/reference/SpaceTraders.yaml +++ /dev/null @@ -1,2986 +0,0 @@ -openapi: 3.1.0 -info: - title: SpaceTraders API - version: 2.0.0-alpha - summary: SpaceTraders is a unique multiplayer game built on a free Web API. - contact: - name: Joel Brubaker - email: joel@spacetraders.io - license: - name: 'No' - url: 'https://choosealicense.com/no-permission/' - description: |- - SpaceTraders is a multiplayer sci-fi strategy game where you acquire and manage a fleet of ships across a growing and dynamic universe. - - Similar to games such as Eve Online, you work with or against other players to establish trade routes, chart new systems, mine precious ores, patrol for pirates, spy on factions, and discover hidden treasures. - - But what makes SpaceTraders unique is that the game is entirely accessible through open and well-documented API endpoints. In fact, SpaceTraders doesn't have a first-class client to play the game - if you want to take it for a spin, you should try one of our community-created web clients, or use the API documentation to see how you might play a game through an API. - - If this sounds fun and interesting to you, please drop into our Discord and get to know the community. We are actively working on new clients, new ideas and sharing tips for how to play the game. - - - ```json http - { - "method": "GET", - "url": "https://v2-0-0.alpha.spacetraders.io", - } - ``` -servers: - - url: 'https://v2-0-0.alpha.spacetraders.io' - description: v2.0.0-alpha -paths: - /agents: - post: - summary: Register New Agent - tags: - - agents - responses: - '201': - description: OK - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - token: - type: string - agent: - $ref: ../models/Agent.yaml - faction: - $ref: ../models/Faction.yaml - contract: - $ref: ../models/Contract.yaml - ship: - $ref: ../models/Ship.yaml - examples: - Success: - value: - data: - token: string - agent: - accountId: cl0hok34m0003ks0jjql5q8f2 - symbol: EMBER - headquarters: X1-OE-PM - credits: 0 - faction: - symbol: COMMERCE_REPUBLIC - name: Commerce Repubic - description: The Commerce Republic takes capital from top tier worlds and invests it into new systems with high potential for growth. - headquarters: X1-OE-PM - traits: - - BUREAUCRATIC - - CAPITALISTIC - - GUILD - - ESTABLISHED - contract: - 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' - ship: - symbol: string - frame: string - reactor: string - engine: string - fuel: 0 - modules: - - string - mounts: - - string - registration: - factionSymbol: string - agentSymbol: string - fee: 0 - role: string - integrity: - frame: 0 - reactor: 0 - engine: 0 - status: string - location: string - cargo: - - tradeSymbol: string - units: 0 - operationId: post-agents - description: |- - Creates a new agent and ties it to a temporary Account. Use `COMMERCE_REPUBLIC` as your starting faction if you don't know any other factions to choose from. - - The agent symbol is a 4-8 character string that will represent your agent. This symbol will prefix the symbol of every ship you own. Agent symbols will be cast to all uppercase characters. - - A new agent will be granted an authorization token, a contract with their starting faction, a command ship with a jump drive, and one hundred thousand credits. - - > #### Keep your token safe and secure - > - > Save your token during the alpha phase. There is no way to regenerate this token without starting a new agent. In the future you will be able to generate and manage your tokens from the SpaceTraders website. - - You can accept your contract using the `/my/contracts/{contractId}/accept` endpoint. You will want to navigate your command ship to a nearby asteroid field waypoint, and execute the `/my/ships/{shipSymbol}/accept` endpoint to mine various types of ores and minerals. - - Return to the contract destination and execute the `/my/ships/{shipSymbol}/deliver` endpoint to deposit goods into the contract. - - When your contract is fulfilled, you can call `/my/contracts/{contractId}/fulfill` to retrieve payment. - requestBody: - content: - application/json: - schema: - type: object - properties: - symbol: - type: string - description: How other agents will see your ships and information. - minLength: 4 - maxLength: 8 - example: BADGER - faction: - type: string - default: COMMERCE_REPUBLIC - description: The faction you choose determines your headquarters. - description: '' - /my/agent: - get: - summary: My Agent Details - tags: - - agents - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - data: - $ref: ../models/Agent.yaml - examples: - Agent: - value: - data: - accountId: cl0hok34m0003ks0jjql5q8f2 - symbol: EMBER - headquarters: X1-OE-PM - credits: 0 - operationId: get-my-agent - security: - - AgentToken: [] - description: Fetch your agent's details. - '/my/ships/{shipSymbol}/chart': - post: - summary: Chart Waypoint - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - submitted: - type: array - items: - type: string - examples: - Success: - value: - data: - submitted: - - X1-ZZ - - X1-ZZ-7-EE - operationId: 'post-my-ships-:shipSymbol-chart' - description: |- - Command a ship to chart the current system and/or waypoint. - - Systems and waypoints in the universe are uncharted by default. These locations will not show up in the API until they have been charted by a ship. - - Charting a location will record your agent as the one who created the chart. - - Returns an array of system / waypoint symbols that have been charted. - security: - - AgentToken: [] - tags: - - systems - parameters: - - schema: - type: string - name: shipSymbol - in: path - required: true - description: The symbol of the ship - '/my/ships/{shipSymbol}/deliver': - parameters: - - schema: - type: string - name: shipSymbol - in: path - required: true - description: The symbol of the ship - post: - summary: Deliver on Contract - tags: - - contracts - responses: - '200': - description: OK - content: - application/json: - 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 - required: - - data - operationId: post-my-ships-shipSymbol-deliver - security: - - AgentToken: [] - requestBody: - content: - application/json: - schema: - type: object - properties: - contractId: - type: string - tradeSymbol: - type: string - units: - type: integer - required: - - contractId - - tradeSymbol - description: Deliver cargo on a given contract. - '/my/ships/{shipSymbol}/dock': - parameters: - - schema: - type: string - name: shipSymbol - in: path - required: true - description: The symbol of the ship - post: - summary: Dock Ship - tags: - - navigation - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - properties: - data: - type: object - properties: - status: - type: string - required: - - status - required: - - data - x-examples: - example-1: - data: - status: DOCKED - examples: - Success: - value: - data: - status: DOCKED - operationId: post-my-ships-shipSymbol-dock - security: - - AgentToken: [] - description: Transition your ship from orbit to docked. Consecutive calls to this endpoint will succeed. - '/my/ships/{shipSymbol}/orbit': - parameters: - - schema: - type: string - name: shipSymbol - in: path - required: true - description: The symbol of the ship - post: - summary: Orbit Ship - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - data: - status: ORBIT - properties: - data: - type: object - properties: - status: - type: string - required: - - data - examples: - Success: - value: - data: - status: ORBIT - operationId: post-my-ships-shipSymbol-orbit - security: - - AgentToken: [] - description: Transition your ship from docked into orbit. Ships are placed into orbit by default when arriving at a destination. Consecutive calls to this endpoint will continue to return a 200 response status. - tags: - - navigation - '/my/ships/{shipSymbol}/jettison': - parameters: - - schema: - type: string - name: shipSymbol - in: path - required: true - post: - summary: Jettison Cargo - tags: - - ships - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - properties: - data: - type: object - properties: - tradeSymbol: - type: string - minLength: 1 - units: - type: integer - required: - - tradeSymbol - - units - required: - - data - x-examples: - example-1: - data: - tradeSymbol: ALUMINUM - units: 95 - examples: - Success: - value: - data: - tradeSymbol: ALUMINUM - units: 95 - operationId: post-my-ships-shipSymbol-jettison - description: Jettison cargo from your ship's cargo hold. - security: - - AgentToken: [] - requestBody: - content: - application/json: - schema: - type: object - properties: - tradeSymbol: - type: string - units: - type: integer - minimum: 1 - '/my/ships/{shipSymbol}/extract': - parameters: - - schema: - type: string - name: shipSymbol - in: path - required: true - description: The ship symbol - post: - summary: Extract Resources - responses: - '201': - description: Created - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - data: - extraction: - shipSymbol: 4B902A-1 - yield: - tradeSymbol: SILICON - units: 16 - cooldown: - duration: 119 - expiration: '2022-03-12T00:41:29.371Z' - properties: - data: - type: object - required: - - extraction - - cooldown - properties: - extraction: - $ref: ../models/Extraction.yaml - cooldown: - $ref: ../models/Cooldown.yaml - required: - - data - examples: - Success: - value: - data: - extraction: - shipSymbol: 4B902A-1 - yield: - tradeSymbol: SILICON - units: 16 - cooldown: - duration: 119 - expiration: '2022-03-12T00:41:29.371Z' - operationId: post-my-ships-shipSymbol-extract - requestBody: - content: - application/json: - schema: - type: - - object - - 'null' - 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' - description: '' - description: Extract resources from the waypoint into your ship. Send a survey as the payload to target specific yields. The entire survey must be sent as it contains a signature that the backend verifies. - security: - - AgentToken: [] - tags: - - extract - get: - summary: Extraction Cooldown - operationId: get-my-ships-shipSymbol-extract - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - data: - cooldown: - duration: 119 - expiration: '2022-03-12T00:41:29.285Z' - properties: - data: - type: object - required: - - cooldown - properties: - cooldown: - $ref: ../models/Cooldown.yaml - required: - - data - examples: - Success: - value: - data: - cooldown: - duration: 119 - expiration: '2022-03-12T00:41:29.285Z' - description: Get the status of your last extraction. - security: - - AgentToken: [] - tags: - - extract - '/my/ships/{shipSymbol}/survey': - parameters: - - schema: - type: string - name: shipSymbol - in: path - required: true - post: - summary: Survey Waypoint - responses: - '201': - description: Created - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - data: - - signature: X1-OE-D2DD38 - deposits: - - COPPER_ORE - expiration: '2022-03-08T05:41:55.514Z' - - signature: X1-OE-B58FEB - deposits: - - ALUMINUM_ORE - - ALUMINUM_ORE - - ALUMINUM_ORE - expiration: '2022-03-08T05:39:15.519Z' - - signature: X1-OE-0E326C - deposits: - - ALUMINUM_ORE - - SILICON - expiration: '2022-03-08T05:20:27.521Z' - - signature: X1-OE-5CDFA4 - deposits: - - COPPER_ORE - - COPPER_ORE - - COPPER_ORE - - IRON_ORE - expiration: '2022-03-08T05:44:34.522Z' - - signature: X1-OE-86C3A1 - deposits: - - COPPER_ORE - - COPPER_ORE - - IRON_ORE - expiration: '2022-03-08T05:43:45.522Z' - - signature: X1-OE-C97BEA - deposits: - - ALUMINUM_ORE - - COPPER_ORE - - QUARTZ - - QUARTZ - expiration: '2022-03-08T05:22:39.523Z' - - signature: X1-OE-9913BD - deposits: - - QUARTZ - expiration: '2022-03-08T05:37:45.523Z' - - signature: X1-OE-8D87D2 - deposits: - - COPPER_ORE - - SILICON - expiration: '2022-03-08T05:32:57.524Z' - properties: - data: - type: object - properties: - surveys: - type: array - items: - $ref: ../models/Survey.yaml - cooldown: - $ref: ../models/Cooldown.yaml - 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' - operationId: post-my-ships-shipSymbol-survey - security: - - AgentToken: [] - description: |- - If you want to target specific yields for an extraction, you can survey a waypoint, such as an asteroid field, and send the survey in the body of the extract request. Each survey may have multiple deposits, and if a symbol shows up more than once, that indicates a higher chance of extracting that resource. - - Your ship will enter a cooldown between consecutive survey requests. Surveys will eventually expire after a period of time. Multiple ships can use the same survey for extraction. - tags: - - extract - get: - summary: Survey Cooldown - tags: - - extract - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - cooldown: - $ref: ../models/Cooldown.yaml - examples: - Success: - value: - data: - cooldown: - duration: 899 - expiration: '2022-03-12T02:11:35.618Z' - operationId: get-my-ships-shipSymbol-survey - description: 'Executing a survey will initiate a cooldown for a number of seconds before you can call it again. This endpoint returns the details of your cooldown, or a 404 if there is no cooldown for the survey action.' - '/my/ships/{shipSymbol}/jump': - parameters: - - schema: - type: string - name: shipSymbol - in: path - required: true - post: - summary: Jump Ship - tags: - - navigation - responses: - '201': - description: Created - content: - application/json: - 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 - cooldown: - $ref: ../models/Cooldown.yaml - required: - - data - examples: - Success: - value: - data: - jump: - shipSymbol: 1D7FDA-1 - destination: 00E0B1 - cooldown: - duration: 719 - expiration: '2022-03-12T00:52:56.735Z' - operationId: post-my-ships-shipSymbol-jump - security: - - AgentToken: [] - requestBody: - content: - application/json: - schema: - type: object - properties: - destination: - type: string - description: The system symbol to jump to. - get: - summary: Jump Cooldown - operationId: get-my-ships-shipSymbol-jump - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - data: - cooldown: - duration: 719 - expiration: '2022-03-12T00:52:56.735Z' - properties: - data: - type: object - required: - - cooldown - properties: - cooldown: - $ref: ../models/Cooldown.yaml - required: - - data - security: - - AgentToken: [] - tags: - - navigation - '/my/ships/{shipSymbol}/purchase': - parameters: - - schema: - type: string - name: shipSymbol - in: path - required: true - post: - summary: Purchase Cargo - tags: - - trade - responses: - '201': - description: Created - content: - application/json: - 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 - required: - - data - examples: - Success: - value: - data: - waypointSymbol: X1-OE-PM - tradeSymbol: MICROPROCESSORS - credits: -843 - units: 1 - operationId: post-my-ships-shipSymbol-purchase - security: - - AgentToken: [] - requestBody: - content: - application/json: - schema: - type: object - properties: - tradeSymbol: - type: string - units: - type: integer - '/my/ships/{shipSymbol}/sell': - parameters: - - schema: - type: string - name: shipSymbol - in: path - required: true - post: - summary: Sell Cargo - tags: - - trade - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - data: - waypointSymbol: X1-OE-PM - tradeSymbol: SILICON - credits: 144 - units: -1 - properties: - data: - $ref: ../models/Trade.yaml - required: - - data - examples: - Success: - value: - data: - waypointSymbol: X1-OE-PM - tradeSymbol: SILICON - credits: 144 - units: -1 - operationId: post-my-ships-shipSymbol-sell - description: Sell cargo from your ship's hold to the local market. - security: - - AgentToken: [] - requestBody: - content: - application/json: - schema: - type: object - properties: - tradeSymbol: - type: string - units: - type: integer - description: '' - '/my/ships/{shipSymbol}/refuel': - parameters: - - schema: - type: string - name: shipSymbol - in: path - required: true - post: - summary: Refuel Ship - tags: - - navigation - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - properties: - data: - type: object - properties: - credits: - type: integer - fuel: - type: integer - required: - - credits - - fuel - required: - - data - x-examples: - example-1: - data: - credits: 0 - fuel: 0 - examples: - Success: - value: - data: - credits: -1920 - fuel: 800 - operationId: post-my-ships-shipSymbol-refuel - security: - - AgentToken: [] - '/my/ships/{shipSymbol}/deploy': - parameters: - - schema: - type: string - name: shipSymbol - in: path - required: true - description: The ship symbol - post: - summary: Deploy Asset - tags: - - markets - responses: - '204': - description: OK - operationId: post-my-ships-shipSymbol-deploy - security: - - AgentToken: [] - description: |- - Use this endpoint to deploy a Communications Relay to a waypoint. A waypoint with a communications relay will allow agents to retrieve price information from the market. Without a relay, agents must send a ship to a market to retrieve price information. - - Communication relays can be purchased from a market that exports `COMM_RELAY_I`. - requestBody: - content: - application/json: - schema: - type: object - properties: - tradeSymbol: - type: string - required: - - tradeSymbol - '/my/ships/{shipSymbol}/scan': - parameters: - - schema: - type: string - name: shipSymbol - in: path - required: true - post: - summary: Scan - tags: - - ships - responses: - '201': - description: Created - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - data: - ships: - - symbol: COMMERCE_REPUBLIC-0060A0 - registration: - factionSymbol: COMMERCE_REPUBLIC - role: EXCAVATOR - frameSymbol: FRAME_HEAVY_FREIGHTER - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_I - expiration: '2022-03-08T05:20:14.725Z' - - symbol: ZANZIBAR_TRIKES-DF0AAF - registration: - factionSymbol: ZANZIBAR_TRIKES - role: HAULER - frameSymbol: FRAME_SHUTTLE - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_II - expiration: '2022-03-08T05:20:00.725Z' - - symbol: ZANZIBAR_TRIKES-9B80BE - registration: - factionSymbol: ZANZIBAR_TRIKES - role: TRANSPORT - frameSymbol: FRAME_TRANSPORT - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_I - expiration: '2022-03-08T05:20:06.725Z' - - symbol: COMMERCE_REPUBLIC-117520 - registration: - factionSymbol: COMMERCE_REPUBLIC - role: HARVESTER - frameSymbol: FRAME_SHUTTLE - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_II - expiration: '2022-03-08T05:19:55.725Z' - - symbol: SPACERS_GUILD-609AA5 - registration: - factionSymbol: SPACERS_GUILD - role: HAULER - frameSymbol: FRAME_FRIGATE - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_I - expiration: '2022-03-08T05:19:38.725Z' - - symbol: MINERS_COLLECTIVE-7AD322 - registration: - factionSymbol: MINERS_COLLECTIVE - role: EXCAVATOR - frameSymbol: FRAME_SHUTTLE - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_I - expiration: '2022-03-08T05:19:11.725Z' - - symbol: ZANZIBAR_TRIKES-AE6D78 - registration: - factionSymbol: ZANZIBAR_TRIKES - role: HAULER - frameSymbol: FRAME_SHUTTLE - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_II - expiration: '2022-03-08T05:20:44.725Z' - - symbol: SPACERS_GUILD-92828B - registration: - factionSymbol: SPACERS_GUILD - role: SURVEYOR - frameSymbol: FRAME_LIGHT_FREIGHTER - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_II - expiration: '2022-03-08T05:20:49.726Z' - - symbol: ZANZIBAR_TRIKES-B5EAD1 - registration: - factionSymbol: ZANZIBAR_TRIKES - role: TRANSPORT - frameSymbol: FRAME_TRANSPORT - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_I - expiration: '2022-03-08T05:20:25.726Z' - - symbol: ZANZIBAR_TRIKES-6A4E0D - registration: - factionSymbol: ZANZIBAR_TRIKES - role: HAULER - frameSymbol: FRAME_EXPLORER - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_II - expiration: '2022-03-08T05:19:19.726Z' - cooldown: 60 - properties: - data: - oneOf: - - properties: - ships: - type: array - uniqueItems: true - minItems: 1 - items: - $ref: ../models/ScannedShip.yaml - cooldown: - $ref: ../models/Cooldown.yaml - required: - - ships - - cooldown - - properties: - cooldown: - $ref: ../models/Cooldown.yaml - system: - $ref: ../models/System.yaml - - properties: - cooldown: - $ref: ../models/Cooldown.yaml - waypoint: - $ref: ../models/Waypoint.yaml - type: object - required: - - data - examples: - Approaching Ships: - value: - data: - cooldown: - duration: 59 - expiration: '2022-03-12T00:42:44.220Z' - ships: - - 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' - - symbol: MINERS_COLLECTIVE-C6ACCA - registration: - factionSymbol: MINERS_COLLECTIVE - role: HARVESTER - frameSymbol: FRAME_INTERCEPTOR - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_I - expiration: '2022-03-12T00:44:38.222Z' - - symbol: COMMERCE_REPUBLIC-866DC7 - registration: - factionSymbol: COMMERCE_REPUBLIC - role: SURVEYOR - frameSymbol: FRAME_LIGHT_FREIGHTER - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_I - expiration: '2022-03-12T00:45:21.222Z' - - symbol: SPACERS_GUILD-2B1D01 - registration: - factionSymbol: SPACERS_GUILD - role: SURVEYOR - frameSymbol: FRAME_HEAVY_FREIGHTER - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_I - expiration: '2022-03-12T00:44:53.222Z' - - symbol: MINERS_COLLECTIVE-2F238C - registration: - factionSymbol: MINERS_COLLECTIVE - role: HAULER - frameSymbol: FRAME_SHUTTLE - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_II - expiration: '2022-03-12T00:44:07.222Z' - - symbol: ZANZIBAR_TRIKES-ACF237 - registration: - factionSymbol: ZANZIBAR_TRIKES - role: HAULER - frameSymbol: FRAME_INTERCEPTOR - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_II - expiration: '2022-03-12T00:44:22.223Z' - - symbol: SPACERS_GUILD-94A474 - registration: - factionSymbol: SPACERS_GUILD - role: EXCAVATOR - frameSymbol: FRAME_SHUTTLE - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_I - expiration: '2022-03-12T00:43:51.223Z' - - symbol: ZANZIBAR_TRIKES-648BA8 - registration: - factionSymbol: ZANZIBAR_TRIKES - role: PATROL - frameSymbol: FRAME_SHUTTLE - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_I - expiration: '2022-03-12T00:44:56.223Z' - - symbol: COMMERCE_REPUBLIC-1EED24 - registration: - factionSymbol: COMMERCE_REPUBLIC - role: PATROL - frameSymbol: FRAME_EXPLORER - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_II - expiration: '2022-03-12T00:45:23.223Z' - - symbol: ZANZIBAR_TRIKES-A5600D - registration: - factionSymbol: ZANZIBAR_TRIKES - role: PATROL - frameSymbol: FRAME_FRIGATE - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_II - expiration: '2022-03-12T00:44:00.223Z' - Departing Ships: - value: - data: - cooldown: - duration: 59 - expiration: '2022-03-12T00:42:44.220Z' - ships: - - 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' - - symbol: MINERS_COLLECTIVE-C6ACCA - registration: - factionSymbol: MINERS_COLLECTIVE - role: HARVESTER - frameSymbol: FRAME_INTERCEPTOR - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_I - expiration: '2022-03-12T00:44:38.222Z' - - symbol: COMMERCE_REPUBLIC-866DC7 - registration: - factionSymbol: COMMERCE_REPUBLIC - role: SURVEYOR - frameSymbol: FRAME_LIGHT_FREIGHTER - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_I - expiration: '2022-03-12T00:45:21.222Z' - - symbol: SPACERS_GUILD-2B1D01 - registration: - factionSymbol: SPACERS_GUILD - role: SURVEYOR - frameSymbol: FRAME_HEAVY_FREIGHTER - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_I - expiration: '2022-03-12T00:44:53.222Z' - - symbol: MINERS_COLLECTIVE-2F238C - registration: - factionSymbol: MINERS_COLLECTIVE - role: HAULER - frameSymbol: FRAME_SHUTTLE - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_II - expiration: '2022-03-12T00:44:07.222Z' - - symbol: ZANZIBAR_TRIKES-ACF237 - registration: - factionSymbol: ZANZIBAR_TRIKES - role: HAULER - frameSymbol: FRAME_INTERCEPTOR - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_II - expiration: '2022-03-12T00:44:22.223Z' - - symbol: SPACERS_GUILD-94A474 - registration: - factionSymbol: SPACERS_GUILD - role: EXCAVATOR - frameSymbol: FRAME_SHUTTLE - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_I - expiration: '2022-03-12T00:43:51.223Z' - - symbol: ZANZIBAR_TRIKES-648BA8 - registration: - factionSymbol: ZANZIBAR_TRIKES - role: PATROL - frameSymbol: FRAME_SHUTTLE - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_I - expiration: '2022-03-12T00:44:56.223Z' - - symbol: COMMERCE_REPUBLIC-1EED24 - registration: - factionSymbol: COMMERCE_REPUBLIC - role: PATROL - frameSymbol: FRAME_EXPLORER - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_II - expiration: '2022-03-12T00:45:23.223Z' - - symbol: ZANZIBAR_TRIKES-A5600D - registration: - factionSymbol: ZANZIBAR_TRIKES - role: PATROL - frameSymbol: FRAME_FRIGATE - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_II - expiration: '2022-03-12T00:44:00.223Z' - System Scan: - value: - data: - cooldown: - duration: 0 - expiration: '2022-03-12T00:42:44.220Z' - system: - symbol: X1-OE - sector: X1 - type: RED_STAR - x: 0 - 'y': 0 - waypoints: - - X1-OE-PM - - X1-OE-PM01 - - X1-OE-25X - - X1-OE-A005 - factions: - - COMMERCE_REPUBLIC - - SPACERS_GUILD - - MINERS_COLLECTIVE - charted: true - chartedBy: null - Waypoint Scan: - value: - data: - cooldown: - duration: 0 - expiration: '2022-03-12T00:42:44.220Z' - waypoint: - system: X1-OE - symbol: X1-OE-25X - type: JUMP_GATE - x: -1 - 'y': -59 - orbitals: [] - faction: SPACERS_GUILD - features: [] - traits: [] - charted: true - chartedBy: null - operationId: post-my-ships-shipSymbol-scan - security: - - AgentToken: [] - description: 'Execute a ship scan to view approach / departing ships, system information or details about a waypoint. Send a scan mode to select the type of scan performed by your ship.' - requestBody: - content: - application/json: - schema: - type: object - properties: - mode: - type: string - enum: - - APPROACHING_SHIPS - - DEPARTING_SHIPS - - SYSTEM - - WAYPOINT - required: - - mode - examples: - Approaching Ships: - value: - mode: APPROACHING_SHIPS - Departing Ships: - value: - mode: APPROACHING_SHIPS - description: '' - get: - summary: Scan Cooldown - operationId: get-my-ships-shipSymbol-scan - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - cooldown: - $ref: ../models/Cooldown.yaml - examples: - Success: - value: - data: - cooldown: - duration: 59 - expiration: '2022-03-12T00:42:44.220Z' - security: - - AgentToken: [] - tags: - - ships - '/my/ships/{shipSymbol}/navigate': - parameters: - - schema: - type: string - name: shipSymbol - in: path - required: true - description: The ship symbol - post: - summary: Navigate Ship - tags: - - navigation - responses: - '201': - description: Created - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - data: - shipSymbol: 3AE434-1 - departure: X1-OE-PM - destination: X1-OE-A005 - durationRemaining: 2159 - arrivedAt: null - properties: - data: - type: object - properties: - navigation: - $ref: ../models/ShipNavigation.yaml - fuelCost: - type: integer - required: - - data - examples: - Success: - value: - data: - fuelCost: 38 - navigation: - shipSymbol: BA03F2-1 - departure: X1-OE-PM - destination: X1-OE-A005 - durationRemaining: 2279 - arrivedAt: null - operationId: post-my-ships-shipSymbol-navigate - requestBody: - content: - application/json: - schema: - type: object - properties: - destination: - type: string - description: The waypoint symbol to navigate to. - security: - - AgentToken: [] - get: - summary: Navigation Status - operationId: get-my-ships-shipSymbol-navigate - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - data: - shipSymbol: 3AE434-1 - departure: X1-OE-PM - destination: X1-OE-A005 - durationRemaining: 2159 - arrivedAt: null - properties: - data: - type: object - properties: - navigation: - $ref: ../models/ShipNavigation.yaml - required: - - data - examples: - Success: - value: - data: - navigation: - shipSymbol: BA03F2-1 - departure: X1-OE-PM - destination: X1-OE-A005 - durationRemaining: 2279 - arrivedAt: null - description: Get the status of your last navigation. - security: - - AgentToken: [] - tags: - - navigation - '/my/ships/{shipSymbol}': - parameters: - - schema: - type: string - name: shipSymbol - in: path - required: true - get: - summary: View Ship - tags: - - ships - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - data: - symbol: 653298-1 - crew: null - officers: null - frame: FRAME_DRONE - reactor: REACTOR_SOLAR_I - engine: ENGINE_SOLAR_PROPULSION - modules: - - MODULE_CARGO_HOLD - mounts: - - MOUNT_MINING_LASER_I - registration: - factionSymbol: COMMERCE_REPUBLIC - agentSymbol: '653298' - fee: 100 - role: EXCAVATOR - integrity: - frame: 1 - reactor: 1 - engine: 1 - status: DOCKED - location: X1-OE-PM - cargo: [] - properties: - data: - $ref: ../models/Ship.yaml - required: - - data - operationId: get-my-ships-shipSymbol - description: Retrieve the details of your ship. - security: - - AgentToken: [] - /my/ships: - get: - summary: List Ships - tags: - - ships - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - data: - - symbol: 653298-1 - crew: null - officers: null - frame: FRAME_DRONE - reactor: REACTOR_SOLAR_I - engine: ENGINE_SOLAR_PROPULSION - modules: - - MODULE_CARGO_HOLD - mounts: - - MOUNT_MINING_LASER_I - registration: - factionSymbol: COMMERCE_REPUBLIC - agentSymbol: '653298' - fee: 100 - role: EXCAVATOR - integrity: - frame: 1 - reactor: 1 - engine: 1 - status: DOCKED - location: X1-OE-PM - cargo: [] - - symbol: 653298-2 - crew: null - officers: null - frame: FRAME_DRONE - reactor: REACTOR_SOLAR_I - engine: ENGINE_SOLAR_PROPULSION - modules: - - MODULE_CARGO_HOLD - mounts: - - MOUNT_MINING_LASER_I - registration: - factionSymbol: COMMERCE_REPUBLIC - agentSymbol: '653298' - fee: 100 - role: EXCAVATOR - integrity: - frame: 1 - reactor: 1 - engine: 1 - status: DOCKED - location: X1-OE-PM - cargo: [] - - symbol: 653298-3 - crew: null - officers: null - frame: FRAME_DRONE - reactor: REACTOR_SOLAR_I - engine: ENGINE_SOLAR_PROPULSION - modules: - - MODULE_CARGO_HOLD - mounts: - - MOUNT_MINING_LASER_I - registration: - factionSymbol: COMMERCE_REPUBLIC - agentSymbol: '653298' - fee: 100 - role: EXCAVATOR - integrity: - frame: 1 - reactor: 1 - engine: 1 - status: DOCKED - location: X1-OE-PM - cargo: [] - - symbol: 653298-4 - crew: null - officers: null - frame: FRAME_DRONE - reactor: REACTOR_SOLAR_I - engine: ENGINE_SOLAR_PROPULSION - modules: - - MODULE_CARGO_HOLD - mounts: - - MOUNT_MINING_LASER_I - registration: - factionSymbol: COMMERCE_REPUBLIC - agentSymbol: '653298' - fee: 100 - role: EXCAVATOR - integrity: - frame: 1 - reactor: 1 - engine: 1 - status: DOCKED - location: X1-OE-PM - cargo: [] - - symbol: 653298-5 - crew: null - officers: null - frame: FRAME_DRONE - reactor: REACTOR_SOLAR_I - engine: ENGINE_SOLAR_PROPULSION - modules: - - MODULE_CARGO_HOLD - mounts: - - MOUNT_MINING_LASER_I - registration: - factionSymbol: COMMERCE_REPUBLIC - agentSymbol: '653298' - fee: 100 - role: EXCAVATOR - integrity: - frame: 1 - reactor: 1 - engine: 1 - status: DOCKED - location: X1-OE-PM - cargo: [] - - symbol: 653298-6 - crew: null - officers: null - frame: FRAME_DRONE - reactor: REACTOR_SOLAR_I - engine: ENGINE_SOLAR_PROPULSION - modules: - - MODULE_CARGO_HOLD - mounts: - - MOUNT_MINING_LASER_I - registration: - factionSymbol: COMMERCE_REPUBLIC - agentSymbol: '653298' - fee: 100 - role: EXCAVATOR - integrity: - frame: 1 - reactor: 1 - engine: 1 - status: DOCKED - location: X1-OE-PM - cargo: [] - meta: - total: 6 - page: 1 - limit: 20 - properties: - data: - type: array - uniqueItems: true - minItems: 1 - items: - $ref: ../models/Ship.yaml - meta: - $ref: ../models/Meta.yaml - required: - - data - - meta - examples: - Success: - value: - data: - - symbol: 55B261-1 - crew: null - officers: null - fuel: 100 - frame: FRAME_DRONE - reactor: REACTOR_SOLAR_I - engine: ENGINE_SOLAR_PROPULSION - modules: - - MODULE_CARGO_HOLD - mounts: - - MOUNT_MINING_LASER_I - registration: - factionSymbol: COMMERCE_REPUBLIC - agentSymbol: 55B261 - fee: 100 - role: EXCAVATOR - integrity: - frame: 1 - reactor: 1 - engine: 1 - status: DOCKED - location: X1-OE-PM - cargo: [] - - symbol: 55B261-2 - crew: null - officers: null - fuel: 100 - frame: FRAME_DRONE - reactor: REACTOR_SOLAR_I - engine: ENGINE_SOLAR_PROPULSION - modules: - - MODULE_CARGO_HOLD - mounts: - - MOUNT_MINING_LASER_I - registration: - factionSymbol: COMMERCE_REPUBLIC - agentSymbol: 55B261 - fee: 100 - role: EXCAVATOR - integrity: - frame: 1 - reactor: 1 - engine: 1 - status: DOCKED - location: X1-OE-PM - cargo: [] - - symbol: 55B261-3 - crew: null - officers: null - fuel: 100 - frame: FRAME_DRONE - reactor: REACTOR_SOLAR_I - engine: ENGINE_SOLAR_PROPULSION - modules: - - MODULE_CARGO_HOLD - mounts: - - MOUNT_MINING_LASER_I - registration: - factionSymbol: COMMERCE_REPUBLIC - agentSymbol: 55B261 - fee: 100 - role: EXCAVATOR - integrity: - frame: 1 - reactor: 1 - engine: 1 - status: DOCKED - location: X1-OE-PM - cargo: [] - - symbol: 55B261-4 - crew: null - officers: null - fuel: 100 - frame: FRAME_DRONE - reactor: REACTOR_SOLAR_I - engine: ENGINE_SOLAR_PROPULSION - modules: - - MODULE_CARGO_HOLD - mounts: - - MOUNT_MINING_LASER_I - registration: - factionSymbol: COMMERCE_REPUBLIC - agentSymbol: 55B261 - fee: 100 - role: EXCAVATOR - integrity: - frame: 1 - reactor: 1 - engine: 1 - status: DOCKED - location: X1-OE-PM - cargo: [] - - symbol: 55B261-5 - crew: null - officers: null - fuel: 100 - frame: FRAME_DRONE - reactor: REACTOR_SOLAR_I - engine: ENGINE_SOLAR_PROPULSION - modules: - - MODULE_CARGO_HOLD - mounts: - - MOUNT_MINING_LASER_I - registration: - factionSymbol: COMMERCE_REPUBLIC - agentSymbol: 55B261 - fee: 100 - role: EXCAVATOR - integrity: - frame: 1 - reactor: 1 - engine: 1 - status: DOCKED - location: X1-OE-PM - cargo: [] - - symbol: 55B261-6 - crew: null - officers: null - fuel: 100 - frame: FRAME_DRONE - reactor: REACTOR_SOLAR_I - engine: ENGINE_SOLAR_PROPULSION - modules: - - MODULE_CARGO_HOLD - mounts: - - MOUNT_MINING_LASER_I - registration: - factionSymbol: COMMERCE_REPUBLIC - agentSymbol: 55B261 - fee: 100 - role: EXCAVATOR - integrity: - frame: 1 - reactor: 1 - engine: 1 - status: DOCKED - location: X1-OE-PM - cargo: [] - meta: - total: 6 - page: 1 - limit: 20 - operationId: get-my-ships - description: Retrieve all of your ships. - security: - - AgentToken: [] - post: - summary: Purchase Ship - tags: - - shipyards - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - data: - symbol: 4F4D44-1 - crew: null - officers: null - fuel: 100 - frame: FRAME_DRONE - reactor: REACTOR_SOLAR_I - engine: ENGINE_SOLAR_PROPULSION - modules: - - MODULE_CARGO_HOLD - mounts: - - MOUNT_MINING_LASER_I - registration: - factionSymbol: COMMERCE_REPUBLIC - agentSymbol: 4F4D44 - fee: 100 - role: EXCAVATOR - integrity: - frame: 1 - reactor: 1 - engine: 1 - status: DOCKED - location: X1-OE-PM - cargo: [] - properties: - data: - type: object - properties: - ship: - $ref: ../models/Ship.yaml - credits: - type: integer - required: - - data - operationId: post-my-ships - security: - - AgentToken: [] - description: Purchase a ship - requestBody: - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The id of the shipyard listing you want to purchase. - /my/contracts: - get: - summary: List Contracts - tags: - - contracts - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - 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' - - id: cl0hok3920023kv0jflbjpltg - faction: COMMERCE_REPUBLIC - type: PROCUREMENT - terms: - deadline: '2022-03-11T05:16:59.123Z' - 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.122Z' - meta: - total: 2 - page: 1 - limit: 20 - properties: - data: - type: array - uniqueItems: true - minItems: 1 - items: - $ref: ../models/Contract.yaml - meta: - $ref: ../models/Meta.yaml - required: - - data - - meta - 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' - meta: - total: 10 - page: 1 - limit: 10 - operationId: get-my-contracts - security: - - AgentToken: [] - description: List all of your contracts. - '/my/contracts/{contractId}': - parameters: - - schema: - type: string - name: contractId - in: path - required: true - description: The contract ID - get: - summary: Contract Details - tags: - - contracts - responses: - '200': - description: OK - content: - application/json: - schema: - 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' - operationId: get-my-contracts-contractId - security: - - AgentToken: [] - description: Get the details of a contract by ID. - '/my/contracts/{contractId}/accept': - parameters: - - schema: - type: string - name: contractId - in: path - required: true - post: - summary: Accept Contract - tags: - - contracts - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - data: - $ref: ../models/Contract.yaml - operationId: post-my-contracts-contractId-accept - security: - - AgentToken: [] - description: Accept a contract. - /systems: - get: - summary: List Systems - tags: - - systems - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - 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 - chartedBy: null - - symbol: X1-EV - sector: X1 - type: ORANGE_STAR - x: 3 - 'y': 4 - waypoints: - - X1-EV-A004 - factions: - - COMMERCE_REPUBLIC - charted: true - chartedBy: null - - symbol: X1-ZZ - sector: X1 - type: BLUE_STAR - x: -2 - 'y': 11 - waypoints: [] - factions: [] - charted: false - chartedBy: null - meta: - total: 3 - page: 1 - limit: 20 - properties: - data: - type: array - uniqueItems: true - minItems: 1 - items: - $ref: ../models/System.yaml - meta: - $ref: ../models/Meta.yaml - 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 - chartedBy: null - meta: - total: 0 - page: 0 - limit: 0 - operationId: get-systems - description: Return a list of all systems. - security: - - AgentToken: [] - '/systems/{systemSymbol}': - parameters: - - schema: - type: string - default: X1-OE - name: systemSymbol - in: path - required: true - description: The system symbol - get: - summary: View System - tags: - - systems - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - data: - symbol: X1-ZZ - sector: X1 - type: BLUE_STAR - x: -2 - 'y': 9 - waypoints: [] - factions: [] - charted: false - chartedBy: null - properties: - data: - $ref: ../models/System.yaml - required: - - data - examples: - Success: - value: - data: - symbol: X1-ZZ - sector: X1 - type: BLUE_STAR - x: -2 - 'y': 9 - waypoints: [] - factions: [] - charted: false - chartedBy: null - operationId: get-systems-systemSymbol - security: - - AgentToken: [] - '/systems/{systemSymbol}/shipyards': - parameters: - - schema: - type: string - name: systemSymbol - in: path - required: true - description: the system symbol - get: - summary: List Shipyards - tags: - - shipyards - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - data: - - symbol: X1-OE-PM - faction: COMMERCE_REPUBLIC - meta: - total: 1 - page: 1 - limit: 20 - properties: - data: - type: array - uniqueItems: true - minItems: 1 - items: - $ref: ../models/Shipyard.yaml - meta: - $ref: ../models/Meta.yaml - required: - - data - - meta - operationId: get-systems-systemSymbol-shipyards - security: - - AgentToken: [] - description: Returns a list of all shipyards in a system. - '/systems/{systemSymbol}/shipyards/{waypointSymbol}': - parameters: - - schema: - type: string - name: systemSymbol - in: path - required: true - description: The system symbol - - schema: - type: string - name: waypointSymbol - in: path - required: true - description: The waypoint symbol - get: - summary: Shipyard Details - tags: - - shipyards - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - data: - $ref: ../models/Shipyard.yaml - operationId: get-systems-systemSymbol-shipyards-waypointSymbol - security: - - AgentToken: [] - '/systems/{systemSymbol}/shipyards/{waypointSymbol}/ships': - parameters: - - schema: - type: string - name: systemSymbol - in: path - required: true - description: The system symbol - - schema: - type: string - name: waypointSymbol - in: path - required: true - description: The waypoint symbol - get: - summary: Shipyard Listings - tags: - - shipyards - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - data: - - id: cl0nahta90000aq0jonm1nprl - waypoint: X1-OE-PM - price: 58191 - role: EXCAVATOR - frame: FRAME_DRONE - reactor: REACTOR_SOLAR_I - engine: ENGINE_SOLAR_PROPULSION - modules: - - MODULE_CARGO_HOLD - mounts: - - MOUNT_MINING_LASER_I - meta: - total: 1 - page: 1 - limit: 20 - properties: - data: - type: array - uniqueItems: true - minItems: 1 - items: - $ref: ../models/ShipyardListing.yaml - meta: - $ref: ../models/Meta.yaml - required: - - data - - meta - examples: {} - operationId: get-systems-systemSymbol-shipyards-waypointSymbol-ships - security: - - AgentToken: [] - '/trade/{tradeSymbol}/imports': - parameters: - - schema: - type: string - name: tradeSymbol - in: path - required: true - description: The trade symbol - get: - summary: Trade Imports - tags: - - markets - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - properties: - data: - type: array - uniqueItems: true - minItems: 1 - items: - $ref: ../models/MarketTrade.yaml - meta: - $ref: ../models/Meta.yaml - required: - - data - - meta - examples: {} - operationId: get-trade-tradeSymbol-imports - security: - - AgentToken: [] - '/trade/{tradeSymbol}/exports': - parameters: - - schema: - type: string - name: tradeSymbol - in: path - required: true - description: The trade symbol - get: - summary: Trade Exports - tags: - - markets - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - properties: - data: - type: array - uniqueItems: true - minItems: 1 - items: - $ref: ../models/MarketTrade.yaml - meta: - $ref: ../models/Meta.yaml - required: - - data - - meta - examples: {} - operationId: get-trade-tradeSymbol-exports - security: - - AgentToken: [] - '/trade/{tradeSymbol}/exchange': - parameters: - - schema: - type: string - name: tradeSymbol - in: path - required: true - description: The trade symbol - get: - summary: Trade Exchanges - tags: - - markets - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - properties: - data: - type: array - uniqueItems: true - minItems: 1 - items: - $ref: ../models/MarketTrade.yaml - meta: - $ref: ../models/Meta.yaml - required: - - data - - meta - examples: {} - operationId: get-trade-tradeSymbol-exchange - security: - - AgentToken: [] - '/systems/{systemSymbol}/markets': - parameters: - - schema: - type: string - name: systemSymbol - in: path - required: true - description: The system symbol - get: - summary: List Markets - tags: - - markets - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - data: - exports: - - waypointSymbol: X1-OE-PM - tradeSymbol: MICROPROCESSORS - price: 834 - tariff: 0 - imports: - - waypointSymbol: X1-OE-PM - tradeSymbol: SILICON - price: 144 - tariff: 0 - - waypointSymbol: X1-OE-PM - tradeSymbol: QUARTZ - price: 286 - tariff: 0 - exchange: [] - properties: - data: - type: array - items: - type: string - required: - - data - examples: - Success: - value: - data: - - X1-AK3-88760F - meta: - total: 1 - page: 1 - limit: 20 - operationId: get-systems-systemSymbol-markets - description: |- - Retrieve a list of all charted markets in the given system. Markets are only available if the waypoint is charted and contains a communications relay. - - To install a communications relay at a market, look at the `my/ships/{shipSymbol}/deploy` endpoint. - security: - - AgentToken: [] - '/systems/{systemSymbol}/markets/{waypointSymbol}': - parameters: - - schema: - type: string - name: systemSymbol - in: path - required: true - description: The system symbol - - schema: - type: string - name: waypointSymbol - in: path - required: true - description: The waypoint symbol - get: - summary: View Market - tags: - - markets - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - data: - exports: - - waypointSymbol: X1-OE-PM - tradeSymbol: MICROPROCESSORS - price: 834 - tariff: 0 - imports: - - waypointSymbol: X1-OE-PM - tradeSymbol: SILICON - price: 144 - tariff: 0 - - waypointSymbol: X1-OE-PM - tradeSymbol: QUARTZ - price: 286 - tariff: 0 - exchange: [] - properties: - data: - type: object - required: - - exports - - imports - - exchange - properties: - exports: - type: array - uniqueItems: true - minItems: 1 - items: - $ref: ../models/MarketTrade.yaml - imports: - type: array - uniqueItems: true - minItems: 1 - items: - $ref: ../models/MarketTrade.yaml - exchange: - type: array - items: - $ref: ../models/MarketTrade.yaml - required: - - data - examples: - Success: - value: - data: - exports: - - waypointSymbol: X1-OE-PM - tradeSymbol: MICROPROCESSORS - price: 834 - tariff: 0 - imports: - - waypointSymbol: X1-OE-PM - tradeSymbol: SILICON - price: 144 - tariff: 0 - - waypointSymbol: X1-OE-PM - tradeSymbol: QUARTZ - price: 286 - tariff: 0 - exchange: [] - operationId: get-systems-systemSymbol-markets-waypointSymbol - description: |- - Retrieve imports, exports and exchange data from a marketplace. Imports can be sold, exports can be purchased, and exchange trades can be purchased or sold. - - Market data is only available if you have a ship at the location, or the location is charted and has a communications relay deployed. - - See `/my/ships/{shipSymbol}/deploy` for deploying relays at a location. - security: - - AgentToken: [] - '/systems/{systemSymbol}/waypoints': - parameters: - - schema: - type: string - name: systemSymbol - in: path - required: true - description: The system symbol - get: - summary: List Waypoints - tags: - - systems - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - data: - - system: X1-OE - symbol: X1-OE-PM - type: PLANET - x: 10 - 'y': 5 - orbitals: - - X1-OE-PM01 - faction: COMMERCE_REPUBLIC - features: - - MARKETPLACE - - SHIPYARD - traits: - - OVERCROWDED - - HIGH_TECH - - BUREAUCRATIC - - TRADING_HUB - - TEMPERATE - charted: true - chartedBy: null - - system: X1-OE - symbol: X1-OE-PM01 - type: MOON - x: 10 - 'y': 5 - orbitals: [] - faction: COMMERCE_REPUBLIC - features: - - MARKETPLACE - traits: - - WEAK_GRAVITY - charted: true - chartedBy: null - - system: X1-OE - symbol: X1-OE-A005 - type: ASTEROID_FIELD - x: -1 - 'y': -29 - orbitals: [] - faction: MINERS_COLLECTIVE - features: [] - traits: - - COMMON_METAL_DEPOSITS - charted: true - chartedBy: null - - system: X1-OE - symbol: X1-OE-25X - type: JUMP_GATE - x: -38 - 'y': 47 - orbitals: [] - faction: SPACERS_GUILD - features: [] - traits: [] - charted: true - chartedBy: null - meta: - total: 4 - page: 1 - limit: 20 - properties: - data: - type: array - uniqueItems: true - minItems: 1 - items: - $ref: ../models/Waypoint.yaml - meta: - $ref: ../models/Meta.yaml - required: - - data - - meta - examples: - Success: - value: - data: - - system: X1-OE - symbol: X1-OE-PM - type: PLANET - x: 10 - 'y': 5 - orbitals: - - X1-OE-PM01 - faction: COMMERCE_REPUBLIC - features: - - MARKETPLACE - - SHIPYARD - traits: - - OVERCROWDED - - HIGH_TECH - - BUREAUCRATIC - - TRADING_HUB - - TEMPERATE - charted: true - chartedBy: null - - system: X1-OE - symbol: X1-OE-PM01 - type: MOON - x: 10 - 'y': 5 - orbitals: [] - faction: COMMERCE_REPUBLIC - features: - - MARKETPLACE - traits: - - WEAK_GRAVITY - charted: true - chartedBy: null - - system: X1-OE - symbol: X1-OE-A005 - type: ASTEROID_FIELD - x: -1 - 'y': -29 - orbitals: [] - faction: MINERS_COLLECTIVE - features: [] - traits: - - COMMON_METAL_DEPOSITS - charted: true - chartedBy: null - - system: X1-OE - symbol: X1-OE-25X - type: JUMP_GATE - x: -38 - 'y': 47 - orbitals: [] - faction: SPACERS_GUILD - features: [] - traits: [] - charted: true - chartedBy: null - meta: - total: 4 - page: 1 - limit: 20 - operationId: get-systems-systemSymbol-waypoints-waypointSymbol - security: - - AgentToken: [] - description: Fetch all of the waypoints for a given system. System must be charted or a ship must be present to return waypoint details. - '/systems/{systemSymbol}/waypoints/{waypointSymbol}': - parameters: - - schema: - type: string - name: systemSymbol - in: path - required: true - description: The system symbol - - schema: - type: string - name: waypointSymbol - in: path - required: true - description: The waypoint symbol - get: - summary: View Waypoint - tags: - - systems - responses: - '200': - description: OK - content: - application/json: - schema: - description: '' - type: object - x-examples: - example-1: - data: - - system: X1-OE - symbol: X1-OE-PM - type: PLANET - x: 10 - 'y': 5 - orbitals: - - X1-OE-PM01 - faction: COMMERCE_REPUBLIC - features: - - MARKETPLACE - - SHIPYARD - traits: - - OVERCROWDED - - HIGH_TECH - - BUREAUCRATIC - - TRADING_HUB - - TEMPERATE - charted: true - chartedBy: null - - system: X1-OE - symbol: X1-OE-PM01 - type: MOON - x: 10 - 'y': 5 - orbitals: [] - faction: COMMERCE_REPUBLIC - features: - - MARKETPLACE - traits: - - WEAK_GRAVITY - charted: true - chartedBy: null - - system: X1-OE - symbol: X1-OE-A005 - type: ASTEROID_FIELD - x: -1 - 'y': -29 - orbitals: [] - faction: MINERS_COLLECTIVE - features: [] - traits: - - COMMON_METAL_DEPOSITS - charted: true - chartedBy: null - - system: X1-OE - symbol: X1-OE-25X - type: JUMP_GATE - x: -38 - 'y': 47 - orbitals: [] - faction: SPACERS_GUILD - features: [] - traits: [] - charted: true - chartedBy: null - meta: - total: 4 - page: 1 - limit: 20 - properties: - data: - type: array - uniqueItems: true - minItems: 1 - items: - $ref: ../models/Waypoint.yaml - meta: - $ref: ../models/Meta.yaml - required: - - data - - meta - examples: - Success: - value: - data: - - system: X1-OE - symbol: X1-OE-PM - type: PLANET - x: 10 - 'y': 5 - orbitals: - - X1-OE-PM01 - faction: COMMERCE_REPUBLIC - features: - - MARKETPLACE - - SHIPYARD - traits: - - OVERCROWDED - - HIGH_TECH - - BUREAUCRATIC - - TRADING_HUB - - TEMPERATE - charted: true - chartedBy: null - - system: X1-OE - symbol: X1-OE-PM01 - type: MOON - x: 10 - 'y': 5 - orbitals: [] - faction: COMMERCE_REPUBLIC - features: - - MARKETPLACE - traits: - - WEAK_GRAVITY - charted: true - chartedBy: null - - system: X1-OE - symbol: X1-OE-A005 - type: ASTEROID_FIELD - x: -1 - 'y': -29 - orbitals: [] - faction: MINERS_COLLECTIVE - features: [] - traits: - - COMMON_METAL_DEPOSITS - charted: true - chartedBy: null - - system: X1-OE - symbol: X1-OE-25X - type: JUMP_GATE - x: -38 - 'y': 47 - orbitals: [] - faction: SPACERS_GUILD - features: [] - traits: [] - charted: true - chartedBy: null - meta: - total: 4 - page: 1 - limit: 20 - operationId: get-systems-systemSymbol-waypoints - security: - - AgentToken: [] - description: View the details of a waypoint. -tags: - - name: ships - - name: markets - - name: trade - - name: sell - - name: purchase - - name: navigation - - name: agents - - name: dock - - name: orbit - - name: jettison - - name: jump - - name: refuel - - name: scan - - name: contracts - - name: chart - - name: extract - - name: mining - - name: deliver - - name: survey - - name: systems - - name: waypoints - - name: shipyards - - name: markets -components: - schemas: {} - securitySchemes: - AgentToken: - type: http - scheme: bearer - description: When you register a new agent you will be granted a private bearer token which grants authorization to use the API. - requestBodies: {} diff --git a/resources/agent/MyAgent.json b/resources/agent/MyAgent.json new file mode 100644 index 0000000..925ffb5 --- /dev/null +++ b/resources/agent/MyAgent.json @@ -0,0 +1,44 @@ +{ + "get": { + "summary": "My Agent Details", + "tags": [ + "agents" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "../../models/Agent.yaml" + } + } + }, + "examples": { + "Agent": { + "value": { + "data": { + "accountId": "cl0hok34m0003ks0jjql5q8f2", + "symbol": "EMBER", + "headquarters": "X1-OE-PM", + "credits": 0 + } + } + } + } + } + } + } + }, + "operationId": "get-my-agent", + "security": [ + { + "AgentToken": [] + } + ], + "description": "Fetch your agent's details." + } +} \ No newline at end of file diff --git a/resources/agent/RegisterAgent.json b/resources/agent/RegisterAgent.json new file mode 100644 index 0000000..a76abf5 --- /dev/null +++ b/resources/agent/RegisterAgent.json @@ -0,0 +1,68 @@ +{ + "post": { + "operationId": "register-agent", + "summary": "Register New Agent", + "description": "Creates a new agent and ties it to a temporary Account. Use `COMMERCE_REPUBLIC` as your starting faction if you don't know any other factions to choose from.\n\nThe agent symbol is a 4-8 character string that will represent your agent. This symbol will prefix the symbol of every ship you own. Agent symbols will be cast to all uppercase characters.\n\nA new agent will be granted an authorization token, a contract with their starting faction, a command ship with a jump drive, and one hundred thousand credits.\n\n> #### Keep your token safe and secure\n>\n> Save your token during the alpha phase. There is no way to regenerate this token without starting a new agent. In the future you will be able to generate and manage your tokens from the SpaceTraders website.\n\nYou can accept your contract using the `/my/contracts/{contractId}/accept` endpoint. You will want to navigate your command ship to a nearby asteroid field waypoint, and execute the `/my/ships/{shipSymbol}/accept` endpoint to mine various types of ores and minerals.\n\nReturn to the contract destination and execute the `/my/ships/{shipSymbol}/deliver` endpoint to deposit goods into the contract.\n\nWhen your contract is fulfilled, you can call `/my/contracts/{contractId}/fulfill` to retrieve payment.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "How other agents will see your ships and information.", + "minLength": 4, + "maxLength": 8, + "example": "BADGER" + }, + "faction": { + "type": "string", + "default": "COMMERCE_REPUBLIC", + "description": "The faction you choose determines your headquarters." + } + } + } + } + }, + "description": "" + }, + "responses": { + "201": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "token": { + "type": "string" + }, + "agent": { + "$ref": "../../models/Agent.yaml" + }, + "faction": { + "$ref": "../../models/Faction.yaml" + }, + "contract": { + "$ref": "../../models/Contract.yaml" + }, + "ship": { + "$ref": "../../models/Ship.json" + } + } + } + } + } + } + } + } + }, + "tags": [ + "agents" + ] + } +} \ No newline at end of file From 439d2eca04671825e0e469c8cdaf60af1f63e682 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Mon, 19 Sep 2022 10:22:16 -0700 Subject: [PATCH 03/48] minor cleanup of types --- models/Cooldown.json | 2 +- models/ShipCargo.json | 2 +- models/ShipCrew.json | 5 ++--- models/ShipFuel.json | 2 +- models/ShipRegistration.json | 2 +- models/ShipRequirements.json | 14 +++++++------- reference/SpaceTraders.json | 2 +- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/models/Cooldown.json b/models/Cooldown.json index cec9ffe..6711be5 100644 --- a/models/Cooldown.json +++ b/models/Cooldown.json @@ -12,7 +12,7 @@ "description": "The remaining duration of the cooldown in seconds", "minimum": 0 }, - "expiresAt": { + "expiration": { "type": "string", "format": "date-time", "description": "The date and time when the cooldown expires in ISO 8601 format", diff --git a/models/ShipCargo.json b/models/ShipCargo.json index 4f8edbd..93fca08 100644 --- a/models/ShipCargo.json +++ b/models/ShipCargo.json @@ -1,7 +1,7 @@ { "type": "object", "properties": { - "size": { + "capacity": { "type": "integer", "minimum": 0 }, diff --git a/models/ShipCrew.json b/models/ShipCrew.json index ca6ee29..db12854 100644 --- a/models/ShipCrew.json +++ b/models/ShipCrew.json @@ -23,13 +23,12 @@ }, "rotation": { "type": "string", - "description": "The rotation of crew shifts. Stricter shifts can improve the ship's performance, and more relaxed shifts can improve the crew's morale.", + "description": "The rotation of crew shifts. A stricter shift improves the ship's performance. A more relaxed shift improves the crew's morale.", "enum": [ "STRICT", - "STANDARD", "RELAXED" ], - "default": "STANDARD" + "default": "STRICT" }, "morale": { "type": "integer", diff --git a/models/ShipFuel.json b/models/ShipFuel.json index 94f3f1e..e2a5081 100644 --- a/models/ShipFuel.json +++ b/models/ShipFuel.json @@ -7,7 +7,7 @@ "description": "The amount of fuel in the ship's tanks.", "minimum": 0 }, - "max": { + "capacity": { "type": "integer", "description": "The maximum amount of fuel the ship's tanks can hold.", "minimum": 0 diff --git a/models/ShipRegistration.json b/models/ShipRegistration.json index b682a33..8017311 100644 --- a/models/ShipRegistration.json +++ b/models/ShipRegistration.json @@ -17,7 +17,7 @@ "The Flying Dutchman" ] }, - "faction": { + "factionSymbol": { "type": "string", "description": "The symbol of the faction the ship is registered with", "minLength": 1, diff --git a/models/ShipRequirements.json b/models/ShipRequirements.json index 4a65b3f..2510319 100644 --- a/models/ShipRequirements.json +++ b/models/ShipRequirements.json @@ -4,15 +4,15 @@ "properties": { "power": { "type": "integer", - "minimum": 0 + "description": "The amount of power required from the reactor." }, "crew": { "type": "integer", - "minimum": 0 + "description": "The number of crew required for operation." + }, + "slots": { + "type": "integer", + "description": "The number of module slots required for installation." } - }, - "required": [ - "power", - "crew" - ] + } } \ No newline at end of file diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index b4bf174..00314ca 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -496,7 +496,7 @@ "Success": { "value": { "data": { - "status": "ORBIT" + "status": "IN_ORBIT" } } } From bcc4412f8f83390fc354ce3c96b2fb7cc77c0df6 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Wed, 5 Oct 2022 16:42:15 -0700 Subject: [PATCH 04/48] update waypoint models --- models/Faction.json | 63 + models/Faction.yaml | 46 - models/Jump.json | 30 + models/Jump.yaml | 19 - models/Market.json | 38 + models/MarketTrade.yaml | 18 - models/MarketTradeGood.json | 33 + models/MarketTransaction.json | 36 + models/Ship.json | 4 +- models/ShipCargo.json | 33 +- models/ShipCargoItem.json | 31 + .../{ShipThrusters.json => ShipEngine.json} | 2 +- models/Shipyard.json | 18 + models/Shipyard.yaml | 19 - models/ShipyardListing.yaml | 66 - models/ShipyardShip.json | 34 + models/Waypoint.json | 56 + models/Waypoint.yaml | 89 - models/WaypointChart.json | 13 + models/WaypointFaction.json | 9 + models/WaypointOrbital.json | 10 + models/WaypointTrait.json | 72 + models/WaypointType.json | 14 + reference/SpaceTraders.json | 2088 ++++++----------- 24 files changed, 1193 insertions(+), 1648 deletions(-) create mode 100644 models/Faction.json delete mode 100644 models/Faction.yaml create mode 100644 models/Jump.json delete mode 100644 models/Jump.yaml create mode 100644 models/Market.json delete mode 100644 models/MarketTrade.yaml create mode 100644 models/MarketTradeGood.json create mode 100644 models/MarketTransaction.json create mode 100644 models/ShipCargoItem.json rename models/{ShipThrusters.json => ShipEngine.json} (86%) create mode 100644 models/Shipyard.json delete mode 100644 models/Shipyard.yaml delete mode 100644 models/ShipyardListing.yaml create mode 100644 models/ShipyardShip.json create mode 100644 models/Waypoint.json delete mode 100644 models/Waypoint.yaml create mode 100644 models/WaypointChart.json create mode 100644 models/WaypointFaction.json create mode 100644 models/WaypointOrbital.json create mode 100644 models/WaypointTrait.json create mode 100644 models/WaypointType.json diff --git a/models/Faction.json b/models/Faction.json new file mode 100644 index 0000000..ae066d3 --- /dev/null +++ b/models/Faction.json @@ -0,0 +1,63 @@ +{ + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "symbol": "COMMERCE_REPUBLIC", + "name": "Commerce Repubic", + "description": "", + "headquarters": "X1-OE-PM", + "traits": [ + "BUREAUCRATIC", + "CAPITALISTIC", + "GUILD", + "ESTABLISHED" + ] + } + }, + "examples": [ + { + "symbol": "COMMERCE_REPUBLIC", + "name": "Commerce Repubic", + "description": "The Commerce Republic takes capital from top tier worlds and invests it into new systems with high potential for growth.", + "headquarters": "X1-OE-PM", + "traits": [ + "BUREAUCRATIC", + "CAPITALISTIC", + "GUILD", + "ESTABLISHED" + ] + } + ], + "properties": { + "symbol": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1 + }, + "description": { + "type": "string", + "minLength": 1 + }, + "headquarters": { + "type": "string", + "minLength": 1 + }, + "traits": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "symbol", + "name", + "description", + "headquarters", + "traits" + ] +} \ No newline at end of file diff --git a/models/Faction.yaml b/models/Faction.yaml deleted file mode 100644 index 9fbb1ab..0000000 --- a/models/Faction.yaml +++ /dev/null @@ -1,46 +0,0 @@ -description: '' -type: object -x-examples: - example-1: - symbol: COMMERCE_REPUBLIC - name: Commerce Repubic - description: The Commerce Republic takes capital from top tier worlds and invests it into new systems with high potential for growth. - headquarters: X1-OE-PM - traits: - - BUREAUCRATIC - - CAPITALISTIC - - GUILD - - ESTABLISHED -examples: - - symbol: COMMERCE_REPUBLIC - name: Commerce Repubic - description: The Commerce Republic takes capital from top tier worlds and invests it into new systems with high potential for growth. - headquarters: X1-OE-PM - traits: - - BUREAUCRATIC - - CAPITALISTIC - - GUILD - - ESTABLISHED -properties: - symbol: - type: string - minLength: 1 - name: - type: string - minLength: 1 - description: - type: string - minLength: 1 - headquarters: - type: string - minLength: 1 - traits: - type: array - items: - type: string -required: - - symbol - - name - - description - - headquarters - - traits diff --git a/models/Jump.json b/models/Jump.json new file mode 100644 index 0000000..792d59d --- /dev/null +++ b/models/Jump.json @@ -0,0 +1,30 @@ +{ + "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/Jump.yaml b/models/Jump.yaml deleted file mode 100644 index 9d9c957..0000000 --- a/models/Jump.yaml +++ /dev/null @@ -1,19 +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 diff --git a/models/Market.json b/models/Market.json new file mode 100644 index 0000000..2730266 --- /dev/null +++ b/models/Market.json @@ -0,0 +1,38 @@ +{ + "description": "", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "The symbol of the market. The symbol is the same as the waypoint where the market is located." + }, + "exports": { + "type": "array", + "description": "The list of goods that are exported from this market.", + "items": { + "type": "string" + } + }, + "imports": { + "type": "array", + "description": "The list of goods that are sought as imports in this market.", + "items": { + "type": "string" + } + }, + "transactions": { + "type": "array", + "description": "The list of recent transactions at this market.", + "items": { + "$ref": "./MarketTransaction.json" + } + }, + "tradeGoods": { + "type": "array", + "description": "The list of goods that are traded at this market.", + "items": { + "$ref": "./MarketTradeGood.json" + } + } + } +} \ No newline at end of file diff --git a/models/MarketTrade.yaml b/models/MarketTrade.yaml deleted file mode 100644 index 1f7eadc..0000000 --- a/models/MarketTrade.yaml +++ /dev/null @@ -1,18 +0,0 @@ -description: "" -type: object -properties: - waypointSymbol: - type: string - minLength: 1 - tradeSymbol: - type: string - minLength: 1 - price: - type: integer - tariff: - type: integer -required: - - waypointSymbol - - tradeSymbol - - price - - tariff diff --git a/models/MarketTradeGood.json b/models/MarketTradeGood.json new file mode 100644 index 0000000..4519f05 --- /dev/null +++ b/models/MarketTradeGood.json @@ -0,0 +1,33 @@ +{ + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "The symbol of the trade good." + }, + "tradeVolume": { + "type": "integer", + "description": "The average volume flowing through the market for this type of good.", + "minimum": 1 + }, + "supply": { + "type": "string", + "description": "A rough estimate of the total supply of this good in this marketplace.", + "enum": [ + "HIGH", + "AVERAGE", + "LOW" + ] + }, + "purchasePrice": { + "type": "integer", + "description": "The price at which this good is sold.", + "minimum": 0 + }, + "sellPrice": { + "type": "integer", + "description": "The price at which this good is bought.", + "minimum": 0 + } + } +} \ No newline at end of file diff --git a/models/MarketTransaction.json b/models/MarketTransaction.json new file mode 100644 index 0000000..b076537 --- /dev/null +++ b/models/MarketTransaction.json @@ -0,0 +1,36 @@ +{ + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "The symbol of the trade good." + }, + "type": { + "type": "string", + "description": "The type of transaction.", + "enum": [ + "PURCHASE", + "SELL" + ] + }, + "units": { + "type": "integer", + "description": "The number of units of the transaction.", + "minimum": 1 + }, + "pricePerUnit": { + "type": "integer", + "description": "The price per unit of the transaction.", + "minimum": 1 + }, + "shipSymbol": { + "type": "string", + "description": "The symbol of the ship that made the transaction." + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the transaction." + } + } +} \ No newline at end of file diff --git a/models/Ship.json b/models/Ship.json index 2b7175e..7693032 100644 --- a/models/Ship.json +++ b/models/Ship.json @@ -26,8 +26,8 @@ "reactor": { "$ref": "./ShipReactor.json" }, - "thrusters": { - "$ref": "./ShipThrusters.json" + "engine": { + "$ref": "./ShipEngine.json" }, "modules": { "type": "array", diff --git a/models/ShipCargo.json b/models/ShipCargo.json index 93fca08..bdc27f9 100644 --- a/models/ShipCargo.json +++ b/models/ShipCargo.json @@ -3,42 +3,17 @@ "properties": { "capacity": { "type": "integer", + "description": "The max number of items that can be stored in the cargo hold.", "minimum": 0 }, "inventory": { "type": "array", + "description": "The items currently in the cargo hold.", "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "examples": [ - "ORE_COPPER", - "MICROPROCESSORS", - "FOOD" - ] - }, - "name": { - "type": "string", - "examples": [ - "Copper Ore", - "Microprocessors", - "Food" - ] - }, - "units": { - "type": "integer", - "minimum": 1 - } - }, - "required": [ - "symbol", - "name", - "units" - ] + "$ref": "./ShipCargoItem.json" }, "required": [ - "size", + "capacity", "inventory" ] } diff --git a/models/ShipCargoItem.json b/models/ShipCargoItem.json new file mode 100644 index 0000000..3fc82bf --- /dev/null +++ b/models/ShipCargoItem.json @@ -0,0 +1,31 @@ +{ + "type": "object", + "description": "The type of cargo item and the number of units.", + "properties": { + "symbol": { + "type": "string", + "examples": [ + "ORE_COPPER", + "MICROPROCESSORS", + "FOOD" + ] + }, + "name": { + "type": "string", + "examples": [ + "Copper Ore", + "Microprocessors", + "Food" + ] + }, + "units": { + "type": "integer", + "minimum": 1 + } + }, + "required": [ + "symbol", + "name", + "units" + ] +} \ No newline at end of file diff --git a/models/ShipThrusters.json b/models/ShipEngine.json similarity index 86% rename from models/ShipThrusters.json rename to models/ShipEngine.json index 6cf169a..c480fda 100644 --- a/models/ShipThrusters.json +++ b/models/ShipEngine.json @@ -1,6 +1,6 @@ { "type": "object", - "description": "The thrusters determine how quickly a ship travels between waypoints.", + "description": "The engine determines how quickly a ship travels between waypoints.", "properties": { "symbol": { "type": "string", diff --git a/models/Shipyard.json b/models/Shipyard.json new file mode 100644 index 0000000..f99ac83 --- /dev/null +++ b/models/Shipyard.json @@ -0,0 +1,18 @@ +{ + "description": "", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "The symbol of the shipyard. The symbol is the same as the waypoint where the shipyard is located.", + "minLength": 1 + }, + "ships": { + "type": "array", + "description": "The ships that are currently available for purchase at the shipyard.", + "items": { + "$ref": "./ShipyardShip.json" + } + } + } +} \ No newline at end of file diff --git a/models/Shipyard.yaml b/models/Shipyard.yaml deleted file mode 100644 index e0568f2..0000000 --- a/models/Shipyard.yaml +++ /dev/null @@ -1,19 +0,0 @@ -description: '' -type: object -properties: - symbol: - type: string - minLength: 1 - faction: - type: string - minLength: 1 -required: - - symbol - - faction -x-examples: - example-1: - symbol: X1-OE-PM - faction: COMMERCE_REPUBLIC -examples: - - symbol: X1-OE-PM - faction: COMMERCE_REPUBLIC diff --git a/models/ShipyardListing.yaml b/models/ShipyardListing.yaml deleted file mode 100644 index 63ed2fb..0000000 --- a/models/ShipyardListing.yaml +++ /dev/null @@ -1,66 +0,0 @@ -description: "" -type: object -x-examples: - example-1: - id: cl0nahta90000aq0jonm1nprl - waypoint: X1-OE-PM - price: 58191 - role: EXCAVATOR - frame: FRAME_DRONE - reactor: REACTOR_SOLAR_I - engine: ENGINE_SOLAR_PROPULSION - modules: - - MODULE_CARGO_HOLD - mounts: - - MOUNT_MINING_LASER_I -examples: - - id: cl0nahta90000aq0jonm1nprl - waypoint: X1-OE-PM - price: 58191 - role: EXCAVATOR - frame: FRAME_DRONE - reactor: REACTOR_SOLAR_I - engine: ENGINE_SOLAR_PROPULSION - modules: - - MODULE_CARGO_HOLD - mounts: - - MOUNT_MINING_LASER_I -properties: - id: - type: string - minLength: 1 - waypoint: - type: string - minLength: 1 - price: - type: integer - role: - type: string - minLength: 1 - frame: - type: string - minLength: 1 - reactor: - type: string - minLength: 1 - engine: - type: string - minLength: 1 - modules: - type: array - items: - type: string - mounts: - type: array - items: - type: string -required: - - id - - waypoint - - price - - role - - frame - - reactor - - engine - - modules - - mounts diff --git a/models/ShipyardShip.json b/models/ShipyardShip.json new file mode 100644 index 0000000..2533e1b --- /dev/null +++ b/models/ShipyardShip.json @@ -0,0 +1,34 @@ +{ + "description": "", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "minLength": 1 + }, + "price": { + "type": "integer" + }, + "frame": { + "$ref": "./ShipFrame.json" + }, + "reactor": { + "$ref": "./ShipReactor.json" + }, + "engine": { + "$ref": "./ShipEngine.json" + }, + "modules": { + "type": "array", + "items": { + "$ref": "./ShipModule.json" + } + }, + "mounts": { + "type": "array", + "items": { + "$ref": "./ShipMount.json" + } + } + } +} \ No newline at end of file diff --git a/models/Waypoint.json b/models/Waypoint.json new file mode 100644 index 0000000..619bd59 --- /dev/null +++ b/models/Waypoint.json @@ -0,0 +1,56 @@ +{ + "description": "A waypoint is a location that ships can travel to such as a Planet, Moon or Space Station.", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "minLength": 1 + }, + "type": { + "$ref": "./WaypointType.json" + }, + "systemSymbol": { + "type": "string", + "minLength": 1 + }, + "x": { + "type": "integer" + }, + "y": { + "type": "integer" + }, + "orbitals": { + "type": "array", + "items": { + "$ref": "./WaypointOrbital.json" + } + }, + "factions": { + "type": "array", + "description": "The factions that are active on the waypoint.", + "items": { + "$ref": "./WaypointFaction.json" + } + }, + "traits": { + "type": "array", + "description": "The traits of the waypoint.", + "items": { + "$ref": "./WaypointTrait.json" + } + }, + "chart": { + "$ref": "./WaypointChart.json" + } + }, + "required": [ + "symbol", + "type", + "systemSymbol", + "x", + "y", + "orbitals", + "factions", + "traits" + ] +} \ No newline at end of file diff --git a/models/Waypoint.yaml b/models/Waypoint.yaml deleted file mode 100644 index b9e963a..0000000 --- a/models/Waypoint.yaml +++ /dev/null @@ -1,89 +0,0 @@ -description: "" -type: object -x-examples: - example-1: - system: X1-OE - symbol: X1-OE-PM - type: PLANET - x: 10 - "y": 5 - orbitals: - - X1-OE-PM01 - faction: COMMERCE_REPUBLIC - features: - - MARKETPLACE - - SHIPYARD - traits: - - OVERCROWDED - - HIGH_TECH - - BUREAUCRATIC - - TRADING_HUB - - TEMPERATE - charted: true - chartedBy: null -examples: - - system: X1-OE - symbol: X1-OE-PM - type: PLANET - x: 10 - "y": 5 - orbitals: - - X1-OE-PM01 - faction: COMMERCE_REPUBLIC - features: - - MARKETPLACE - - SHIPYARD - traits: - - OVERCROWDED - - HIGH_TECH - - BUREAUCRATIC - - TRADING_HUB - - TEMPERATE - charted: true - chartedBy: null -properties: - system: - type: string - minLength: 1 - symbol: - type: string - minLength: 1 - type: - type: string - minLength: 1 - x: - type: integer - "y": - type: integer - orbitals: - type: array - items: - type: string - faction: - type: string - minLength: 1 - features: - type: array - items: - type: string - traits: - type: array - items: - type: string - charted: - type: boolean - chartedBy: - type: - - string - - "null" -required: - - system - - symbol - - type - - x - - "y" - - orbitals - - faction - - features - - traits - - charted diff --git a/models/WaypointChart.json b/models/WaypointChart.json new file mode 100644 index 0000000..6eead76 --- /dev/null +++ b/models/WaypointChart.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "description": "The chart of the waypoint, which makes the waypoint visible to other agents.", + "properties": { + "submittedBy": { + "type": "string" + }, + "submittedOn": { + "type": "string", + "format": "date-time" + } + } +} \ No newline at end of file diff --git a/models/WaypointFaction.json b/models/WaypointFaction.json new file mode 100644 index 0000000..33b0b8b --- /dev/null +++ b/models/WaypointFaction.json @@ -0,0 +1,9 @@ +{ + "type": "object", + "properties": { + "symbol": { + "type": "string", + "minLength": 1 + } + } +} \ No newline at end of file diff --git a/models/WaypointOrbital.json b/models/WaypointOrbital.json new file mode 100644 index 0000000..7ef5bda --- /dev/null +++ b/models/WaypointOrbital.json @@ -0,0 +1,10 @@ +{ + "type": "object", + "description": "An orbital is another waypoint that orbits a parent waypoint.", + "properties": { + "symbol": { + "type": "string", + "minLength": 1 + } + } +} \ No newline at end of file diff --git a/models/WaypointTrait.json b/models/WaypointTrait.json new file mode 100644 index 0000000..5ed26e4 --- /dev/null +++ b/models/WaypointTrait.json @@ -0,0 +1,72 @@ +{ + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "The unique identifier of the trait.", + "enum": [ + "UNCHARTED", + "OUTPOST", + "SCATTERED_SETTLEMENTS", + "SPRAWLING_CITIES", + "MEGA_STRUCTURES", + "OVERCROWDED", + "HIGH_TECH", + "CORRUPT", + "BUREAUCRATIC", + "TRADING_HUB", + "INDUSTRIAL", + "BLACK_MARKET", + "RESEARCH_FACILITY", + "MILITARY_BASE", + "SURVEILLANCE_OUTPOST", + "EXPLORATION_OUTPOST", + "MINERAL_DEPOSITS", + "COMMON_METAL_DEPOSITS", + "PRECIOUS_METAL_DEPOSITS", + "RARE_METAL_DEPOSITS", + "METHANE_POOLS", + "ICE_CRYSTALS", + "EXPLOSIVE_GASES", + "VIBRANT_AURORAS", + "SALT_FLATS", + "CANYONS", + "PERPETUAL_DAYLIGHT", + "PERPETUAL_OVERCAST", + "DRY_SEABEDS", + "MAGMA_SEAS", + "SUPERVOLCANOES", + "ASH_CLOUDS", + "VAST_RUINS", + "MUTATED_FLORA", + "DIVERSE_LIFE", + "SCARCE_LIFE", + "FOSSILS", + "WEAK_GRAVITY", + "STRONG_GRAVITY", + "CRUSHING_GRAVITY", + "TOXIC_ATMOSPHERE", + "CORROSIVE_ATMOSPHERE", + "BREATHABLE_ATMOSPHERE", + "COMM_RELAY_I", + "JOVIAN", + "ROCKY", + "VOLCANIC", + "FROZEN", + "SWAMP", + "BARREN", + "TEMPERATE", + "JUNGLE", + "OCEAN" + ] + }, + "name": { + "type": "string", + "description": "The name of the trait." + }, + "description": { + "type": "string", + "description": "A description of the trait." + } + } +} \ No newline at end of file diff --git a/models/WaypointType.json b/models/WaypointType.json new file mode 100644 index 0000000..4d4c37f --- /dev/null +++ b/models/WaypointType.json @@ -0,0 +1,14 @@ +{ + "type": "string", + "description": "The type of waypoint.", + "enum": [ + "PLANET", + "GAS_GIANT", + "MOON", + "ORBITAL_STATION", + "JUMP_GATE", + "ASTEROID_FIELD", + "DEBRIS_FIELD", + "GRAVITY_WELL" + ] +} \ No newline at end of file diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 00314ca..34a97ac 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -2,8 +2,8 @@ "openapi": "3.1.0", "info": { "title": "SpaceTraders API", - "version": "2.1.0", - "summary": "SpaceTraders is a unique multiplayer game built on a free Web API.", + "version": "2.0.0-rc.2", + "summary": "[Alpha] SpaceTraders is a multiplayer sci-fi strategy game where you acquire and manage a fleet of ships.", "contact": { "name": "Joel Brubaker", "email": "joel@spacetraders.io" @@ -12,16 +12,16 @@ "name": "No Permission", "url": "https://choosealicense.com/no-permission/" }, - "description": "SpaceTraders is a multiplayer sci-fi strategy game where you acquire and manage a fleet of ships across a growing and dynamic universe.\n\nSimilar to games such as Eve Online, you work with or against other players to establish trade routes, chart new systems, mine precious ores, patrol for pirates, spy on factions, and discover hidden treasures.\n\nBut what makes SpaceTraders unique is that the game is entirely accessible through open and well-documented API endpoints. In fact, SpaceTraders doesn't have a first-class client to play the game - if you want to take it for a spin, you should try one of our community-created web clients, or use the API documentation to see how you might play a game through an API.\n\nIf this sounds fun and interesting to you, please drop into our Discord and get to know the community. We are actively working on new clients, new ideas and sharing tips for how to play the game.\n\n\n```json http\n{\n \"method\": \"GET\",\n \"url\": \"https://v2-0-0.alpha.spacetraders.io\",\n}\n```" + "description": "SpaceTraders is a multiplayer sci-fi strategy game where you acquire and manage a fleet of ships across a growing and dynamic universe.\n\nSimilar to games such as Eve Online, you work with or against other players to establish trade routes, chart new systems, mine precious ores, patrol for pirates, spy on factions, and discover hidden treasures.\n\nSpaceTraders as a game is unique in that it is entirely accessible through open and well-documented API endpoints.\n\nIf this sounds fun and interesting to you, please drop into our Discord and get to know the community. We are actively working on new clients, new ideas and sharing tips for how to play the game.\n\n\n```json http\n{\n \"method\": \"GET\",\n \"url\": \"https://v2-0-0.alpha.spacetraders.io\",\n}\n```" }, "servers": [ { - "url": "https://v2-1-0.spacetraders.io", - "description": "v2.1.0" + "url": "https://api-server-2-0-0-rc-2-vxxwq5xqdq-uc.a.run.app", + "description": "v2.0.0-rc.2" } ], "paths": { - "/agents": { + "/register": { "post": { "summary": "Register New Agent", "tags": [ @@ -39,13 +39,14 @@ "type": "object", "properties": { "token": { - "type": "string" + "type": "string", + "description": "A Bearer token for accessing secured API endpoints." }, "agent": { "$ref": "../models/Agent.yaml" }, "faction": { - "$ref": "../models/Faction.yaml" + "$ref": "../models/Faction.json" }, "contract": { "$ref": "../models/Contract.yaml" @@ -61,7 +62,7 @@ } } }, - "operationId": "post-agents", + "operationId": "post-register", "description": "Creates a new agent and ties it to a temporary Account. Use `COMMERCE_REPUBLIC` as your starting faction if you don't know any other factions to choose from.\n\nThe agent symbol is a 4-8 character string that will represent your agent. This symbol will prefix the symbol of every ship you own. Agent symbols will be cast to all uppercase characters.\n\nA new agent will be granted an authorization token, a contract with their starting faction, a command ship with a jump drive, and one hundred thousand credits.\n\n> #### Keep your token safe and secure\n>\n> Save your token during the alpha phase. There is no way to regenerate this token without starting a new agent. In the future you will be able to generate and manage your tokens from the SpaceTraders website.\n\nYou can accept your contract using the `/my/contracts/{contractId}/accept` endpoint. You will want to navigate your command ship to a nearby asteroid field waypoint, and execute the `/my/ships/{shipSymbol}/accept` endpoint to mine various types of ores and minerals.\n\nReturn to the contract destination and execute the `/my/ships/{shipSymbol}/deliver` endpoint to deposit goods into the contract.\n\nWhen your contract is fulfilled, you can call `/my/contracts/{contractId}/fulfill` to retrieve payment.", "requestBody": { "content": { @@ -133,6 +134,398 @@ "description": "Fetch your agent's details." } }, + "/my/ships": { + "get": { + "summary": "List Ships", + "tags": [ + "ships" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": [ + { + "symbol": "653298-1", + "crew": null, + "officers": null, + "frame": "FRAME_DRONE", + "reactor": "REACTOR_SOLAR_I", + "engine": "ENGINE_SOLAR_PROPULSION", + "modules": [ + "MODULE_CARGO_HOLD" + ], + "mounts": [ + "MOUNT_MINING_LASER_I" + ], + "registration": { + "factionSymbol": "COMMERCE_REPUBLIC", + "agentSymbol": "653298", + "fee": 100, + "role": "EXCAVATOR" + }, + "integrity": { + "frame": 1, + "reactor": 1, + "engine": 1 + }, + "status": "DOCKED", + "location": "X1-OE-PM", + "cargo": [] + }, + { + "symbol": "653298-2", + "crew": null, + "officers": null, + "frame": "FRAME_DRONE", + "reactor": "REACTOR_SOLAR_I", + "engine": "ENGINE_SOLAR_PROPULSION", + "modules": [ + "MODULE_CARGO_HOLD" + ], + "mounts": [ + "MOUNT_MINING_LASER_I" + ], + "registration": { + "factionSymbol": "COMMERCE_REPUBLIC", + "agentSymbol": "653298", + "fee": 100, + "role": "EXCAVATOR" + }, + "integrity": { + "frame": 1, + "reactor": 1, + "engine": 1 + }, + "status": "DOCKED", + "location": "X1-OE-PM", + "cargo": [] + }, + { + "symbol": "653298-3", + "crew": null, + "officers": null, + "frame": "FRAME_DRONE", + "reactor": "REACTOR_SOLAR_I", + "engine": "ENGINE_SOLAR_PROPULSION", + "modules": [ + "MODULE_CARGO_HOLD" + ], + "mounts": [ + "MOUNT_MINING_LASER_I" + ], + "registration": { + "factionSymbol": "COMMERCE_REPUBLIC", + "agentSymbol": "653298", + "fee": 100, + "role": "EXCAVATOR" + }, + "integrity": { + "frame": 1, + "reactor": 1, + "engine": 1 + }, + "status": "DOCKED", + "location": "X1-OE-PM", + "cargo": [] + }, + { + "symbol": "653298-4", + "crew": null, + "officers": null, + "frame": "FRAME_DRONE", + "reactor": "REACTOR_SOLAR_I", + "engine": "ENGINE_SOLAR_PROPULSION", + "modules": [ + "MODULE_CARGO_HOLD" + ], + "mounts": [ + "MOUNT_MINING_LASER_I" + ], + "registration": { + "factionSymbol": "COMMERCE_REPUBLIC", + "agentSymbol": "653298", + "fee": 100, + "role": "EXCAVATOR" + }, + "integrity": { + "frame": 1, + "reactor": 1, + "engine": 1 + }, + "status": "DOCKED", + "location": "X1-OE-PM", + "cargo": [] + }, + { + "symbol": "653298-5", + "crew": null, + "officers": null, + "frame": "FRAME_DRONE", + "reactor": "REACTOR_SOLAR_I", + "engine": "ENGINE_SOLAR_PROPULSION", + "modules": [ + "MODULE_CARGO_HOLD" + ], + "mounts": [ + "MOUNT_MINING_LASER_I" + ], + "registration": { + "factionSymbol": "COMMERCE_REPUBLIC", + "agentSymbol": "653298", + "fee": 100, + "role": "EXCAVATOR" + }, + "integrity": { + "frame": 1, + "reactor": 1, + "engine": 1 + }, + "status": "DOCKED", + "location": "X1-OE-PM", + "cargo": [] + }, + { + "symbol": "653298-6", + "crew": null, + "officers": null, + "frame": "FRAME_DRONE", + "reactor": "REACTOR_SOLAR_I", + "engine": "ENGINE_SOLAR_PROPULSION", + "modules": [ + "MODULE_CARGO_HOLD" + ], + "mounts": [ + "MOUNT_MINING_LASER_I" + ], + "registration": { + "factionSymbol": "COMMERCE_REPUBLIC", + "agentSymbol": "653298", + "fee": 100, + "role": "EXCAVATOR" + }, + "integrity": { + "frame": 1, + "reactor": 1, + "engine": 1 + }, + "status": "DOCKED", + "location": "X1-OE-PM", + "cargo": [] + } + ], + "meta": { + "total": 6, + "page": 1, + "limit": 20 + } + } + }, + "properties": { + "data": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "$ref": "../models/Ship.json" + } + }, + "meta": { + "$ref": "../models/Meta.yaml" + } + }, + "required": [ + "data", + "meta" + ] + } + } + } + } + }, + "operationId": "get-my-ships", + "description": "Retrieve all of your ships.", + "security": [ + { + "AgentToken": [] + } + ] + }, + "post": { + "summary": "Purchase Ship", + "tags": [ + "shipyards" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": { + "symbol": "4F4D44-1", + "crew": null, + "officers": null, + "fuel": 100, + "frame": "FRAME_DRONE", + "reactor": "REACTOR_SOLAR_I", + "engine": "ENGINE_SOLAR_PROPULSION", + "modules": [ + "MODULE_CARGO_HOLD" + ], + "mounts": [ + "MOUNT_MINING_LASER_I" + ], + "registration": { + "factionSymbol": "COMMERCE_REPUBLIC", + "agentSymbol": "4F4D44", + "fee": 100, + "role": "EXCAVATOR" + }, + "integrity": { + "frame": 1, + "reactor": 1, + "engine": 1 + }, + "status": "DOCKED", + "location": "X1-OE-PM", + "cargo": [] + } + } + }, + "properties": { + "data": { + "type": "object", + "properties": { + "ship": { + "$ref": "../models/Ship.json" + }, + "credits": { + "type": "integer" + } + } + } + }, + "required": [ + "data" + ] + } + } + } + } + }, + "operationId": "post-my-ships", + "security": [ + { + "AgentToken": [] + } + ], + "description": "Purchase a ship", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The id of the shipyard listing you want to purchase." + } + } + } + } + } + } + } + }, + "/my/ships/{shipSymbol}": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true + } + ], + "get": { + "summary": "View Ship", + "tags": [ + "ships" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": { + "symbol": "653298-1", + "crew": null, + "officers": null, + "frame": "FRAME_DRONE", + "reactor": "REACTOR_SOLAR_I", + "engine": "ENGINE_SOLAR_PROPULSION", + "modules": [ + "MODULE_CARGO_HOLD" + ], + "mounts": [ + "MOUNT_MINING_LASER_I" + ], + "registration": { + "factionSymbol": "COMMERCE_REPUBLIC", + "agentSymbol": "653298", + "fee": 100, + "role": "EXCAVATOR" + }, + "integrity": { + "frame": 1, + "reactor": 1, + "engine": 1 + }, + "status": "DOCKED", + "location": "X1-OE-PM", + "cargo": [] + } + } + }, + "properties": { + "data": { + "$ref": "../models/Ship.json" + } + }, + "required": [ + "data" + ] + } + } + } + } + }, + "operationId": "get-my-ships-shipSymbol", + "description": "Retrieve the details of your ship.", + "security": [ + { + "AgentToken": [] + } + ] + } + }, "/my/ships/{shipSymbol}/chart": { "post": { "summary": "Chart Waypoint", @@ -277,246 +670,6 @@ "description": "Deliver cargo on a given contract." } }, - "/my/ships/{shipSymbol}/nav/transit": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true, - "description": "The ship symbol" - } - ], - "post": { - "summary": "Navigate Ship", - "tags": [ - "navigation" - ], - "responses": { - "201": { - "description": "The successful transit information including the route details and changes to ship fuel, supplies, and crew wages paid. The route includes the expected time of arrival.", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": { - "shipSymbol": "3AE434-1", - "departure": "X1-OE-PM", - "destination": "X1-OE-A005", - "durationRemaining": 2159, - "arrivedAt": null - } - } - }, - "properties": { - "data": { - "type": "object", - "properties": { - "route": { - "$ref": "../models/ShipNavRoute.json" - }, - "shipFuel": { - "$ref": "../models/ShipFuel.json" - } - } - } - }, - "required": [ - "data" - ] - }, - "examples": { - "Success": { - "value": { - "data": { - "fuelCost": 38, - "navigation": { - "shipSymbol": "BA03F2-1", - "departure": "X1-OE-PM", - "destination": "X1-OE-A005", - "durationRemaining": 2279, - "arrivedAt": null - } - } - } - } - } - } - } - } - }, - "operationId": "post-my-ships-shipSymbol-navigate", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "waypointSymbol": { - "type": "string", - "description": "The target destination." - } - }, - "required": [ - "waypointSymbol" - ] - } - } - }, - "description": "" - }, - "security": [ - { - "AgentToken": [] - } - ], - "description": "Navigate to a target destination. The destination must be located within the same system as the ship. Navigating will consume the necessary fuel and supplies from the ship's manifest, and will pay out crew wages from the agent's account.\n\nThe returned response will detail the route information including the expected time of arrival. Most ship actions are unavailable until the ship has arrived at it's destination.\n\nFor faster-than-light travel between systems, see the ship's jump action." - } - }, - "/my/ships/{shipSymbol}/nav/dock": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true, - "description": "The symbol of the ship" - } - ], - "post": { - "summary": "Dock Ship", - "tags": [ - "navigation" - ], - "responses": { - "200": { - "description": "The ship has successfully docked at it's current location.", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": { - "status": "DOCKED" - } - } - }, - "properties": { - "data": { - "type": "object", - "required": [ - "status" - ], - "properties": { - "status": { - "$ref": "../models/ShipNavStatus.json" - } - } - } - }, - "required": [ - "data" - ] - }, - "examples": { - "Success": { - "value": { - "data": { - "status": "DOCKED" - } - } - } - } - } - } - } - }, - "operationId": "post-my-ships-shipSymbol-dock", - "security": [ - { - "AgentToken": [] - } - ], - "description": "Attempt to dock your ship at it's current location. Docking will only succeed if the waypoint is a dockable location, and your ship is capable of docking at the time of the request.\n\nThe endpoint is idempotent - successive calls will succeed even if the ship is already docked." - } - }, - "/my/ships/{shipSymbol}/nav/orbit": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true, - "description": "The symbol of the ship" - } - ], - "post": { - "summary": "Orbit Ship", - "responses": { - "200": { - "description": "The ship has successfully moved into orbit at it's current location.", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": { - "status": "ORBIT" - } - } - }, - "properties": { - "data": { - "type": "object", - "properties": { - "status": { - "$ref": "../models/ShipNavStatus.json" - } - } - } - }, - "required": [ - "data" - ] - }, - "examples": { - "Success": { - "value": { - "data": { - "status": "IN_ORBIT" - } - } - } - } - } - } - } - }, - "operationId": "post-my-ships-shipSymbol-orbit", - "security": [ - { - "AgentToken": [] - } - ], - "description": "Attempt to move your ship into orbit at it's current location. The request will only succeed if your ship is capable of moving into orbit at the time of the request.\n\nThe endpoint is idempotent - successive calls will succeed even if the ship is already in orbit.", - "tags": [ - "navigation" - ] - } - }, "/my/ships/{shipSymbol}/jettison": { "parameters": [ { @@ -1683,7 +1836,7 @@ "$ref": "../models/Cooldown.yaml" }, "waypoint": { - "$ref": "../models/Waypoint.yaml" + "$ref": "../models/Waypoint.json" } } } @@ -1790,7 +1943,7 @@ ] } }, - "/my/ships/{shipSymbol}": { + "/my/ships/{shipSymbol}/navigate": { "parameters": [ { "schema": { @@ -1798,57 +1951,34 @@ }, "name": "shipSymbol", "in": "path", - "required": true + "required": true, + "description": "The ship symbol" } ], - "get": { - "summary": "View Ship", + "post": { + "summary": "Navigate Ship", "tags": [ - "ships" + "navigation" ], "responses": { - "200": { - "description": "OK", + "201": { + "description": "The successful transit information including the route details and changes to ship fuel, supplies, and crew wages paid. The route includes the expected time of arrival.", "content": { "application/json": { "schema": { "description": "", "type": "object", - "x-examples": { - "example-1": { - "data": { - "symbol": "653298-1", - "crew": null, - "officers": null, - "frame": "FRAME_DRONE", - "reactor": "REACTOR_SOLAR_I", - "engine": "ENGINE_SOLAR_PROPULSION", - "modules": [ - "MODULE_CARGO_HOLD" - ], - "mounts": [ - "MOUNT_MINING_LASER_I" - ], - "registration": { - "factionSymbol": "COMMERCE_REPUBLIC", - "agentSymbol": "653298", - "fee": 100, - "role": "EXCAVATOR" - }, - "integrity": { - "frame": 1, - "reactor": 1, - "engine": 1 - }, - "status": "DOCKED", - "location": "X1-OE-PM", - "cargo": [] - } - } - }, "properties": { "data": { - "$ref": "../models/Ship.json" + "type": "object", + "properties": { + "route": { + "$ref": "../models/ShipNav.json" + }, + "shipFuel": { + "$ref": "../models/ShipFuel.json" + } + } } }, "required": [ @@ -1859,246 +1989,54 @@ } } }, - "operationId": "get-my-ships-shipSymbol", - "description": "Retrieve the details of your ship.", - "security": [ - { - "AgentToken": [] - } - ] - } - }, - "/my/ships": { - "get": { - "summary": "List Ships", - "tags": [ - "ships" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": [ - { - "symbol": "653298-1", - "crew": null, - "officers": null, - "frame": "FRAME_DRONE", - "reactor": "REACTOR_SOLAR_I", - "engine": "ENGINE_SOLAR_PROPULSION", - "modules": [ - "MODULE_CARGO_HOLD" - ], - "mounts": [ - "MOUNT_MINING_LASER_I" - ], - "registration": { - "factionSymbol": "COMMERCE_REPUBLIC", - "agentSymbol": "653298", - "fee": 100, - "role": "EXCAVATOR" - }, - "integrity": { - "frame": 1, - "reactor": 1, - "engine": 1 - }, - "status": "DOCKED", - "location": "X1-OE-PM", - "cargo": [] - }, - { - "symbol": "653298-2", - "crew": null, - "officers": null, - "frame": "FRAME_DRONE", - "reactor": "REACTOR_SOLAR_I", - "engine": "ENGINE_SOLAR_PROPULSION", - "modules": [ - "MODULE_CARGO_HOLD" - ], - "mounts": [ - "MOUNT_MINING_LASER_I" - ], - "registration": { - "factionSymbol": "COMMERCE_REPUBLIC", - "agentSymbol": "653298", - "fee": 100, - "role": "EXCAVATOR" - }, - "integrity": { - "frame": 1, - "reactor": 1, - "engine": 1 - }, - "status": "DOCKED", - "location": "X1-OE-PM", - "cargo": [] - }, - { - "symbol": "653298-3", - "crew": null, - "officers": null, - "frame": "FRAME_DRONE", - "reactor": "REACTOR_SOLAR_I", - "engine": "ENGINE_SOLAR_PROPULSION", - "modules": [ - "MODULE_CARGO_HOLD" - ], - "mounts": [ - "MOUNT_MINING_LASER_I" - ], - "registration": { - "factionSymbol": "COMMERCE_REPUBLIC", - "agentSymbol": "653298", - "fee": 100, - "role": "EXCAVATOR" - }, - "integrity": { - "frame": 1, - "reactor": 1, - "engine": 1 - }, - "status": "DOCKED", - "location": "X1-OE-PM", - "cargo": [] - }, - { - "symbol": "653298-4", - "crew": null, - "officers": null, - "frame": "FRAME_DRONE", - "reactor": "REACTOR_SOLAR_I", - "engine": "ENGINE_SOLAR_PROPULSION", - "modules": [ - "MODULE_CARGO_HOLD" - ], - "mounts": [ - "MOUNT_MINING_LASER_I" - ], - "registration": { - "factionSymbol": "COMMERCE_REPUBLIC", - "agentSymbol": "653298", - "fee": 100, - "role": "EXCAVATOR" - }, - "integrity": { - "frame": 1, - "reactor": 1, - "engine": 1 - }, - "status": "DOCKED", - "location": "X1-OE-PM", - "cargo": [] - }, - { - "symbol": "653298-5", - "crew": null, - "officers": null, - "frame": "FRAME_DRONE", - "reactor": "REACTOR_SOLAR_I", - "engine": "ENGINE_SOLAR_PROPULSION", - "modules": [ - "MODULE_CARGO_HOLD" - ], - "mounts": [ - "MOUNT_MINING_LASER_I" - ], - "registration": { - "factionSymbol": "COMMERCE_REPUBLIC", - "agentSymbol": "653298", - "fee": 100, - "role": "EXCAVATOR" - }, - "integrity": { - "frame": 1, - "reactor": 1, - "engine": 1 - }, - "status": "DOCKED", - "location": "X1-OE-PM", - "cargo": [] - }, - { - "symbol": "653298-6", - "crew": null, - "officers": null, - "frame": "FRAME_DRONE", - "reactor": "REACTOR_SOLAR_I", - "engine": "ENGINE_SOLAR_PROPULSION", - "modules": [ - "MODULE_CARGO_HOLD" - ], - "mounts": [ - "MOUNT_MINING_LASER_I" - ], - "registration": { - "factionSymbol": "COMMERCE_REPUBLIC", - "agentSymbol": "653298", - "fee": 100, - "role": "EXCAVATOR" - }, - "integrity": { - "frame": 1, - "reactor": 1, - "engine": 1 - }, - "status": "DOCKED", - "location": "X1-OE-PM", - "cargo": [] - } - ], - "meta": { - "total": 6, - "page": 1, - "limit": 20 - } - } - }, - "properties": { - "data": { - "type": "array", - "uniqueItems": true, - "minItems": 1, - "items": { - "$ref": "../models/Ship.json" - } - }, - "meta": { - "$ref": "../models/Meta.yaml" - } - }, - "required": [ - "data", - "meta" - ] - } + "operationId": "post-my-ships-shipSymbol-navigate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "waypointSymbol": { + "type": "string", + "description": "The target destination." + } + }, + "required": [ + "waypointSymbol" + ] } } - } + }, + "description": "" }, - "operationId": "get-my-ships", - "description": "Retrieve all of your ships.", "security": [ { "AgentToken": [] } - ] - }, + ], + "description": "Navigate to a target destination. The destination must be located within the same system as the ship. Navigating will consume the necessary fuel and supplies from the ship's manifest, and will pay out crew wages from the agent's account.\n\nThe returned response will detail the route information including the expected time of arrival. Most ship actions are unavailable until the ship has arrived at it's destination.\n\nFor faster-than-light travel between systems, see the ship's jump action." + } + }, + "/my/ships/{shipSymbol}/dock": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true, + "description": "The symbol of the ship" + } + ], "post": { - "summary": "Purchase Ship", + "summary": "Dock Ship", "tags": [ - "shipyards" + "navigation" ], "responses": { "200": { - "description": "OK", + "description": "The ship has successfully docked at it's current location.", "content": { "application/json": { "schema": { @@ -2107,33 +2045,75 @@ "x-examples": { "example-1": { "data": { - "symbol": "4F4D44-1", - "crew": null, - "officers": null, - "fuel": 100, - "frame": "FRAME_DRONE", - "reactor": "REACTOR_SOLAR_I", - "engine": "ENGINE_SOLAR_PROPULSION", - "modules": [ - "MODULE_CARGO_HOLD" - ], - "mounts": [ - "MOUNT_MINING_LASER_I" - ], - "registration": { - "factionSymbol": "COMMERCE_REPUBLIC", - "agentSymbol": "4F4D44", - "fee": 100, - "role": "EXCAVATOR" - }, - "integrity": { - "frame": 1, - "reactor": 1, - "engine": 1 - }, - "status": "DOCKED", - "location": "X1-OE-PM", - "cargo": [] + "status": "DOCKED" + } + } + }, + "properties": { + "data": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "$ref": "../models/ShipNavStatus.json" + } + } + } + }, + "required": [ + "data" + ] + }, + "examples": { + "Success": { + "value": { + "data": { + "status": "DOCKED" + } + } + } + } + } + } + } + }, + "operationId": "post-my-ships-shipSymbol-dock", + "security": [ + { + "AgentToken": [] + } + ], + "description": "Attempt to dock your ship at it's current location. Docking will only succeed if the waypoint is a dockable location, and your ship is capable of docking at the time of the request.\n\nThe endpoint is idempotent - successive calls will succeed even if the ship is already docked." + } + }, + "/my/ships/{shipSymbol}/orbit": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true, + "description": "The symbol of the ship" + } + ], + "post": { + "summary": "Orbit Ship", + "responses": { + "200": { + "description": "The ship has successfully moved into orbit at it's current location.", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": { + "status": "ORBIT" } } }, @@ -2141,11 +2121,8 @@ "data": { "type": "object", "properties": { - "ship": { - "$ref": "../models/Ship.json" - }, - "credits": { - "type": "integer" + "status": { + "$ref": "../models/ShipNavStatus.json" } } } @@ -2153,33 +2130,56 @@ "required": [ "data" ] - } - } - } - } - }, - "operationId": "post-my-ships", - "security": [ - { - "AgentToken": [] - } - ], - "description": "Purchase a ship", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The id of the shipyard listing you want to purchase." + }, + "examples": { + "Success": { + "value": { + "data": { + "status": "IN_ORBIT" + } + } } } } } } + }, + "operationId": "post-my-ships-shipSymbol-orbit", + "security": [ + { + "AgentToken": [] + } + ], + "description": "Attempt to move your ship into orbit at it's current location. The request will only succeed if your ship is capable of moving into orbit at the time of the request.\n\nThe endpoint is idempotent - successive calls will succeed even if the ship is already in orbit.", + "tags": [ + "navigation" + ] + } + }, + "/my/ships/{shipSymbol}/negotiate": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true, + "description": "The symbol of the ship" } + ], + "post": { + "summary": "Negotiate with a waypoint", + "operationId": "post-my-ships-negotiate", + "security": [ + { + "AgentToken": [] + } + ], + "description": "Attempt to negotiate with the faction at a waypoint. The request will only succeed if the waypoint is a negotiable location, and your ship is capable of negotiating using an envoy.", + "tags": [ + "ships" + ] } }, "/my/contracts": { @@ -2648,625 +2648,6 @@ ] } }, - "/systems/{systemSymbol}/shipyards": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "systemSymbol", - "in": "path", - "required": true, - "description": "the system symbol" - } - ], - "get": { - "summary": "List Shipyards", - "tags": [ - "shipyards" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": [ - { - "symbol": "X1-OE-PM", - "faction": "COMMERCE_REPUBLIC" - } - ], - "meta": { - "total": 1, - "page": 1, - "limit": 20 - } - } - }, - "properties": { - "data": { - "type": "array", - "uniqueItems": true, - "minItems": 1, - "items": { - "$ref": "../models/Shipyard.yaml" - } - }, - "meta": { - "$ref": "../models/Meta.yaml" - } - }, - "required": [ - "data", - "meta" - ] - } - } - } - } - }, - "operationId": "get-systems-systemSymbol-shipyards", - "security": [ - { - "AgentToken": [] - } - ], - "description": "Returns a list of all shipyards in a system." - } - }, - "/systems/{systemSymbol}/shipyards/{waypointSymbol}": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "systemSymbol", - "in": "path", - "required": true, - "description": "The system symbol" - }, - { - "schema": { - "type": "string" - }, - "name": "waypointSymbol", - "in": "path", - "required": true, - "description": "The waypoint symbol" - } - ], - "get": { - "summary": "Shipyard Details", - "tags": [ - "shipyards" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "../models/Shipyard.yaml" - } - } - } - } - } - } - }, - "operationId": "get-systems-systemSymbol-shipyards-waypointSymbol", - "security": [ - { - "AgentToken": [] - } - ] - } - }, - "/systems/{systemSymbol}/shipyards/{waypointSymbol}/ships": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "systemSymbol", - "in": "path", - "required": true, - "description": "The system symbol" - }, - { - "schema": { - "type": "string" - }, - "name": "waypointSymbol", - "in": "path", - "required": true, - "description": "The waypoint symbol" - } - ], - "get": { - "summary": "Shipyard Listings", - "tags": [ - "shipyards" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": [ - { - "id": "cl0nahta90000aq0jonm1nprl", - "waypoint": "X1-OE-PM", - "price": 58191, - "role": "EXCAVATOR", - "frame": "FRAME_DRONE", - "reactor": "REACTOR_SOLAR_I", - "engine": "ENGINE_SOLAR_PROPULSION", - "modules": [ - "MODULE_CARGO_HOLD" - ], - "mounts": [ - "MOUNT_MINING_LASER_I" - ] - } - ], - "meta": { - "total": 1, - "page": 1, - "limit": 20 - } - } - }, - "properties": { - "data": { - "type": "array", - "uniqueItems": true, - "minItems": 1, - "items": { - "$ref": "../models/ShipyardListing.yaml" - } - }, - "meta": { - "$ref": "../models/Meta.yaml" - } - }, - "required": [ - "data", - "meta" - ] - }, - "examples": {} - } - } - } - }, - "operationId": "get-systems-systemSymbol-shipyards-waypointSymbol-ships", - "security": [ - { - "AgentToken": [] - } - ] - } - }, - "/trade/{tradeSymbol}/imports": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "tradeSymbol", - "in": "path", - "required": true, - "description": "The trade symbol" - } - ], - "get": { - "summary": "Trade Imports", - "tags": [ - "markets" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "properties": { - "data": { - "type": "array", - "uniqueItems": true, - "minItems": 1, - "items": { - "$ref": "../models/MarketTrade.yaml" - } - }, - "meta": { - "$ref": "../models/Meta.yaml" - } - }, - "required": [ - "data", - "meta" - ] - }, - "examples": {} - } - } - } - }, - "operationId": "get-trade-tradeSymbol-imports", - "security": [ - { - "AgentToken": [] - } - ] - } - }, - "/trade/{tradeSymbol}/exports": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "tradeSymbol", - "in": "path", - "required": true, - "description": "The trade symbol" - } - ], - "get": { - "summary": "Trade Exports", - "tags": [ - "markets" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "properties": { - "data": { - "type": "array", - "uniqueItems": true, - "minItems": 1, - "items": { - "$ref": "../models/MarketTrade.yaml" - } - }, - "meta": { - "$ref": "../models/Meta.yaml" - } - }, - "required": [ - "data", - "meta" - ] - }, - "examples": {} - } - } - } - }, - "operationId": "get-trade-tradeSymbol-exports", - "security": [ - { - "AgentToken": [] - } - ] - } - }, - "/trade/{tradeSymbol}/exchange": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "tradeSymbol", - "in": "path", - "required": true, - "description": "The trade symbol" - } - ], - "get": { - "summary": "Trade Exchanges", - "tags": [ - "markets" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "properties": { - "data": { - "type": "array", - "uniqueItems": true, - "minItems": 1, - "items": { - "$ref": "../models/MarketTrade.yaml" - } - }, - "meta": { - "$ref": "../models/Meta.yaml" - } - }, - "required": [ - "data", - "meta" - ] - }, - "examples": {} - } - } - } - }, - "operationId": "get-trade-tradeSymbol-exchange", - "security": [ - { - "AgentToken": [] - } - ] - } - }, - "/systems/{systemSymbol}/markets": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "systemSymbol", - "in": "path", - "required": true, - "description": "The system symbol" - } - ], - "get": { - "summary": "List Markets", - "tags": [ - "markets" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": { - "exports": [ - { - "waypointSymbol": "X1-OE-PM", - "tradeSymbol": "MICROPROCESSORS", - "price": 834, - "tariff": 0 - } - ], - "imports": [ - { - "waypointSymbol": "X1-OE-PM", - "tradeSymbol": "SILICON", - "price": 144, - "tariff": 0 - }, - { - "waypointSymbol": "X1-OE-PM", - "tradeSymbol": "QUARTZ", - "price": 286, - "tariff": 0 - } - ], - "exchange": [] - } - } - }, - "properties": { - "data": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "data" - ] - }, - "examples": { - "Success": { - "value": { - "data": [ - "X1-AK3-88760F" - ], - "meta": { - "total": 1, - "page": 1, - "limit": 20 - } - } - } - } - } - } - } - }, - "operationId": "get-systems-systemSymbol-markets", - "description": "Retrieve a list of all charted markets in the given system. Markets are only available if the waypoint is charted and contains a communications relay.\n\nTo install a communications relay at a market, look at the `my/ships/{shipSymbol}/deploy` endpoint.", - "security": [ - { - "AgentToken": [] - } - ] - } - }, - "/systems/{systemSymbol}/markets/{waypointSymbol}": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "systemSymbol", - "in": "path", - "required": true, - "description": "The system symbol" - }, - { - "schema": { - "type": "string" - }, - "name": "waypointSymbol", - "in": "path", - "required": true, - "description": "The waypoint symbol" - } - ], - "get": { - "summary": "View Market", - "tags": [ - "markets" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": { - "exports": [ - { - "waypointSymbol": "X1-OE-PM", - "tradeSymbol": "MICROPROCESSORS", - "price": 834, - "tariff": 0 - } - ], - "imports": [ - { - "waypointSymbol": "X1-OE-PM", - "tradeSymbol": "SILICON", - "price": 144, - "tariff": 0 - }, - { - "waypointSymbol": "X1-OE-PM", - "tradeSymbol": "QUARTZ", - "price": 286, - "tariff": 0 - } - ], - "exchange": [] - } - } - }, - "properties": { - "data": { - "type": "object", - "required": [ - "exports", - "imports", - "exchange" - ], - "properties": { - "exports": { - "type": "array", - "uniqueItems": true, - "minItems": 1, - "items": { - "$ref": "../models/MarketTrade.yaml" - } - }, - "imports": { - "type": "array", - "uniqueItems": true, - "minItems": 1, - "items": { - "$ref": "../models/MarketTrade.yaml" - } - }, - "exchange": { - "type": "array", - "items": { - "$ref": "../models/MarketTrade.yaml" - } - } - } - } - }, - "required": [ - "data" - ] - }, - "examples": { - "Success": { - "value": { - "data": { - "exports": [ - { - "waypointSymbol": "X1-OE-PM", - "tradeSymbol": "MICROPROCESSORS", - "price": 834, - "tariff": 0 - } - ], - "imports": [ - { - "waypointSymbol": "X1-OE-PM", - "tradeSymbol": "SILICON", - "price": 144, - "tariff": 0 - }, - { - "waypointSymbol": "X1-OE-PM", - "tradeSymbol": "QUARTZ", - "price": 286, - "tariff": 0 - } - ], - "exchange": [] - } - } - } - } - } - } - } - }, - "operationId": "get-systems-systemSymbol-markets-waypointSymbol", - "description": "Retrieve imports, exports and exchange data from a marketplace. Imports can be sold, exports can be purchased, and exchange trades can be purchased or sold.\n\nMarket data is only available if you have a ship at the location, or the location is charted and has a communications relay deployed.\n\nSee `/my/ships/{shipSymbol}/deploy` for deploying relays at a location.", - "security": [ - { - "AgentToken": [] - } - ] - } - }, "/systems/{systemSymbol}/waypoints": { "parameters": [ { @@ -3378,7 +2759,7 @@ "uniqueItems": true, "minItems": 1, "items": { - "$ref": "../models/Waypoint.yaml" + "$ref": "../models/Waypoint.json" } }, "meta": { @@ -3389,88 +2770,6 @@ "data", "meta" ] - }, - "examples": { - "Success": { - "value": { - "data": [ - { - "system": "X1-OE", - "symbol": "X1-OE-PM", - "type": "PLANET", - "x": 10, - "y": 5, - "orbitals": [ - "X1-OE-PM01" - ], - "faction": "COMMERCE_REPUBLIC", - "features": [ - "MARKETPLACE", - "SHIPYARD" - ], - "traits": [ - "OVERCROWDED", - "HIGH_TECH", - "BUREAUCRATIC", - "TRADING_HUB", - "TEMPERATE" - ], - "charted": true, - "chartedBy": null - }, - { - "system": "X1-OE", - "symbol": "X1-OE-PM01", - "type": "MOON", - "x": 10, - "y": 5, - "orbitals": [], - "faction": "COMMERCE_REPUBLIC", - "features": [ - "MARKETPLACE" - ], - "traits": [ - "WEAK_GRAVITY" - ], - "charted": true, - "chartedBy": null - }, - { - "system": "X1-OE", - "symbol": "X1-OE-A005", - "type": "ASTEROID_FIELD", - "x": -1, - "y": -29, - "orbitals": [], - "faction": "MINERS_COLLECTIVE", - "features": [], - "traits": [ - "COMMON_METAL_DEPOSITS" - ], - "charted": true, - "chartedBy": null - }, - { - "system": "X1-OE", - "symbol": "X1-OE-25X", - "type": "JUMP_GATE", - "x": -38, - "y": 47, - "orbitals": [], - "faction": "SPACERS_GUILD", - "features": [], - "traits": [], - "charted": true, - "chartedBy": null - } - ], - "meta": { - "total": 4, - "page": 1, - "limit": 20 - } - } - } } } } @@ -3605,7 +2904,7 @@ "uniqueItems": true, "minItems": 1, "items": { - "$ref": "../models/Waypoint.yaml" + "$ref": "../models/Waypoint.json" } }, "meta": { @@ -3616,88 +2915,6 @@ "data", "meta" ] - }, - "examples": { - "Success": { - "value": { - "data": [ - { - "system": "X1-OE", - "symbol": "X1-OE-PM", - "type": "PLANET", - "x": 10, - "y": 5, - "orbitals": [ - "X1-OE-PM01" - ], - "faction": "COMMERCE_REPUBLIC", - "features": [ - "MARKETPLACE", - "SHIPYARD" - ], - "traits": [ - "OVERCROWDED", - "HIGH_TECH", - "BUREAUCRATIC", - "TRADING_HUB", - "TEMPERATE" - ], - "charted": true, - "chartedBy": null - }, - { - "system": "X1-OE", - "symbol": "X1-OE-PM01", - "type": "MOON", - "x": 10, - "y": 5, - "orbitals": [], - "faction": "COMMERCE_REPUBLIC", - "features": [ - "MARKETPLACE" - ], - "traits": [ - "WEAK_GRAVITY" - ], - "charted": true, - "chartedBy": null - }, - { - "system": "X1-OE", - "symbol": "X1-OE-A005", - "type": "ASTEROID_FIELD", - "x": -1, - "y": -29, - "orbitals": [], - "faction": "MINERS_COLLECTIVE", - "features": [], - "traits": [ - "COMMON_METAL_DEPOSITS" - ], - "charted": true, - "chartedBy": null - }, - { - "system": "X1-OE", - "symbol": "X1-OE-25X", - "type": "JUMP_GATE", - "x": -38, - "y": 47, - "orbitals": [], - "faction": "SPACERS_GUILD", - "features": [], - "traits": [], - "charted": true, - "chartedBy": null - } - ], - "meta": { - "total": 4, - "page": 1, - "limit": 20 - } - } - } } } } @@ -3711,9 +2928,165 @@ ], "description": "View the details of a waypoint." } + }, + "/systems/{systemSymbol}/waypoints/{waypointSymbol}/shipyard": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "systemSymbol", + "in": "path", + "required": true, + "description": "The system symbol" + }, + { + "schema": { + "type": "string" + }, + "name": "waypointSymbol", + "in": "path", + "required": true, + "description": "The waypoint symbol" + } + ], + "get": { + "summary": "Get Shipyard", + "tags": [ + "shipyards" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "properties": { + "data": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "$ref": "../models/Shipyard.json" + } + }, + "meta": { + "$ref": "../models/Meta.yaml" + } + }, + "required": [ + "data", + "meta" + ] + }, + "examples": {} + } + } + } + }, + "operationId": "get-systems-systemSymbol-shipyards-waypointSymbol-ships", + "security": [ + { + "AgentToken": [] + } + ] + } + }, + "/systems/{systemSymbol}/waypoints/{waypointSymbol}/market": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "systemSymbol", + "in": "path", + "required": true, + "description": "The system symbol" + }, + { + "schema": { + "type": "string" + }, + "name": "waypointSymbol", + "in": "path", + "required": true, + "description": "The waypoint symbol" + } + ], + "get": { + "summary": "View Market", + "tags": [ + "markets" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "properties": { + "data": { + "$ref": "../models/Market.json" + } + }, + "required": [ + "data" + ] + } + } + } + } + }, + "operationId": "get-system-waypoint-market", + "description": "Retrieve imports, exports and exchange data from a marketplace. Imports can be sold, exports can be purchased, and exchange trades can be purchased or sold.\n\nMarket data is only available if you have a ship at the location, or the location is charted and has a communications relay deployed.\n\nSee `/my/ships/{shipSymbol}/deploy` for deploying relays at a location.", + "security": [ + { + "AgentToken": [] + } + ] + } + }, + "/factions": { + "get": { + "summary": "List Factions", + "description": "List all discovered factions in the game.", + "tags": [ + "factions" + ], + "operationId": "get-factions" + } + }, + "/factions/{factionSymbol}": { + "parameters": [ + { + "schema": { + "type": "string", + "default": "CGR" + }, + "name": "factionSymbol", + "in": "path", + "required": true, + "description": "The faction symbol" + } + ], + "get": { + "summary": "View Faction", + "tags": [ + "factions" + ], + "operationId": "get-factions-factionSymbol", + "description": "View the details of a faction." + } } }, "tags": [ + { + "name": "factions" + }, { "name": "ships" }, @@ -3779,9 +3152,6 @@ }, { "name": "shipyards" - }, - { - "name": "markets" } ], "components": { From 182986fa1eb1183b160a1202007078499cc076ae Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Wed, 5 Oct 2022 17:43:28 -0700 Subject: [PATCH 05/48] fix URL in description --- reference/SpaceTraders.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 34a97ac..04482a9 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -12,7 +12,7 @@ "name": "No Permission", "url": "https://choosealicense.com/no-permission/" }, - "description": "SpaceTraders is a multiplayer sci-fi strategy game where you acquire and manage a fleet of ships across a growing and dynamic universe.\n\nSimilar to games such as Eve Online, you work with or against other players to establish trade routes, chart new systems, mine precious ores, patrol for pirates, spy on factions, and discover hidden treasures.\n\nSpaceTraders as a game is unique in that it is entirely accessible through open and well-documented API endpoints.\n\nIf this sounds fun and interesting to you, please drop into our Discord and get to know the community. We are actively working on new clients, new ideas and sharing tips for how to play the game.\n\n\n```json http\n{\n \"method\": \"GET\",\n \"url\": \"https://v2-0-0.alpha.spacetraders.io\",\n}\n```" + "description": "SpaceTraders is a multiplayer sci-fi strategy game where you acquire and manage a fleet of ships across a growing and dynamic universe.\n\nSimilar to games such as Eve Online, you work with or against other players to establish trade routes, chart new systems, mine precious ores, patrol for pirates, spy on factions, and discover hidden treasures.\n\nSpaceTraders as a game is unique in that it is entirely accessible through open and well-documented API endpoints.\n\nIf this sounds fun and interesting to you, please drop into our Discord and get to know the community. We are actively working on new clients, new ideas and sharing tips for how to play the game.\n\n\n```json http\n{\n \"method\": \"GET\",\n \"url\": \"https://api-server-2-0-0-rc-2-vxxwq5xqdq-uc.a.run.app\",\n}\n```" }, "servers": [ { From 97853a9dbe451d46865828e8a00c9e953240a7d7 Mon Sep 17 00:00:00 2001 From: Joel Brubaker Date: Thu, 6 Oct 2022 09:03:53 -0700 Subject: [PATCH 06/48] fix: contract deliver endpoint --- reference/SpaceTraders.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 04482a9..85969c7 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -589,16 +589,16 @@ } ] }, - "/my/ships/{shipSymbol}/deliver": { + "/my/contracts/{contractId}/deliver": { "parameters": [ { "schema": { "type": "string" }, - "name": "shipSymbol", + "name": "contractId", "in": "path", "required": true, - "description": "The symbol of the ship" + "description": "The ID of the contract" } ], "post": { From 969fa5da188d76ae4df3d757445a9f1427b1e378 Mon Sep 17 00:00:00 2001 From: Joel Brubaker Date: Sat, 15 Oct 2022 21:34:08 -0700 Subject: [PATCH 07/48] change to 3.0.0 for generator support --- models/Agent.yaml | 7 +- models/Contract.yaml | 23 +---- models/ContractDelivery.yaml | 8 +- models/Cooldown.yaml | 18 ---- models/Extraction.yaml | 7 +- models/Faction.json | 14 --- models/Meta.yaml | 6 +- models/Ship.json | 6 +- models/ShipCargoItem.json | 14 +-- models/ShipRegistration.json | 12 +-- models/Survey.yaml | 5 -- models/System.yaml | 29 ++----- models/Trade.yaml | 7 +- reference/SpaceTraders.json | 163 ++++++++--------------------------- 14 files changed, 52 insertions(+), 267 deletions(-) delete mode 100644 models/Cooldown.yaml diff --git a/models/Agent.yaml b/models/Agent.yaml index 29839da..a628421 100644 --- a/models/Agent.yaml +++ b/models/Agent.yaml @@ -1,4 +1,4 @@ -description: "" +description: '' type: object x-examples: example-1: @@ -23,8 +23,3 @@ required: - symbol - headquarters - credits -examples: - - accountId: cl0hok34m0003ks0jjql5q8f2 - symbol: EMBER - headquarters: X1-OE-PM - credits: 0 diff --git a/models/Contract.yaml b/models/Contract.yaml index 90a8114..fcea507 100644 --- a/models/Contract.yaml +++ b/models/Contract.yaml @@ -1,4 +1,4 @@ -description: "" +description: '' type: object properties: id: @@ -72,7 +72,7 @@ x-examples: faction: COMMERCE_REPUBLIC type: PROCUREMENT terms: - deadline: "2022-03-11T05:16:59.113Z" + deadline: '2022-03-11T05:16:59.113Z' payment: onAccepted: 20000 onFulfilled: 100000 @@ -83,21 +83,4 @@ x-examples: fulfilled: 0 accepted: false fulfilled: false - expiresAt: "2022-03-09T05:16:59.112Z" -examples: - - 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" + expiresAt: '2022-03-09T05:16:59.112Z' diff --git a/models/ContractDelivery.yaml b/models/ContractDelivery.yaml index 8d3e18b..eab93e9 100644 --- a/models/ContractDelivery.yaml +++ b/models/ContractDelivery.yaml @@ -1,4 +1,4 @@ -description: "" +description: '' type: object properties: data: @@ -28,9 +28,3 @@ x-examples: destination: X1-OE-PM units: 10000 fulfilled: 500 -examples: - - data: - tradeSymbol: IRON_ORE - destination: X1-OE-PM - units: 10000 - fulfilled: 500 diff --git a/models/Cooldown.yaml b/models/Cooldown.yaml deleted file mode 100644 index 85f7efc..0000000 --- a/models/Cooldown.yaml +++ /dev/null @@ -1,18 +0,0 @@ -description: "" -type: object -properties: - duration: - type: integer - expiration: - type: string - minLength: 1 -required: - - duration - - expiration -x-examples: - example-1: - duration: 119 - expiration: "2022-03-12T00:41:29.285Z" -examples: - - duration: 119 - expiration: "2022-03-12T00:41:29.285Z" diff --git a/models/Extraction.yaml b/models/Extraction.yaml index 3b415b5..7d2943c 100644 --- a/models/Extraction.yaml +++ b/models/Extraction.yaml @@ -1,4 +1,4 @@ -description: "" +description: '' type: object properties: shipSymbol: @@ -24,8 +24,3 @@ x-examples: yield: tradeSymbol: SILICON units: 16 -examples: - - shipSymbol: 4B902A-1 - yield: - tradeSymbol: SILICON - units: 16 diff --git a/models/Faction.json b/models/Faction.json index ae066d3..c383928 100644 --- a/models/Faction.json +++ b/models/Faction.json @@ -15,20 +15,6 @@ ] } }, - "examples": [ - { - "symbol": "COMMERCE_REPUBLIC", - "name": "Commerce Repubic", - "description": "The Commerce Republic takes capital from top tier worlds and invests it into new systems with high potential for growth.", - "headquarters": "X1-OE-PM", - "traits": [ - "BUREAUCRATIC", - "CAPITALISTIC", - "GUILD", - "ESTABLISHED" - ] - } - ], "properties": { "symbol": { "type": "string", diff --git a/models/Meta.yaml b/models/Meta.yaml index 53922c0..6fb23a0 100644 --- a/models/Meta.yaml +++ b/models/Meta.yaml @@ -1,4 +1,4 @@ -description: "" +description: '' type: object properties: total: @@ -16,7 +16,3 @@ x-examples: total: 6 page: 1 limit: 20 -examples: - - total: 10 - page: 1 - limit: 10 diff --git a/models/Ship.json b/models/Ship.json index 7693032..04b5a75 100644 --- a/models/Ship.json +++ b/models/Ship.json @@ -5,11 +5,7 @@ "symbol": { "type": "string", "description": "The globally unique identifier of the ship in the following format: `[AGENT_SYMBOL]_[HEX_ID]`", - "minLength": 8, - "examples": [ - "FALCON_0A1", - "FALCON_00A" - ] + "minLength": 8 }, "registration": { "$ref": "./ShipRegistration.json" diff --git a/models/ShipCargoItem.json b/models/ShipCargoItem.json index 3fc82bf..a8760bd 100644 --- a/models/ShipCargoItem.json +++ b/models/ShipCargoItem.json @@ -3,20 +3,10 @@ "description": "The type of cargo item and the number of units.", "properties": { "symbol": { - "type": "string", - "examples": [ - "ORE_COPPER", - "MICROPROCESSORS", - "FOOD" - ] + "type": "string" }, "name": { - "type": "string", - "examples": [ - "Copper Ore", - "Microprocessors", - "Food" - ] + "type": "string" }, "units": { "type": "integer", diff --git a/models/ShipRegistration.json b/models/ShipRegistration.json index 8017311..8068c2a 100644 --- a/models/ShipRegistration.json +++ b/models/ShipRegistration.json @@ -10,20 +10,12 @@ "name": { "type": "string", "description": "The agent's registered name of the ship", - "minLength": 1, - "examples": [ - "Red Falcon", - "Black Pearl IV", - "The Flying Dutchman" - ] + "minLength": 1 }, "factionSymbol": { "type": "string", "description": "The symbol of the faction the ship is registered with", - "minLength": 1, - "examples": [ - "F_COMM" - ] + "minLength": 1 }, "role": { "$ref": "./ShipRole.json" diff --git a/models/Survey.yaml b/models/Survey.yaml index f45910e..11ceea6 100644 --- a/models/Survey.yaml +++ b/models/Survey.yaml @@ -21,8 +21,3 @@ required: - signature - deposits - expiration -examples: - - signature: X1-OE-D2DD38 - deposits: - - COPPER_ORE - expiration: '2022-03-08T05:41:55.514Z' diff --git a/models/System.yaml b/models/System.yaml index 8581157..fedeec8 100644 --- a/models/System.yaml +++ b/models/System.yaml @@ -1,4 +1,4 @@ -description: "" +description: '' type: object x-examples: example-1: @@ -6,24 +6,7 @@ x-examples: 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 -examples: - - symbol: X1-OE - sector: X1 - type: RED_STAR - x: 0 - "y": 0 + 'y': 0 waypoints: - X1-OE-PM - X1-OE-PM01 @@ -47,7 +30,7 @@ properties: minLength: 1 x: type: integer - "y": + 'y': type: integer waypoints: type: array @@ -60,15 +43,13 @@ properties: charted: type: boolean chartedBy: - type: - - string - - "null" + type: string required: - symbol - sector - type - x - - "y" + - 'y' - waypoints - factions - charted diff --git a/models/Trade.yaml b/models/Trade.yaml index 1d8b987..6931790 100644 --- a/models/Trade.yaml +++ b/models/Trade.yaml @@ -1,4 +1,4 @@ -description: "" +description: '' type: object properties: waypointSymbol: @@ -22,8 +22,3 @@ x-examples: tradeSymbol: MICROPROCESSORS credits: -843 units: 1 -examples: - - waypointSymbol: X1-OE-PM - tradeSymbol: MICROPROCESSORS - credits: 843 - units: 1 diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 85969c7..a2e43f5 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -1,9 +1,8 @@ { - "openapi": "3.1.0", + "openapi": "3.0.0", "info": { "title": "SpaceTraders API", "version": "2.0.0-rc.2", - "summary": "[Alpha] SpaceTraders is a multiplayer sci-fi strategy game where you acquire and manage a fleet of ships.", "contact": { "name": "Joel Brubaker", "email": "joel@spacetraders.io" @@ -816,7 +815,7 @@ "$ref": "../models/Extraction.yaml" }, "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" } } } @@ -824,25 +823,6 @@ "required": [ "data" ] - }, - "examples": { - "Success": { - "value": { - "data": { - "extraction": { - "shipSymbol": "4B902A-1", - "yield": { - "tradeSymbol": "SILICON", - "units": 16 - } - }, - "cooldown": { - "duration": 119, - "expiration": "2022-03-12T00:41:29.371Z" - } - } - } - } } } } @@ -853,10 +833,7 @@ "content": { "application/json": { "schema": { - "type": [ - "object", - "null" - ], + "type": "object", "properties": { "survey": { "$ref": "../models/Survey.yaml" @@ -922,7 +899,7 @@ ], "properties": { "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" } } } @@ -1064,7 +1041,7 @@ } }, "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" } } } @@ -1169,7 +1146,7 @@ "type": "object", "properties": { "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" } } } @@ -1259,7 +1236,7 @@ } }, "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" } } } @@ -1339,7 +1316,7 @@ ], "properties": { "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" } } } @@ -1812,7 +1789,7 @@ } }, "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" } }, "required": [ @@ -1823,7 +1800,7 @@ { "properties": { "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" }, "system": { "$ref": "../models/System.yaml" @@ -1833,7 +1810,7 @@ { "properties": { "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" }, "waypoint": { "$ref": "../models/Waypoint.json" @@ -1911,7 +1888,7 @@ "type": "object", "properties": { "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" } } } @@ -2179,7 +2156,12 @@ "description": "Attempt to negotiate with the faction at a waypoint. The request will only succeed if the waypoint is a negotiable location, and your ship is capable of negotiating using an envoy.", "tags": [ "ships" - ] + ], + "responses": { + "200": { + "description": "" + } + } } }, "/my/contracts": { @@ -2544,8 +2526,7 @@ "MINERS_COLLECTIVE", "SPACERS_GUILD" ], - "charted": true, - "chartedBy": null + "charted": true } ], "meta": { @@ -2630,8 +2611,7 @@ "y": 9, "waypoints": [], "factions": [], - "charted": false, - "chartedBy": null + "charted": false } } } @@ -2818,94 +2798,9 @@ "schema": { "description": "", "type": "object", - "x-examples": { - "example-1": { - "data": [ - { - "system": "X1-OE", - "symbol": "X1-OE-PM", - "type": "PLANET", - "x": 10, - "y": 5, - "orbitals": [ - "X1-OE-PM01" - ], - "faction": "COMMERCE_REPUBLIC", - "features": [ - "MARKETPLACE", - "SHIPYARD" - ], - "traits": [ - "OVERCROWDED", - "HIGH_TECH", - "BUREAUCRATIC", - "TRADING_HUB", - "TEMPERATE" - ], - "charted": true, - "chartedBy": null - }, - { - "system": "X1-OE", - "symbol": "X1-OE-PM01", - "type": "MOON", - "x": 10, - "y": 5, - "orbitals": [], - "faction": "COMMERCE_REPUBLIC", - "features": [ - "MARKETPLACE" - ], - "traits": [ - "WEAK_GRAVITY" - ], - "charted": true, - "chartedBy": null - }, - { - "system": "X1-OE", - "symbol": "X1-OE-A005", - "type": "ASTEROID_FIELD", - "x": -1, - "y": -29, - "orbitals": [], - "faction": "MINERS_COLLECTIVE", - "features": [], - "traits": [ - "COMMON_METAL_DEPOSITS" - ], - "charted": true, - "chartedBy": null - }, - { - "system": "X1-OE", - "symbol": "X1-OE-25X", - "type": "JUMP_GATE", - "x": -38, - "y": 47, - "orbitals": [], - "faction": "SPACERS_GUILD", - "features": [], - "traits": [], - "charted": true, - "chartedBy": null - } - ], - "meta": { - "total": 4, - "page": 1, - "limit": 20 - } - } - }, "properties": { "data": { - "type": "array", - "uniqueItems": true, - "minItems": 1, - "items": { - "$ref": "../models/Waypoint.json" - } + "$ref": "../models/Waypoint.json" }, "meta": { "$ref": "../models/Meta.yaml" @@ -2920,7 +2815,7 @@ } } }, - "operationId": "get-systems-systemSymbol-waypoints", + "operationId": "get-system-waypoint", "security": [ { "AgentToken": [] @@ -3057,7 +2952,12 @@ "tags": [ "factions" ], - "operationId": "get-factions" + "operationId": "get-factions", + "responses": { + "200": { + "description": "" + } + } } }, "/factions/{factionSymbol}": { @@ -3079,7 +2979,12 @@ "factions" ], "operationId": "get-factions-factionSymbol", - "description": "View the details of a faction." + "description": "View the details of a faction.", + "responses": { + "200": { + "description": "" + } + } } } }, From b0cc8e96996f9b93f08bb61b3acced231525b8d9 Mon Sep 17 00:00:00 2001 From: Joel Brubaker Date: Sun, 16 Oct 2022 16:53:32 -0700 Subject: [PATCH 08/48] update operation ids --- reference/SpaceTraders.json | 192 +++++++----------------------------- 1 file changed, 34 insertions(+), 158 deletions(-) diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index a2e43f5..9aa1233 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -61,7 +61,7 @@ } } }, - "operationId": "post-register", + "operationId": "register", "description": "Creates a new agent and ties it to a temporary Account. Use `COMMERCE_REPUBLIC` as your starting faction if you don't know any other factions to choose from.\n\nThe agent symbol is a 4-8 character string that will represent your agent. This symbol will prefix the symbol of every ship you own. Agent symbols will be cast to all uppercase characters.\n\nA new agent will be granted an authorization token, a contract with their starting faction, a command ship with a jump drive, and one hundred thousand credits.\n\n> #### Keep your token safe and secure\n>\n> Save your token during the alpha phase. There is no way to regenerate this token without starting a new agent. In the future you will be able to generate and manage your tokens from the SpaceTraders website.\n\nYou can accept your contract using the `/my/contracts/{contractId}/accept` endpoint. You will want to navigate your command ship to a nearby asteroid field waypoint, and execute the `/my/ships/{shipSymbol}/accept` endpoint to mine various types of ores and minerals.\n\nReturn to the contract destination and execute the `/my/ships/{shipSymbol}/deliver` endpoint to deposit goods into the contract.\n\nWhen your contract is fulfilled, you can call `/my/contracts/{contractId}/fulfill` to retrieve payment.", "requestBody": { "content": { @@ -348,7 +348,7 @@ } } }, - "operationId": "get-my-ships", + "operationId": "list-my-ships", "description": "Retrieve all of your ships.", "security": [ { @@ -423,7 +423,7 @@ } } }, - "operationId": "post-my-ships", + "operationId": "purchase-ship", "security": [ { "AgentToken": [] @@ -516,7 +516,7 @@ } } }, - "operationId": "get-my-ships-shipSymbol", + "operationId": "get-my-ship", "description": "Retrieve the details of your ship.", "security": [ { @@ -565,7 +565,7 @@ } } }, - "operationId": "post-my-ships-:shipSymbol-chart", + "operationId": "chart-system", "description": "Command a ship to chart the current system and/or waypoint.\n\nSystems and waypoints in the universe are uncharted by default. These locations will not show up in the API until they have been charted by a ship.\n\nCharting a location will record your agent as the one who created the chart.\n\nReturns an array of system / waypoint symbols that have been charted.", "security": [ { @@ -636,7 +636,7 @@ } } }, - "operationId": "post-my-ships-shipSymbol-deliver", + "operationId": "deliver-contract", "security": [ { "AgentToken": [] @@ -648,7 +648,7 @@ "schema": { "type": "object", "properties": { - "contractId": { + "shipSymbol": { "type": "string" }, "tradeSymbol": { @@ -737,7 +737,7 @@ } } }, - "operationId": "post-my-ships-shipSymbol-jettison", + "operationId": "jettison", "description": "Jettison cargo from your ship's cargo hold.", "security": [ { @@ -828,7 +828,7 @@ } } }, - "operationId": "post-my-ships-shipSymbol-extract", + "operationId": "create-extraction", "requestBody": { "content": { "application/json": { @@ -872,7 +872,7 @@ }, "get": { "summary": "Extraction Cooldown", - "operationId": "get-my-ships-shipSymbol-extract", + "operationId": "get-ship-extraction", "responses": { "200": { "description": "OK", @@ -1118,7 +1118,7 @@ } } }, - "operationId": "post-my-ships-shipSymbol-survey", + "operationId": "create-ship-survey", "security": [ { "AgentToken": [] @@ -1168,7 +1168,7 @@ } } }, - "operationId": "get-my-ships-shipSymbol-survey", + "operationId": "get-ship-survey", "description": "Executing a survey will initiate a cooldown for a number of seconds before you can call it again. This endpoint returns the details of your cooldown, or a 404 if there is no cooldown for the survey action." } }, @@ -1265,7 +1265,7 @@ } } }, - "operationId": "post-my-ships-shipSymbol-jump", + "operationId": "jump-ship", "security": [ { "AgentToken": [] @@ -1289,7 +1289,7 @@ }, "get": { "summary": "Jump Cooldown", - "operationId": "get-my-ships-shipSymbol-jump", + "operationId": "get-ship-jump", "responses": { "200": { "description": "OK", @@ -1398,7 +1398,7 @@ } } }, - "operationId": "post-my-ships-shipSymbol-purchase", + "operationId": "purchase-cargo", "security": [ { "AgentToken": [] @@ -1482,7 +1482,7 @@ } } }, - "operationId": "post-my-ships-shipSymbol-sell", + "operationId": "sell-cargo", "description": "Sell cargo from your ship's hold to the local market.", "security": [ { @@ -1576,7 +1576,7 @@ } } }, - "operationId": "post-my-ships-shipSymbol-refuel", + "operationId": "refuel-ship", "security": [ { "AgentToken": [] @@ -1606,7 +1606,7 @@ "description": "OK" } }, - "operationId": "post-my-ships-shipSymbol-deploy", + "operationId": "deploy-asset", "security": [ { "AgentToken": [] @@ -1829,7 +1829,7 @@ } } }, - "operationId": "post-my-ships-shipSymbol-scan", + "operationId": "create-ship-scan", "security": [ { "AgentToken": [] @@ -1875,7 +1875,7 @@ }, "get": { "summary": "Scan Cooldown", - "operationId": "get-my-ships-shipSymbol-scan", + "operationId": "get-ship-scan", "responses": { "200": { "description": "OK", @@ -1966,7 +1966,7 @@ } } }, - "operationId": "post-my-ships-shipSymbol-navigate", + "operationId": "navigate-ship", "requestBody": { "content": { "application/json": { @@ -2056,7 +2056,7 @@ } } }, - "operationId": "post-my-ships-shipSymbol-dock", + "operationId": "dock-ship", "security": [ { "AgentToken": [] @@ -2121,7 +2121,7 @@ } } }, - "operationId": "post-my-ships-shipSymbol-orbit", + "operationId": "orbit-ship", "security": [ { "AgentToken": [] @@ -2133,37 +2133,6 @@ ] } }, - "/my/ships/{shipSymbol}/negotiate": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true, - "description": "The symbol of the ship" - } - ], - "post": { - "summary": "Negotiate with a waypoint", - "operationId": "post-my-ships-negotiate", - "security": [ - { - "AgentToken": [] - } - ], - "description": "Attempt to negotiate with the faction at a waypoint. The request will only succeed if the waypoint is a negotiable location, and your ship is capable of negotiating using an envoy.", - "tags": [ - "ships" - ], - "responses": { - "200": { - "description": "" - } - } - } - }, "/my/contracts": { "get": { "summary": "List Contracts", @@ -2178,63 +2147,6 @@ "schema": { "description": "", "type": "object", - "x-examples": { - "example-1": { - "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" - }, - { - "id": "cl0hok3920023kv0jflbjpltg", - "faction": "COMMERCE_REPUBLIC", - "type": "PROCUREMENT", - "terms": { - "deadline": "2022-03-11T05:16:59.123Z", - "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.122Z" - } - ], - "meta": { - "total": 2, - "page": 1, - "limit": 20 - } - } - }, "properties": { "data": { "type": "array", @@ -2252,42 +2164,6 @@ "data", "meta" ] - }, - "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" - } - ], - "meta": { - "total": 10, - "page": 1, - "limit": 10 - } - } - } } } } @@ -2365,7 +2241,7 @@ } } }, - "operationId": "get-my-contracts-contractId", + "operationId": "get-my-contract", "security": [ { "AgentToken": [] @@ -2407,7 +2283,7 @@ } } }, - "operationId": "post-my-contracts-contractId-accept", + "operationId": "accept-contract", "security": [ { "AgentToken": [] @@ -2620,7 +2496,7 @@ } } }, - "operationId": "get-systems-systemSymbol", + "operationId": "get-system", "security": [ { "AgentToken": [] @@ -2755,7 +2631,7 @@ } } }, - "operationId": "get-systems-systemSymbol-waypoints-waypointSymbol", + "operationId": "get-system-waypoints", "security": [ { "AgentToken": [] @@ -2815,7 +2691,7 @@ } } }, - "operationId": "get-system-waypoint", + "operationId": "get-waypoint", "security": [ { "AgentToken": [] @@ -2847,6 +2723,7 @@ ], "get": { "summary": "Get Shipyard", + "description": "", "tags": [ "shipyards" ], @@ -2875,13 +2752,12 @@ "data", "meta" ] - }, - "examples": {} + } } } } }, - "operationId": "get-systems-systemSymbol-shipyards-waypointSymbol-ships", + "operationId": "get-shipyard", "security": [ { "AgentToken": [] @@ -2936,7 +2812,7 @@ } } }, - "operationId": "get-system-waypoint-market", + "operationId": "get-market", "description": "Retrieve imports, exports and exchange data from a marketplace. Imports can be sold, exports can be purchased, and exchange trades can be purchased or sold.\n\nMarket data is only available if you have a ship at the location, or the location is charted and has a communications relay deployed.\n\nSee `/my/ships/{shipSymbol}/deploy` for deploying relays at a location.", "security": [ { @@ -2952,7 +2828,7 @@ "tags": [ "factions" ], - "operationId": "get-factions", + "operationId": "list-factions", "responses": { "200": { "description": "" @@ -2978,7 +2854,7 @@ "tags": [ "factions" ], - "operationId": "get-factions-factionSymbol", + "operationId": "get-faction", "description": "View the details of a faction.", "responses": { "200": { From 1a04d6299a4d5ea31cb607905f3fcbc7d0821f23 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Sun, 16 Oct 2022 17:06:16 -0700 Subject: [PATCH 09/48] fix: simplify tags --- reference/SpaceTraders.json | 281 +++++++++++++++--------------------- 1 file changed, 113 insertions(+), 168 deletions(-) diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 9aa1233..0dcda42 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -23,9 +23,7 @@ "/register": { "post": { "summary": "Register New Agent", - "tags": [ - "agents" - ], + "tags": [], "responses": { "201": { "description": "OK", @@ -136,9 +134,6 @@ "/my/ships": { "get": { "summary": "List Ships", - "tags": [ - "ships" - ], "responses": { "200": { "description": "OK", @@ -354,12 +349,15 @@ { "AgentToken": [] } + ], + "tags": [ + "fleet" ] }, "post": { "summary": "Purchase Ship", "tags": [ - "shipyards" + "fleet" ], "responses": { "200": { @@ -461,7 +459,7 @@ "get": { "summary": "View Ship", "tags": [ - "ships" + "fleet" ], "responses": { "200": { @@ -573,7 +571,7 @@ } ], "tags": [ - "systems" + "fleet" ] }, "parameters": [ @@ -588,87 +586,6 @@ } ] }, - "/my/contracts/{contractId}/deliver": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "contractId", - "in": "path", - "required": true, - "description": "The ID of the contract" - } - ], - "post": { - "summary": "Deliver on Contract", - "tags": [ - "contracts" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "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" - } - }, - "required": [ - "data" - ] - } - } - } - } - }, - "operationId": "deliver-contract", - "security": [ - { - "AgentToken": [] - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "shipSymbol": { - "type": "string" - }, - "tradeSymbol": { - "type": "string" - }, - "units": { - "type": "integer" - } - }, - "required": [ - "contractId", - "tradeSymbol" - ] - } - } - } - }, - "description": "Deliver cargo on a given contract." - } - }, "/my/ships/{shipSymbol}/jettison": { "parameters": [ { @@ -683,7 +600,7 @@ "post": { "summary": "Jettison Cargo", "tags": [ - "ships" + "fleet" ], "responses": { "200": { @@ -867,7 +784,7 @@ } ], "tags": [ - "extract" + "fleet" ] }, "get": { @@ -931,7 +848,7 @@ } ], "tags": [ - "extract" + "fleet" ] } }, @@ -1126,13 +1043,13 @@ ], "description": "If you want to target specific yields for an extraction, you can survey a waypoint, such as an asteroid field, and send the survey in the body of the extract request. Each survey may have multiple deposits, and if a symbol shows up more than once, that indicates a higher chance of extracting that resource.\n\nYour ship will enter a cooldown between consecutive survey requests. Surveys will eventually expire after a period of time. Multiple ships can use the same survey for extraction.", "tags": [ - "extract" + "fleet" ] }, "get": { "summary": "Survey Cooldown", "tags": [ - "extract" + "fleet" ], "responses": { "200": { @@ -1185,8 +1102,9 @@ ], "post": { "summary": "Jump Ship", + "description": "Jump your ship from one system to another.", "tags": [ - "navigation" + "fleet" ], "responses": { "201": { @@ -1335,7 +1253,7 @@ } ], "tags": [ - "navigation" + "fleet" ] } }, @@ -1353,7 +1271,7 @@ "post": { "summary": "Purchase Cargo", "tags": [ - "trade" + "fleet" ], "responses": { "201": { @@ -1437,7 +1355,7 @@ "post": { "summary": "Sell Cargo", "tags": [ - "trade" + "fleet" ], "responses": { "200": { @@ -1523,7 +1441,7 @@ "post": { "summary": "Refuel Ship", "tags": [ - "navigation" + "fleet" ], "responses": { "200": { @@ -1599,7 +1517,7 @@ "post": { "summary": "Deploy Asset", "tags": [ - "markets" + "fleet" ], "responses": { "204": { @@ -1646,7 +1564,7 @@ "post": { "summary": "Scan", "tags": [ - "ships" + "fleet" ], "responses": { "201": { @@ -1916,7 +1834,7 @@ } ], "tags": [ - "ships" + "fleet" ] } }, @@ -1935,7 +1853,7 @@ "post": { "summary": "Navigate Ship", "tags": [ - "navigation" + "fleet" ], "responses": { "201": { @@ -2009,7 +1927,7 @@ "post": { "summary": "Dock Ship", "tags": [ - "navigation" + "fleet" ], "responses": { "200": { @@ -2129,7 +2047,7 @@ ], "description": "Attempt to move your ship into orbit at it's current location. The request will only succeed if your ship is capable of moving into orbit at the time of the request.\n\nThe endpoint is idempotent - successive calls will succeed even if the ship is already in orbit.", "tags": [ - "navigation" + "fleet" ] } }, @@ -2250,6 +2168,87 @@ "description": "Get the details of a contract by ID." } }, + "/my/contracts/{contractId}/deliver": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "contractId", + "in": "path", + "required": true, + "description": "The ID of the contract" + } + ], + "post": { + "summary": "Deliver on Contract", + "tags": [ + "contracts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "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" + } + }, + "required": [ + "data" + ] + } + } + } + } + }, + "operationId": "deliver-contract", + "security": [ + { + "AgentToken": [] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "shipSymbol": { + "type": "string" + }, + "tradeSymbol": { + "type": "string" + }, + "units": { + "type": "integer" + } + }, + "required": [ + "contractId", + "tradeSymbol" + ] + } + } + } + }, + "description": "Deliver cargo on a given contract." + } + }, "/my/contracts/{contractId}/accept": { "parameters": [ { @@ -2724,9 +2723,6 @@ "get": { "summary": "Get Shipyard", "description": "", - "tags": [ - "shipyards" - ], "responses": { "200": { "description": "OK", @@ -2762,6 +2758,9 @@ { "AgentToken": [] } + ], + "tags": [ + "systems" ] } }, @@ -2788,9 +2787,6 @@ ], "get": { "summary": "View Market", - "tags": [ - "markets" - ], "responses": { "200": { "description": "OK", @@ -2818,6 +2814,9 @@ { "AgentToken": [] } + ], + "tags": [ + "systems" ] } }, @@ -2869,70 +2868,16 @@ "name": "factions" }, { - "name": "ships" - }, - { - "name": "markets" - }, - { - "name": "trade" - }, - { - "name": "sell" - }, - { - "name": "purchase" - }, - { - "name": "navigation" - }, - { - "name": "agents" - }, - { - "name": "dock" - }, - { - "name": "orbit" - }, - { - "name": "jettison" - }, - { - "name": "jump" - }, - { - "name": "refuel" - }, - { - "name": "scan" + "name": "fleet" }, { "name": "contracts" }, - { - "name": "chart" - }, - { - "name": "extract" - }, - { - "name": "mining" - }, - { - "name": "deliver" - }, - { - "name": "survey" - }, { "name": "systems" }, { - "name": "waypoints" - }, - { - "name": "shipyards" + "name": "agents" } ], "components": { From 13bf62193030c140dc6877aebb6b12e153f0b2ea Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Sun, 16 Oct 2022 17:12:56 -0700 Subject: [PATCH 10/48] feat: add ship cooldown endpoint --- reference/SpaceTraders.json | 507 ++++++++++++++---------------------- 1 file changed, 198 insertions(+), 309 deletions(-) diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 0dcda42..99f7a76 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -523,39 +523,82 @@ ] } }, - "/my/ships/{shipSymbol}/chart": { - "post": { - "summary": "Chart Waypoint", + "/my/ships/{shipSymbol}/cooldown": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true + } + ], + "get": { + "summary": "View Ship", + "tags": [ + "fleet" + ], "responses": { "200": { "description": "OK", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "data": { + "symbol": "653298-1", + "crew": null, + "officers": null, + "frame": "FRAME_DRONE", + "reactor": "REACTOR_SOLAR_I", + "engine": "ENGINE_SOLAR_PROPULSION", + "modules": [ + "MODULE_CARGO_HOLD" + ], + "mounts": [ + "MOUNT_MINING_LASER_I" + ], + "registration": { + "factionSymbol": "COMMERCE_REPUBLIC", + "agentSymbol": "653298", + "fee": 100, + "role": "EXCAVATOR" + }, + "integrity": { + "frame": 1, + "reactor": 1, + "engine": 1 + }, + "status": "DOCKED", + "location": "X1-OE-PM", + "cargo": [] + } + } + }, + "properties": { + "data": { + "$ref": "../models/Ship.json" + } + }, + "required": [ + "data" + ] + } + } + } + }, + "": { "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { - "type": "object", - "properties": { - "submitted": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - }, - "examples": { - "Success": { - "value": { - "data": { - "submitted": [ - "X1-ZZ", - "X1-ZZ-7-EE" - ] - } + "$ref": "../models/Cooldown.json" } } } @@ -563,17 +606,16 @@ } } }, - "operationId": "chart-system", - "description": "Command a ship to chart the current system and/or waypoint.\n\nSystems and waypoints in the universe are uncharted by default. These locations will not show up in the API until they have been charted by a ship.\n\nCharting a location will record your agent as the one who created the chart.\n\nReturns an array of system / waypoint symbols that have been charted.", + "operationId": "get-ship-cooldown", + "description": "Retrieve the details of your ship's reactor cooldown. Some actions such as activating your jump drive, scanning, or extracting resources taxes your reactor and results in a cooldown.\n\nYour ship cannot perform additional actions until your cooldown has expired. The duration of your cooldown is relative to the power consumption of the related modules or mounts for the action taken.", "security": [ { "AgentToken": [] } - ], - "tags": [ - "fleet" ] - }, + } + }, + "/my/ships/{shipSymbol}/navigate": { "parameters": [ { "schema": { @@ -582,9 +624,70 @@ "name": "shipSymbol", "in": "path", "required": true, - "description": "The symbol of the ship" + "description": "The ship symbol" } - ] + ], + "post": { + "summary": "Navigate Ship", + "tags": [ + "fleet" + ], + "responses": { + "201": { + "description": "The successful transit information including the route details and changes to ship fuel, supplies, and crew wages paid. The route includes the expected time of arrival.", + "content": { + "application/json": { + "schema": { + "description": "", + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "route": { + "$ref": "../models/ShipNav.json" + }, + "shipFuel": { + "$ref": "../models/ShipFuel.json" + } + } + } + }, + "required": [ + "data" + ] + } + } + } + } + }, + "operationId": "navigate-ship", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "waypointSymbol": { + "type": "string", + "description": "The target destination." + } + }, + "required": [ + "waypointSymbol" + ] + } + } + }, + "description": "" + }, + "security": [ + { + "AgentToken": [] + } + ], + "description": "Navigate to a target destination. The destination must be located within the same system as the ship. Navigating will consume the necessary fuel and supplies from the ship's manifest, and will pay out crew wages from the agent's account.\n\nThe returned response will detail the route information including the expected time of arrival. Most ship actions are unavailable until the ship has arrived at it's destination.\n\nFor faster-than-light travel between systems, see the ship's jump action." + } }, "/my/ships/{shipSymbol}/jettison": { "parameters": [ @@ -681,6 +784,69 @@ } } }, + "/my/ships/{shipSymbol}/chart": { + "post": { + "summary": "Chart Waypoint", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "submitted": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "examples": { + "Success": { + "value": { + "data": { + "submitted": [ + "X1-ZZ", + "X1-ZZ-7-EE" + ] + } + } + } + } + } + } + } + }, + "operationId": "chart-system", + "description": "Command a ship to chart the current system and/or waypoint.\n\nSystems and waypoints in the universe are uncharted by default. These locations will not show up in the API until they have been charted by a ship.\n\nCharting a location will record your agent as the one who created the chart.\n\nReturns an array of system / waypoint symbols that have been charted.", + "security": [ + { + "AgentToken": [] + } + ], + "tags": [ + "fleet" + ] + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "shipSymbol", + "in": "path", + "required": true, + "description": "The symbol of the ship" + } + ] + }, "/my/ships/{shipSymbol}/extract": { "parameters": [ { @@ -786,70 +952,6 @@ "tags": [ "fleet" ] - }, - "get": { - "summary": "Extraction Cooldown", - "operationId": "get-ship-extraction", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": { - "cooldown": { - "duration": 119, - "expiration": "2022-03-12T00:41:29.285Z" - } - } - } - }, - "properties": { - "data": { - "type": "object", - "required": [ - "cooldown" - ], - "properties": { - "cooldown": { - "$ref": "../models/Cooldown.json" - } - } - } - }, - "required": [ - "data" - ] - }, - "examples": { - "Success": { - "value": { - "data": { - "cooldown": { - "duration": 119, - "expiration": "2022-03-12T00:41:29.285Z" - } - } - } - } - } - } - } - } - }, - "description": "Get the status of your last extraction.", - "security": [ - { - "AgentToken": [] - } - ], - "tags": [ - "fleet" - ] } }, "/my/ships/{shipSymbol}/survey": { @@ -1045,48 +1147,6 @@ "tags": [ "fleet" ] - }, - "get": { - "summary": "Survey Cooldown", - "tags": [ - "fleet" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "cooldown": { - "$ref": "../models/Cooldown.json" - } - } - } - } - }, - "examples": { - "Success": { - "value": { - "data": { - "cooldown": { - "duration": 899, - "expiration": "2022-03-12T02:11:35.618Z" - } - } - } - } - } - } - } - } - }, - "operationId": "get-ship-survey", - "description": "Executing a survey will initiate a cooldown for a number of seconds before you can call it again. This endpoint returns the details of your cooldown, or a 404 if there is no cooldown for the survey action." } }, "/my/ships/{shipSymbol}/jump": { @@ -1204,57 +1264,6 @@ } } } - }, - "get": { - "summary": "Jump Cooldown", - "operationId": "get-ship-jump", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": { - "cooldown": { - "duration": 719, - "expiration": "2022-03-12T00:52:56.735Z" - } - } - } - }, - "properties": { - "data": { - "type": "object", - "required": [ - "cooldown" - ], - "properties": { - "cooldown": { - "$ref": "../models/Cooldown.json" - } - } - } - }, - "required": [ - "data" - ] - } - } - } - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "tags": [ - "fleet" - ] } }, "/my/ships/{shipSymbol}/purchase": { @@ -1790,126 +1799,6 @@ }, "description": "" } - }, - "get": { - "summary": "Scan Cooldown", - "operationId": "get-ship-scan", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "cooldown": { - "$ref": "../models/Cooldown.json" - } - } - } - } - }, - "examples": { - "Success": { - "value": { - "data": { - "cooldown": { - "duration": 59, - "expiration": "2022-03-12T00:42:44.220Z" - } - } - } - } - } - } - } - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "tags": [ - "fleet" - ] - } - }, - "/my/ships/{shipSymbol}/navigate": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true, - "description": "The ship symbol" - } - ], - "post": { - "summary": "Navigate Ship", - "tags": [ - "fleet" - ], - "responses": { - "201": { - "description": "The successful transit information including the route details and changes to ship fuel, supplies, and crew wages paid. The route includes the expected time of arrival.", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "route": { - "$ref": "../models/ShipNav.json" - }, - "shipFuel": { - "$ref": "../models/ShipFuel.json" - } - } - } - }, - "required": [ - "data" - ] - } - } - } - } - }, - "operationId": "navigate-ship", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "waypointSymbol": { - "type": "string", - "description": "The target destination." - } - }, - "required": [ - "waypointSymbol" - ] - } - } - }, - "description": "" - }, - "security": [ - { - "AgentToken": [] - } - ], - "description": "Navigate to a target destination. The destination must be located within the same system as the ship. Navigating will consume the necessary fuel and supplies from the ship's manifest, and will pay out crew wages from the agent's account.\n\nThe returned response will detail the route information including the expected time of arrival. Most ship actions are unavailable until the ship has arrived at it's destination.\n\nFor faster-than-light travel between systems, see the ship's jump action." } }, "/my/ships/{shipSymbol}/dock": { From 8d3b4e5a0f3b3ebb24b6e6b90f469884dd639123 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Sun, 16 Oct 2022 17:23:20 -0700 Subject: [PATCH 11/48] fix: clean up descriptions --- reference/SpaceTraders.json | 147 ++++++++++++++++++++---------------- 1 file changed, 83 insertions(+), 64 deletions(-) diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 99f7a76..5021325 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -457,7 +457,7 @@ } ], "get": { - "summary": "View Ship", + "summary": "Get Ship", "tags": [ "fleet" ], @@ -535,7 +535,7 @@ } ], "get": { - "summary": "View Ship", + "summary": "Get Ship Cooldown", "tags": [ "fleet" ], @@ -547,41 +547,9 @@ "schema": { "description": "", "type": "object", - "x-examples": { - "example-1": { - "data": { - "symbol": "653298-1", - "crew": null, - "officers": null, - "frame": "FRAME_DRONE", - "reactor": "REACTOR_SOLAR_I", - "engine": "ENGINE_SOLAR_PROPULSION", - "modules": [ - "MODULE_CARGO_HOLD" - ], - "mounts": [ - "MOUNT_MINING_LASER_I" - ], - "registration": { - "factionSymbol": "COMMERCE_REPUBLIC", - "agentSymbol": "653298", - "fee": 100, - "role": "EXCAVATOR" - }, - "integrity": { - "frame": 1, - "reactor": 1, - "engine": 1 - }, - "status": "DOCKED", - "location": "X1-OE-PM", - "cargo": [] - } - } - }, "properties": { "data": { - "$ref": "../models/Ship.json" + "$ref": "../models/Cooldown.json" } }, "required": [ @@ -590,20 +558,6 @@ } } } - }, - "": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "../models/Cooldown.json" - } - } - } - } - } } }, "operationId": "get-ship-cooldown", @@ -786,7 +740,7 @@ }, "/my/ships/{shipSymbol}/chart": { "post": { - "summary": "Chart Waypoint", + "summary": "Create Chart", "responses": { "200": { "description": "OK", @@ -824,7 +778,7 @@ } } }, - "operationId": "chart-system", + "operationId": "create-chart", "description": "Command a ship to chart the current system and/or waypoint.\n\nSystems and waypoints in the universe are uncharted by default. These locations will not show up in the API until they have been charted by a ship.\n\nCharting a location will record your agent as the one who created the chart.\n\nReturns an array of system / waypoint symbols that have been charted.", "security": [ { @@ -911,7 +865,7 @@ } } }, - "operationId": "create-extraction", + "operationId": "extract-resources", "requestBody": { "content": { "application/json": { @@ -1137,7 +1091,7 @@ } } }, - "operationId": "create-ship-survey", + "operationId": "survey-waypoint", "security": [ { "AgentToken": [] @@ -1732,7 +1686,11 @@ "system": { "$ref": "../models/System.yaml" } - } + }, + "required": [ + "cooldown", + "system" + ] }, { "properties": { @@ -1742,7 +1700,11 @@ "waypoint": { "$ref": "../models/Waypoint.json" } - } + }, + "required": [ + "cooldown", + "waypoint" + ] } ], "type": "object" @@ -1762,7 +1724,7 @@ "AgentToken": [] } ], - "description": "Execute a ship scan to view approach / departing ships, system information or details about a waypoint. Send a scan mode to select the type of scan performed by your ship.", + "description": "Activate your ship's sensor arrays to scan for arriving ships, departing ships, system information, or waypoint information. Send a scan mode to select the type of scan performed by your ship.", "requestBody": { "content": { "application/json": { @@ -1976,7 +1938,7 @@ } } }, - "operationId": "get-my-contracts", + "operationId": "list-contracts", "security": [ { "AgentToken": [] @@ -1998,7 +1960,7 @@ } ], "get": { - "summary": "Contract Details", + "summary": "Get Contract", "tags": [ "contracts" ], @@ -2048,7 +2010,7 @@ } } }, - "operationId": "get-my-contract", + "operationId": "get-contract", "security": [ { "AgentToken": [] @@ -2070,7 +2032,7 @@ } ], "post": { - "summary": "Deliver on Contract", + "summary": "Deliver Contract", "tags": [ "contracts" ], @@ -2180,6 +2142,63 @@ "description": "Accept a contract." } }, + "/my/contracts/{contractId}/fulfill": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "contractId", + "in": "path", + "required": true + } + ], + "post": { + "summary": "Fulfill Contract", + "tags": [ + "contracts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "../models/Contract.yaml" + } + } + } + } + } + }, + "": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "../models/Contract.yaml" + } + } + } + } + }, + "description": "Contract has been successfully fulfilled." + } + }, + "operationId": "fulfill-contract", + "security": [ + { + "AgentToken": [] + } + ], + "description": "Fulfill a contract." + } + }, "/systems": { "get": { "summary": "List Systems", @@ -2328,7 +2347,7 @@ } ], "get": { - "summary": "View System", + "summary": "Get System", "tags": [ "systems" ], @@ -2550,7 +2569,7 @@ } ], "get": { - "summary": "View Waypoint", + "summary": "Get Waypoint", "tags": [ "systems" ], @@ -2675,7 +2694,7 @@ } ], "get": { - "summary": "View Market", + "summary": "Get Market", "responses": { "200": { "description": "OK", @@ -2738,7 +2757,7 @@ } ], "get": { - "summary": "View Faction", + "summary": "Get Faction", "tags": [ "factions" ], From 9099a85bb42b772ffbf2735a43e9f704fdd0d12c Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Sun, 16 Oct 2022 17:24:27 -0700 Subject: [PATCH 12/48] fix: remove dup response --- reference/SpaceTraders.json | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 5021325..f080a5f 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -2173,21 +2173,6 @@ } } } - }, - "": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "../models/Contract.yaml" - } - } - } - } - }, - "description": "Contract has been successfully fulfilled." } }, "operationId": "fulfill-contract", From fb825f60f76029ce7d029f745f13d05539846d97 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Sat, 22 Oct 2022 09:05:01 -0700 Subject: [PATCH 13/48] clean up inconsistency in the docs --- models/Agent.json | 29 ++ models/Agent.yaml | 25 -- models/{WaypointChart.json => Chart.json} | 2 +- models/Contract.json | 51 ++++ models/Contract.yaml | 86 ------ models/ContractDelivery.yaml | 30 --- models/ContractPayment.json | 17 ++ models/ContractProcurement.json | 30 +++ models/ContractTerms.json | 27 ++ models/Cooldown.json | 7 +- models/Extraction.json | 18 ++ models/Extraction.yaml | 26 -- models/ExtractionYield.json | 17 ++ models/Faction.json | 17 +- models/FactionTrait.json | 55 ++++ models/Jump.json | 30 --- models/Market.json | 25 +- models/MarketTradeGood.json | 11 +- models/MarketTransaction.json | 15 +- models/Meta.json | 27 ++ models/Meta.yaml | 18 -- models/ScannedShip.json | 43 +++ models/ScannedShip.yaml | 47 ---- models/Ship.json | 12 +- models/ShipCargo.json | 12 +- models/ShipCargoItem.json | 7 +- models/ShipCrew.json | 17 +- models/ShipEngine.json | 16 +- models/ShipFrame.json | 27 +- models/ShipFuel.json | 6 +- models/ShipModule.json | 18 +- models/ShipMount.json | 20 +- models/ShipNav.json | 5 + models/ShipNavRoute.json | 26 +- models/ShipReactor.json | 23 +- models/ShipRegistration.json | 12 +- models/ShipRequirements.json | 7 +- models/Shipyard.json | 13 +- models/ShipyardShip.json | 13 +- models/ShipyardTransaction.json | 29 ++ models/Survey.json | 30 +++ models/Survey.yaml | 23 -- models/SurveyDeposit.json | 13 + models/System.json | 63 +++++ models/System.yaml | 55 ---- models/SystemFaction.json | 12 + models/SystemWaypoint.json | 12 + models/Trade.yaml | 24 -- models/Waypoint.json | 5 +- models/WaypointFaction.json | 5 +- models/WaypointOrbital.json | 5 +- models/WaypointTrait.json | 7 +- reference/SpaceTraders.json | 314 +++------------------- 53 files changed, 709 insertions(+), 775 deletions(-) create mode 100644 models/Agent.json delete mode 100644 models/Agent.yaml rename models/{WaypointChart.json => Chart.json} (62%) create mode 100644 models/Contract.json delete mode 100644 models/Contract.yaml delete mode 100644 models/ContractDelivery.yaml create mode 100644 models/ContractPayment.json create mode 100644 models/ContractProcurement.json create mode 100644 models/ContractTerms.json create mode 100644 models/Extraction.json delete mode 100644 models/Extraction.yaml create mode 100644 models/ExtractionYield.json create mode 100644 models/FactionTrait.json delete mode 100644 models/Jump.json create mode 100644 models/Meta.json delete mode 100644 models/Meta.yaml create mode 100644 models/ScannedShip.json delete mode 100644 models/ScannedShip.yaml create mode 100644 models/ShipyardTransaction.json create mode 100644 models/Survey.json delete mode 100644 models/Survey.yaml create mode 100644 models/SurveyDeposit.json create mode 100644 models/System.json delete mode 100644 models/System.yaml create mode 100644 models/SystemFaction.json create mode 100644 models/SystemWaypoint.json delete mode 100644 models/Trade.yaml 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": [ From f5cf2940826993bb6002e2db48adf8e48791bf6d Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Thu, 27 Oct 2022 21:09:27 -0700 Subject: [PATCH 14/48] fix: clean up docs for the api --- models/Contract.json | 1 - ...curement.json => ContractDeliverGood.json} | 2 +- models/ContractTerms.json | 8 +- models/Extraction.json | 1 - models/Faction.json | 1 - models/ScannedShip.json | 2 - models/ShipCargo.json | 6 + models/ShipModule.json | 12 +- models/ShipNavRoute.json | 6 +- models/ShipNavRouteWaypoint.json | 30 + models/ShipRequirements.json | 7 +- models/Survey.json | 1 - models/System.json | 9 +- models/SystemWaypoint.json | 3 +- models/Waypoint.json | 12 +- models/WaypointTrait.json | 4 +- models/WaypointType.json | 3 +- reference/SpaceTraders.json | 3626 +++++++---------- 18 files changed, 1595 insertions(+), 2139 deletions(-) rename models/{ContractProcurement.json => ContractDeliverGood.json} (85%) create mode 100644 models/ShipNavRouteWaypoint.json diff --git a/models/Contract.json b/models/Contract.json index d283870..cb4c577 100644 --- a/models/Contract.json +++ b/models/Contract.json @@ -20,7 +20,6 @@ ] }, "terms": { - "type": "object", "$ref": "./ContractTerms.json" }, "accepted": { diff --git a/models/ContractProcurement.json b/models/ContractDeliverGood.json similarity index 85% rename from models/ContractProcurement.json rename to models/ContractDeliverGood.json index df988d3..02e1377 100644 --- a/models/ContractProcurement.json +++ b/models/ContractDeliverGood.json @@ -1,5 +1,5 @@ { - "description": "The details of a procurement contract. Includes the type of good, units needed, and the destination.", + "description": "The details of a delivery contract. Includes the type of good, units needed, and the destination.", "type": "object", "properties": { "tradeSymbol": { diff --git a/models/ContractTerms.json b/models/ContractTerms.json index cc5d191..0fc4809 100644 --- a/models/ContractTerms.json +++ b/models/ContractTerms.json @@ -7,16 +7,12 @@ "description": "The deadline for the contract." }, "payment": { - "type": "object", "$ref": "./ContractPayment.json" }, - "procurement": { + "deliver": { "type": "array", - "uniqueItems": true, - "minItems": 1, "items": { - "type": "object", - "$ref": "./ContractProcurement.json" + "$ref": "./ContractDeliverGood.json" } } }, diff --git a/models/Extraction.json b/models/Extraction.json index 0c78e39..a25051e 100644 --- a/models/Extraction.json +++ b/models/Extraction.json @@ -7,7 +7,6 @@ "minLength": 1 }, "yield": { - "type": "object", "$ref": "./ExtractionYield.json" } }, diff --git a/models/Faction.json b/models/Faction.json index 755b1ce..523fdf2 100644 --- a/models/Faction.json +++ b/models/Faction.json @@ -21,7 +21,6 @@ "traits": { "type": "array", "items": { - "type": "object", "$ref": "./FactionTrait.json" } } diff --git a/models/ScannedShip.json b/models/ScannedShip.json index 5fe4c50..d785295 100644 --- a/models/ScannedShip.json +++ b/models/ScannedShip.json @@ -8,11 +8,9 @@ "minLength": 8 }, "registration": { - "type": "object", "$ref": "./ShipRegistration.json" }, "nav": { - "type": "object", "$ref": "./ShipNav.json" }, "frame": { diff --git a/models/ShipCargo.json b/models/ShipCargo.json index b2e4348..0ca6653 100644 --- a/models/ShipCargo.json +++ b/models/ShipCargo.json @@ -6,6 +6,11 @@ "description": "The max number of items that can be stored in the cargo hold.", "minimum": 0 }, + "units": { + "type": "integer", + "description": "The number of items currently stored in the cargo hold.", + "minimum": 0 + }, "inventory": { "type": "array", "description": "The items currently in the cargo hold.", @@ -16,6 +21,7 @@ }, "required": [ "capacity", + "units", "inventory" ] } \ No newline at end of file diff --git a/models/ShipModule.json b/models/ShipModule.json index c353912..9b6c866 100644 --- a/models/ShipModule.json +++ b/models/ShipModule.json @@ -5,13 +5,15 @@ "symbol": { "type": "string", "enum": [ - "MODULE_FUEL_TANK", - "MODULE_CARGO_HOLD", - "MODULE_CREW_QUARTERS", - "MODULE_ENVOY_QUARTERS", "MODULE_PASSENGER_CABIN", + "MODULE_ENVOY_QUARTERS", "MODULE_MICRO_REFINERY", - "MODULE_JUMP_DRIVE" + "MODULE_MINERAL_PROCESSOR", + "MODULE_CARGO_HOLD", + "MODULE_JUMP_DRIVE_I", + "MODULE_JUMP_DRIVE_II", + "MODULE_JUMP_DRIVE_III", + "MODULE_CREW_QUARTERS" ] }, "name": { diff --git a/models/ShipNavRoute.json b/models/ShipNavRoute.json index a500921..2daf619 100644 --- a/models/ShipNavRoute.json +++ b/models/ShipNavRoute.json @@ -3,12 +3,10 @@ "description": "The routing information for the ship's most recent transit or current location.", "properties": { "destination": { - "type": "object", - "$ref": "./Waypoint.json" + "$ref": "./ShipNavRouteWaypoint.json" }, "departure": { - "type": "object", - "$ref": "./Waypoint.json" + "$ref": "./ShipNavRouteWaypoint.json" }, "arrival": { "type": "string", diff --git a/models/ShipNavRouteWaypoint.json b/models/ShipNavRouteWaypoint.json new file mode 100644 index 0000000..646f650 --- /dev/null +++ b/models/ShipNavRouteWaypoint.json @@ -0,0 +1,30 @@ +{ + "description": "The destination or departure of a ships nav route.", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "minLength": 1 + }, + "type": { + "$ref": "./WaypointType.json" + }, + "systemSymbol": { + "type": "string", + "minLength": 1 + }, + "x": { + "type": "integer" + }, + "y": { + "type": "integer" + } + }, + "required": [ + "symbol", + "type", + "systemSymbol", + "x", + "y" + ] +} \ No newline at end of file diff --git a/models/ShipRequirements.json b/models/ShipRequirements.json index 862a2ab..2510319 100644 --- a/models/ShipRequirements.json +++ b/models/ShipRequirements.json @@ -14,10 +14,5 @@ "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/Survey.json b/models/Survey.json index cbf50b2..c663875 100644 --- a/models/Survey.json +++ b/models/Survey.json @@ -11,7 +11,6 @@ "type": "array", "description": "A list of deposits that can be found at this location.", "items": { - "type": "object", "$ref": "./SurveyDeposit.json" } }, diff --git a/models/System.json b/models/System.json index 7e91a2d..bb6da08 100644 --- a/models/System.json +++ b/models/System.json @@ -34,20 +34,14 @@ "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": [ @@ -57,7 +51,6 @@ "x", "y", "waypoints", - "factions", - "chart" + "factions" ] } \ No newline at end of file diff --git a/models/SystemWaypoint.json b/models/SystemWaypoint.json index 1022638..3de74e8 100644 --- a/models/SystemWaypoint.json +++ b/models/SystemWaypoint.json @@ -2,8 +2,7 @@ "type": "object", "properties": { "symbol": { - "type": "string", - "minLength": 1 + "type": "string" } }, "required": [ diff --git a/models/Waypoint.json b/models/Waypoint.json index 8a75362..50aaf18 100644 --- a/models/Waypoint.json +++ b/models/Waypoint.json @@ -25,12 +25,8 @@ "$ref": "./WaypointOrbital.json" } }, - "factions": { - "type": "array", - "description": "The factions that are active on the waypoint.", - "items": { - "$ref": "./WaypointFaction.json" - } + "faction": { + "$ref": "./Faction.json" }, "traits": { "type": "array", @@ -50,8 +46,6 @@ "x", "y", "orbitals", - "factions", - "traits", - "chart" + "traits" ] } \ No newline at end of file diff --git a/models/WaypointTrait.json b/models/WaypointTrait.json index bf7b6d9..8d28956 100644 --- a/models/WaypointTrait.json +++ b/models/WaypointTrait.json @@ -57,7 +57,9 @@ "BARREN", "TEMPERATE", "JUNGLE", - "OCEAN" + "OCEAN", + "MARKETPLACE", + "SHIPYARD" ] }, "name": { diff --git a/models/WaypointType.json b/models/WaypointType.json index 4d4c37f..1f8f820 100644 --- a/models/WaypointType.json +++ b/models/WaypointType.json @@ -9,6 +9,7 @@ "JUMP_GATE", "ASTEROID_FIELD", "DEBRIS_FIELD", - "GRAVITY_WELL" + "GRAVITY_WELL", + "NEBULA" ] } \ No newline at end of file diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 226b61d..db58ee0 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -1,334 +1,45 @@ { - "openapi": "3.0.0", + "components": { + "requestBodies": {}, + "schemas": {}, + "securitySchemes": { + "AgentToken": { + "description": "When you register a new agent you will be granted a private bearer token which grants authorization to use the API.", + "scheme": "bearer", + "type": "http" + } + } + }, "info": { - "title": "SpaceTraders API", - "version": "2.0.0-rc.2", "contact": { - "name": "Joel Brubaker", - "email": "joel@spacetraders.io" + "email": "joel@spacetraders.io", + "name": "Joel Brubaker" }, + "description": "SpaceTraders is a multiplayer sci-fi strategy game where you acquire and manage a fleet of ships across a growing and dynamic universe.\n\nSimilar to games such as Eve Online, you work with or against other players to establish trade routes, chart new systems, mine precious ores, patrol for pirates, spy on factions, and discover hidden treasures.\n\nSpaceTraders as a game is unique in that it is entirely accessible through open and well-documented API endpoints.\n\nIf this sounds fun and interesting to you, please drop into our Discord and get to know the community. We are actively working on new clients, new ideas and sharing tips for how to play the game.\n\n\n```json http\n{\n \"method\": \"GET\",\n \"url\": \"https://api-server-2-0-0-rc-2-vxxwq5xqdq-uc.a.run.app\",\n}\n```", "license": { "name": "No Permission", "url": "https://choosealicense.com/no-permission/" }, - "description": "SpaceTraders is a multiplayer sci-fi strategy game where you acquire and manage a fleet of ships across a growing and dynamic universe.\n\nSimilar to games such as Eve Online, you work with or against other players to establish trade routes, chart new systems, mine precious ores, patrol for pirates, spy on factions, and discover hidden treasures.\n\nSpaceTraders as a game is unique in that it is entirely accessible through open and well-documented API endpoints.\n\nIf this sounds fun and interesting to you, please drop into our Discord and get to know the community. We are actively working on new clients, new ideas and sharing tips for how to play the game.\n\n\n```json http\n{\n \"method\": \"GET\",\n \"url\": \"https://api-server-2-0-0-rc-2-vxxwq5xqdq-uc.a.run.app\",\n}\n```" + "title": "SpaceTraders API", + "version": "2.0.0-rc.2" }, - "servers": [ - { - "url": "https://api-server-2-0-0-rc-2-vxxwq5xqdq-uc.a.run.app", - "description": "v2.0.0-rc.2" - } - ], + "openapi": "3.0.0", "paths": { - "/register": { - "post": { - "summary": "Register New Agent", - "tags": [], - "responses": { - "201": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "token": { - "type": "string", - "description": "A Bearer token for accessing secured API endpoints." - }, - "agent": { - "$ref": "../models/Agent.json" - }, - "faction": { - "$ref": "../models/Faction.json" - }, - "contract": { - "$ref": "../models/Contract.json" - }, - "ship": { - "$ref": "../models/Ship.json" - } - } - } - } - } - } - } - } - }, - "operationId": "register", - "description": "Creates a new agent and ties it to a temporary Account. Use `COMMERCE_REPUBLIC` as your starting faction if you don't know any other factions to choose from.\n\nThe agent symbol is a 4-8 character string that will represent your agent. This symbol will prefix the symbol of every ship you own. Agent symbols will be cast to all uppercase characters.\n\nA new agent will be granted an authorization token, a contract with their starting faction, a command ship with a jump drive, and one hundred thousand credits.\n\n> #### Keep your token safe and secure\n>\n> Save your token during the alpha phase. There is no way to regenerate this token without starting a new agent. In the future you will be able to generate and manage your tokens from the SpaceTraders website.\n\nYou can accept your contract using the `/my/contracts/{contractId}/accept` endpoint. You will want to navigate your command ship to a nearby asteroid field waypoint, and execute the `/my/ships/{shipSymbol}/accept` endpoint to mine various types of ores and minerals.\n\nReturn to the contract destination and execute the `/my/ships/{shipSymbol}/deliver` endpoint to deposit goods into the contract.\n\nWhen your contract is fulfilled, you can call `/my/contracts/{contractId}/fulfill` to retrieve payment.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "How other agents will see your ships and information.", - "minLength": 4, - "maxLength": 8, - "example": "BADGER" - }, - "faction": { - "type": "string", - "default": "COMMERCE_REPUBLIC", - "description": "The faction you choose determines your headquarters." - } - } - } - } - }, - "description": "" - } - } - }, - "/my/agent": { + "/factions": { "get": { - "summary": "My Agent Details", - "tags": [ - "agents" - ], + "description": "List all discovered factions in the game.", + "operationId": "get-factions", "responses": { "200": { - "description": "OK", "content": { "application/json": { "schema": { - "type": "object", "properties": { "data": { - "$ref": "../models/Agent.json" - } - } - }, - "examples": { - "Agent": { - "value": { - "data": { - "accountId": "cl0hok34m0003ks0jjql5q8f2", - "symbol": "EMBER", - "headquarters": "X1-OE-PM", - "credits": 0 - } - } - } - } - } - } - } - }, - "operationId": "get-my-agent", - "security": [ - { - "AgentToken": [] - } - ], - "description": "Fetch your agent's details." - } - }, - "/my/ships": { - "get": { - "summary": "List Ships", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": [ - { - "symbol": "653298-1", - "crew": null, - "officers": null, - "frame": "FRAME_DRONE", - "reactor": "REACTOR_SOLAR_I", - "engine": "ENGINE_SOLAR_PROPULSION", - "modules": [ - "MODULE_CARGO_HOLD" - ], - "mounts": [ - "MOUNT_MINING_LASER_I" - ], - "registration": { - "factionSymbol": "COMMERCE_REPUBLIC", - "agentSymbol": "653298", - "fee": 100, - "role": "EXCAVATOR" - }, - "integrity": { - "frame": 1, - "reactor": 1, - "engine": 1 - }, - "status": "DOCKED", - "location": "X1-OE-PM", - "cargo": [] - }, - { - "symbol": "653298-2", - "crew": null, - "officers": null, - "frame": "FRAME_DRONE", - "reactor": "REACTOR_SOLAR_I", - "engine": "ENGINE_SOLAR_PROPULSION", - "modules": [ - "MODULE_CARGO_HOLD" - ], - "mounts": [ - "MOUNT_MINING_LASER_I" - ], - "registration": { - "factionSymbol": "COMMERCE_REPUBLIC", - "agentSymbol": "653298", - "fee": 100, - "role": "EXCAVATOR" - }, - "integrity": { - "frame": 1, - "reactor": 1, - "engine": 1 - }, - "status": "DOCKED", - "location": "X1-OE-PM", - "cargo": [] - }, - { - "symbol": "653298-3", - "crew": null, - "officers": null, - "frame": "FRAME_DRONE", - "reactor": "REACTOR_SOLAR_I", - "engine": "ENGINE_SOLAR_PROPULSION", - "modules": [ - "MODULE_CARGO_HOLD" - ], - "mounts": [ - "MOUNT_MINING_LASER_I" - ], - "registration": { - "factionSymbol": "COMMERCE_REPUBLIC", - "agentSymbol": "653298", - "fee": 100, - "role": "EXCAVATOR" - }, - "integrity": { - "frame": 1, - "reactor": 1, - "engine": 1 - }, - "status": "DOCKED", - "location": "X1-OE-PM", - "cargo": [] - }, - { - "symbol": "653298-4", - "crew": null, - "officers": null, - "frame": "FRAME_DRONE", - "reactor": "REACTOR_SOLAR_I", - "engine": "ENGINE_SOLAR_PROPULSION", - "modules": [ - "MODULE_CARGO_HOLD" - ], - "mounts": [ - "MOUNT_MINING_LASER_I" - ], - "registration": { - "factionSymbol": "COMMERCE_REPUBLIC", - "agentSymbol": "653298", - "fee": 100, - "role": "EXCAVATOR" - }, - "integrity": { - "frame": 1, - "reactor": 1, - "engine": 1 - }, - "status": "DOCKED", - "location": "X1-OE-PM", - "cargo": [] - }, - { - "symbol": "653298-5", - "crew": null, - "officers": null, - "frame": "FRAME_DRONE", - "reactor": "REACTOR_SOLAR_I", - "engine": "ENGINE_SOLAR_PROPULSION", - "modules": [ - "MODULE_CARGO_HOLD" - ], - "mounts": [ - "MOUNT_MINING_LASER_I" - ], - "registration": { - "factionSymbol": "COMMERCE_REPUBLIC", - "agentSymbol": "653298", - "fee": 100, - "role": "EXCAVATOR" - }, - "integrity": { - "frame": 1, - "reactor": 1, - "engine": 1 - }, - "status": "DOCKED", - "location": "X1-OE-PM", - "cargo": [] - }, - { - "symbol": "653298-6", - "crew": null, - "officers": null, - "frame": "FRAME_DRONE", - "reactor": "REACTOR_SOLAR_I", - "engine": "ENGINE_SOLAR_PROPULSION", - "modules": [ - "MODULE_CARGO_HOLD" - ], - "mounts": [ - "MOUNT_MINING_LASER_I" - ], - "registration": { - "factionSymbol": "COMMERCE_REPUBLIC", - "agentSymbol": "653298", - "fee": 100, - "role": "EXCAVATOR" - }, - "integrity": { - "frame": 1, - "reactor": 1, - "engine": 1 - }, - "status": "DOCKED", - "location": "X1-OE-PM", - "cargo": [] - } - ], - "meta": { - "total": 6, - "page": 1, - "limit": 20 - } - } - }, - "properties": { - "data": { - "type": "array", - "uniqueItems": true, - "minItems": 1, "items": { - "$ref": "../models/Ship.json" - } + "$ref": "../models/Faction.json" + }, + "type": "array" }, "meta": { "$ref": "../models/Meta.json" @@ -337,170 +48,503 @@ "required": [ "data", "meta" - ] + ], + "type": "object" } } - } + }, + "description": "" + } + }, + "summary": "List Factions", + "tags": [ + "factions" + ] + } + }, + "/factions/{factionSymbol}": { + "get": { + "description": "View the details of a faction.", + "operationId": "get-faction", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "$ref": "../models/Faction.json" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "summary": "Get Faction", + "tags": [ + "factions" + ] + }, + "parameters": [ + { + "description": "The faction symbol", + "in": "path", + "name": "factionSymbol", + "required": true, + "schema": { + "default": "CGR", + "type": "string" + } + } + ] + }, + "/my/agent": { + "get": { + "description": "Fetch your agent's details.", + "operationId": "get-my-agent", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "$ref": "../models/Agent.json" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" } }, - "operationId": "list-my-ships", - "description": "Retrieve all of your ships.", "security": [ { "AgentToken": [] } ], + "summary": "My Agent Details", + "tags": [ + "agents" + ] + } + }, + "/my/contracts": { + "get": { + "description": "List all of your contracts.", + "operationId": "get-contracts", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "items": { + "$ref": "../models/Contract.json" + }, + "type": "array" + }, + "meta": { + "$ref": "../models/Meta.json" + } + }, + "required": [ + "data", + "meta" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "List Contracts", + "tags": [ + "contracts" + ] + } + }, + "/my/contracts/{contractId}": { + "get": { + "description": "Get the details of a contract by ID.", + "operationId": "get-contract", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "$ref": "../models/Contract.json" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Get Contract", + "tags": [ + "contracts" + ] + }, + "parameters": [ + { + "description": "The contract ID", + "in": "path", + "name": "contractId", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/my/contracts/{contractId}/accept": { + "parameters": [ + { + "in": "path", + "name": "contractId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Accept a contract.", + "operationId": "accept-contract", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "agent": { + "$ref": "../models/Agent.json" + }, + "contract": { + "$ref": "../models/Contract.json" + } + }, + "required": [ + "contract", + "agent" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Accept Contract", + "tags": [ + "contracts" + ] + } + }, + "/my/contracts/{contractId}/deliver": { + "parameters": [ + { + "description": "The ID of the contract", + "in": "path", + "name": "contractId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Deliver cargo on a given contract.", + "operationId": "deliver-contract", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "shipSymbol": { + "type": "string" + }, + "tradeSymbol": { + "type": "string" + }, + "units": { + "type": "integer" + } + }, + "required": [ + "shipSymbol", + "tradeSymbol", + "units" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "contract": { + "$ref": "../models/Contract.json" + }, + "shipCargo": { + "$ref": "../models/ShipCargo.json" + } + }, + "required": [ + "contract", + "shipCargo" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Deliver Contract", + "tags": [ + "contracts" + ] + } + }, + "/my/contracts/{contractId}/fulfill": { + "parameters": [ + { + "description": "The ID of the contract", + "in": "path", + "name": "contractId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Fulfill a contract", + "operationId": "fulfill-contract", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "agent": { + "$ref": "../models/Agent.json" + }, + "contract": { + "$ref": "../models/Contract.json" + } + }, + "required": [ + "contract", + "agent" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Fulfill Contract", + "tags": [ + "contracts" + ] + } + }, + "/my/ships": { + "get": { + "description": "Retrieve all of your ships.", + "operationId": "get-my-ships", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "items": { + "$ref": "../models/Ship.json" + }, + "type": "array" + }, + "meta": { + "$ref": "../models/Meta.json" + } + }, + "required": [ + "data", + "meta" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "List Ships", "tags": [ "fleet" ] }, "post": { - "summary": "Purchase Ship", - "tags": [ - "fleet" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": { - "symbol": "4F4D44-1", - "crew": null, - "officers": null, - "fuel": 100, - "frame": "FRAME_DRONE", - "reactor": "REACTOR_SOLAR_I", - "engine": "ENGINE_SOLAR_PROPULSION", - "modules": [ - "MODULE_CARGO_HOLD" - ], - "mounts": [ - "MOUNT_MINING_LASER_I" - ], - "registration": { - "factionSymbol": "COMMERCE_REPUBLIC", - "agentSymbol": "4F4D44", - "fee": 100, - "role": "EXCAVATOR" - }, - "integrity": { - "frame": 1, - "reactor": 1, - "engine": 1 - }, - "status": "DOCKED", - "location": "X1-OE-PM", - "cargo": [] - } - } - }, - "properties": { - "data": { - "type": "object", - "properties": { - "ship": { - "$ref": "../models/Ship.json" - }, - "credits": { - "type": "integer" - } - } - } - }, - "required": [ - "data" - ] - } + "description": "Purchase a ship", + "operationId": "purchase-ship", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "description": "The ID of the ship you want to purchase.", + "type": "string" + } + }, + "required": [ + "id" + ], + "type": "object" } } } }, - "operationId": "purchase-ship", + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "agent": { + "$ref": "../models/Agent.json" + }, + "ship": { + "$ref": "../models/Ship.json" + } + }, + "required": [ + "ship", + "agent" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, "security": [ { "AgentToken": [] } ], - "description": "Purchase a ship", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The id of the shipyard listing you want to purchase." - } - } - } - } - } - } + "summary": "Purchase Ship", + "tags": [ + "fleet" + ] } }, "/my/ships/{shipSymbol}": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true - } - ], "get": { - "summary": "Get Ship", - "tags": [ - "fleet" - ], + "description": "Retrieve the details of your ship.", + "operationId": "get-my-ship", "responses": { "200": { - "description": "OK", "content": { "application/json": { "schema": { "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": { - "symbol": "653298-1", - "crew": null, - "officers": null, - "frame": "FRAME_DRONE", - "reactor": "REACTOR_SOLAR_I", - "engine": "ENGINE_SOLAR_PROPULSION", - "modules": [ - "MODULE_CARGO_HOLD" - ], - "mounts": [ - "MOUNT_MINING_LASER_I" - ], - "registration": { - "factionSymbol": "COMMERCE_REPUBLIC", - "agentSymbol": "653298", - "fee": 100, - "role": "EXCAVATOR" - }, - "integrity": { - "frame": 1, - "reactor": 1, - "engine": 1 - }, - "status": "DOCKED", - "location": "X1-OE-PM", - "cargo": [] - } - } - }, "properties": { "data": { "$ref": "../models/Ship.json" @@ -508,516 +552,415 @@ }, "required": [ "data" - ] + ], + "type": "object", + "x-examples": { + "example-1": { + "data": { + "cargo": [], + "crew": null, + "engine": "ENGINE_SOLAR_PROPULSION", + "frame": "FRAME_DRONE", + "integrity": { + "engine": 1, + "frame": 1, + "reactor": 1 + }, + "location": "X1-OE-PM", + "modules": [ + "MODULE_CARGO_HOLD" + ], + "mounts": [ + "MOUNT_MINING_LASER_I" + ], + "officers": null, + "reactor": "REACTOR_SOLAR_I", + "registration": { + "agentSymbol": "653298", + "factionSymbol": "COMMERCE_REPUBLIC", + "fee": 100, + "role": "EXCAVATOR" + }, + "status": "DOCKED", + "symbol": "653298-1" + } + } + } } } - } + }, + "description": "OK" } }, - "operationId": "get-my-ship", - "description": "Retrieve the details of your ship.", "security": [ { "AgentToken": [] } + ], + "summary": "Get Ship", + "tags": [ + "fleet" + ] + }, + "parameters": [ + { + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/my/ships/{shipSymbol}/chart": { + "parameters": [ + { + "description": "The symbol of the ship", + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Command a ship to chart the current waypoint.\n\nWaypoints in the universe are uncharted by default. These locations will not show up in the API until they have been charted by a ship.\n\nCharting a location will record your agent as the one who created the chart.", + "operationId": "create-chart", + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "chart": { + "$ref": "../models/Chart.json" + } + }, + "required": [ + "chart" + ], + "type": "object" + } + }, + "type": "object" + } + } + }, + "description": "Created" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Create Chart", + "tags": [ + "fleet" ] } }, "/my/ships/{shipSymbol}/cooldown": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true - } - ], "get": { - "summary": "Get Ship Cooldown", - "tags": [ - "fleet" - ], + "description": "Retrieve the details of your ship's reactor cooldown. Some actions such as activating your jump drive, scanning, or extracting resources taxes your reactor and results in a cooldown.\n\nYour ship cannot perform additional actions until your cooldown has expired. The duration of your cooldown is relative to the power consumption of the related modules or mounts for the action taken.", + "operationId": "get-ship-cooldown", "responses": { "200": { - "description": "OK", "content": { "application/json": { "schema": { "description": "", - "type": "object", "properties": { "data": { "$ref": "../models/Cooldown.json" } }, - "required": [ - "data" - ] - } - } - } - } - }, - "operationId": "get-ship-cooldown", - "description": "Retrieve the details of your ship's reactor cooldown. Some actions such as activating your jump drive, scanning, or extracting resources taxes your reactor and results in a cooldown.\n\nYour ship cannot perform additional actions until your cooldown has expired. The duration of your cooldown is relative to the power consumption of the related modules or mounts for the action taken.", - "security": [ - { - "AgentToken": [] - } - ] - } - }, - "/my/ships/{shipSymbol}/navigate": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true, - "description": "The ship symbol" - } - ], - "post": { - "summary": "Navigate Ship", - "tags": [ - "fleet" - ], - "responses": { - "201": { - "description": "The successful transit information including the route details and changes to ship fuel, supplies, and crew wages paid. The route includes the expected time of arrival.", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "route": { - "$ref": "../models/ShipNav.json" - }, - "shipFuel": { - "$ref": "../models/ShipFuel.json" - } - } - } - }, - "required": [ - "data" - ] - } - } - } - } - }, - "operationId": "navigate-ship", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "waypointSymbol": { - "type": "string", - "description": "The target destination." - } - }, - "required": [ - "waypointSymbol" - ] - } - } - }, - "description": "" - }, - "security": [ - { - "AgentToken": [] - } - ], - "description": "Navigate to a target destination. The destination must be located within the same system as the ship. Navigating will consume the necessary fuel and supplies from the ship's manifest, and will pay out crew wages from the agent's account.\n\nThe returned response will detail the route information including the expected time of arrival. Most ship actions are unavailable until the ship has arrived at it's destination.\n\nFor faster-than-light travel between systems, see the ship's jump action." - } - }, - "/my/ships/{shipSymbol}/jettison": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true - } - ], - "post": { - "summary": "Jettison Cargo", - "tags": [ - "fleet" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "tradeSymbol": { - "type": "string", - "minLength": 1 - }, - "units": { - "type": "integer" - } - }, - "required": [ - "tradeSymbol", - "units" - ] - } - }, "required": [ "data" ], - "x-examples": { - "example-1": { - "data": { - "tradeSymbol": "ALUMINUM", - "units": 95 - } - } - } - }, - "examples": { - "Success": { - "value": { - "data": { - "tradeSymbol": "ALUMINUM", - "units": 95 - } - } - } + "type": "object" } } - } + }, + "description": "OK" } }, - "operationId": "jettison", - "description": "Jettison cargo from your ship's cargo hold.", - "security": [ - { - "AgentToken": [] - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "tradeSymbol": { - "type": "string" - }, - "units": { - "type": "integer", - "minimum": 1 - } - } - } - } - } - } - } - }, - "/my/ships/{shipSymbol}/chart": { - "post": { - "summary": "Create Chart", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "submitted": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - }, - "examples": { - "Success": { - "value": { - "data": { - "submitted": [ - "X1-ZZ", - "X1-ZZ-7-EE" - ] - } - } - } - } - } - } - } - }, - "operationId": "create-chart", - "description": "Command a ship to chart the current system and/or waypoint.\n\nSystems and waypoints in the universe are uncharted by default. These locations will not show up in the API until they have been charted by a ship.\n\nCharting a location will record your agent as the one who created the chart.\n\nReturns an array of system / waypoint symbols that have been charted.", "security": [ { "AgentToken": [] } ], + "summary": "Get Ship Cooldown", "tags": [ "fleet" ] }, "parameters": [ { + "in": "path", + "name": "shipSymbol", + "required": true, "schema": { "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true, - "description": "The symbol of the ship" + } } ] }, - "/my/ships/{shipSymbol}/extract": { + "/my/ships/{shipSymbol}/deploy": { "parameters": [ { + "description": "The ship symbol", + "in": "path", + "name": "shipSymbol", + "required": true, "schema": { "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true, - "description": "The ship symbol" + } } ], "post": { - "summary": "Extract Resources", - "responses": { - "201": { - "description": "Created", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": { - "extraction": { - "shipSymbol": "4B902A-1", - "yield": { - "tradeSymbol": "SILICON", - "units": 16 - } - }, - "cooldown": { - "duration": 119, - "expiration": "2022-03-12T00:41:29.371Z" - } - } - } - }, - "properties": { - "data": { - "type": "object", - "required": [ - "extraction", - "cooldown" - ], - "properties": { - "extraction": { - "$ref": "../models/Extraction.json" - }, - "cooldown": { - "$ref": "../models/Cooldown.json" - } - } - } - }, - "required": [ - "data" - ] - } - } - } - } - }, - "operationId": "extract-resources", + "description": "Use this endpoint to deploy a Communications Relay to a waypoint. A waypoint with a communications relay will allow agents to retrieve price information from the market. Without a relay, agents must send a ship to a market to retrieve price information.\n\nCommunication relays can be purchased from a market that exports `COMM_RELAY_I`.", + "operationId": "deploy-asset", "requestBody": { "content": { "application/json": { "schema": { - "type": "object", "properties": { - "survey": { - "$ref": "../models/Survey.json" + "tradeSymbol": { + "type": "string" } - } + }, + "required": [ + "tradeSymbol" + ], + "type": "object" } } - }, - "description": "" + } + }, + "responses": { + "204": { + "description": "OK" + } }, - "description": "Extract resources from the waypoint into your ship. Send a survey as the payload to target specific yields. The entire survey must be sent as it contains a signature that the backend verifies.", "security": [ { "AgentToken": [] } ], + "summary": "Deploy Asset", "tags": [ "fleet" ] } }, - "/my/ships/{shipSymbol}/survey": { + "/my/ships/{shipSymbol}/dock": { "parameters": [ { + "description": "The symbol of the ship", + "in": "path", + "name": "shipSymbol", + "required": true, "schema": { "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true + } } ], "post": { - "summary": "Survey Waypoint", + "description": "Attempt to dock your ship at it's current location. Docking will only succeed if the waypoint is a dockable location, and your ship is capable of docking at the time of the request.\n\nThe endpoint is idempotent - successive calls will succeed even if the ship is already docked.", + "operationId": "dock-ship", "responses": { - "201": { - "description": "Created", + "200": { "content": { "application/json": { "schema": { "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": [ - { - "signature": "X1-OE-D2DD38", - "deposits": [ - "COPPER_ORE" - ], - "expiration": "2022-03-08T05:41:55.514Z" - }, - { - "signature": "X1-OE-B58FEB", - "deposits": [ - "ALUMINUM_ORE", - "ALUMINUM_ORE", - "ALUMINUM_ORE" - ], - "expiration": "2022-03-08T05:39:15.519Z" - }, - { - "signature": "X1-OE-0E326C", - "deposits": [ - "ALUMINUM_ORE", - "SILICON" - ], - "expiration": "2022-03-08T05:20:27.521Z" - }, - { - "signature": "X1-OE-5CDFA4", - "deposits": [ - "COPPER_ORE", - "COPPER_ORE", - "COPPER_ORE", - "IRON_ORE" - ], - "expiration": "2022-03-08T05:44:34.522Z" - }, - { - "signature": "X1-OE-86C3A1", - "deposits": [ - "COPPER_ORE", - "COPPER_ORE", - "IRON_ORE" - ], - "expiration": "2022-03-08T05:43:45.522Z" - }, - { - "signature": "X1-OE-C97BEA", - "deposits": [ - "ALUMINUM_ORE", - "COPPER_ORE", - "QUARTZ", - "QUARTZ" - ], - "expiration": "2022-03-08T05:22:39.523Z" - }, - { - "signature": "X1-OE-9913BD", - "deposits": [ - "QUARTZ" - ], - "expiration": "2022-03-08T05:37:45.523Z" - }, - { - "signature": "X1-OE-8D87D2", - "deposits": [ - "COPPER_ORE", - "SILICON" - ], - "expiration": "2022-03-08T05:32:57.524Z" - } - ] - } - }, "properties": { "data": { - "type": "object", "properties": { - "surveys": { - "type": "array", - "items": { - "$ref": "../models/Survey.json" - } - }, - "cooldown": { - "$ref": "../models/Cooldown.json" + "nav": { + "$ref": "../models/ShipNav.json" } - } + }, + "required": [ + "nav" + ], + "type": "object" } }, "required": [ "data" - ] + ], + "type": "object" } } - } + }, + "description": "The ship has successfully docked at it's current location." } }, - "operationId": "survey-waypoint", "security": [ { "AgentToken": [] } ], - "description": "If you want to target specific yields for an extraction, you can survey a waypoint, such as an asteroid field, and send the survey in the body of the extract request. Each survey may have multiple deposits, and if a symbol shows up more than once, that indicates a higher chance of extracting that resource.\n\nYour ship will enter a cooldown between consecutive survey requests. Surveys will eventually expire after a period of time. Multiple ships can use the same survey for extraction.", + "summary": "Dock Ship", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}/extract": { + "parameters": [ + { + "description": "The ship symbol", + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Extract resources from the waypoint into your ship. Send a survey as the payload to target specific yields. The entire survey must be sent as it contains a signature that the backend verifies.", + "operationId": "extract-resources", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "survey": { + "$ref": "../models/Survey.json" + } + }, + "required": [ + "survey" + ], + "type": "object" + } + } + }, + "description": "" + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "cooldown": { + "$ref": "../models/Cooldown.json" + }, + "extraction": { + "$ref": "../models/Extraction.json" + } + }, + "required": [ + "extraction", + "cooldown" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "Created" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Extract Resources", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}/jettison": { + "parameters": [ + { + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Jettison cargo from your ship's cargo hold.", + "operationId": "jettison", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "tradeSymbol": { + "type": "string" + }, + "units": { + "minimum": 1, + "type": "integer" + } + }, + "required": [ + "tradeSymbol", + "units" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "cargo": { + "$ref": "../models/ShipCargo.json" + } + }, + "required": [ + "cargo" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Jettison Cargo", "tags": [ "fleet" ] @@ -1026,502 +969,418 @@ "/my/ships/{shipSymbol}/jump": { "parameters": [ { + "in": "path", + "name": "shipSymbol", + "required": true, "schema": { "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true + } } ], "post": { - "summary": "Jump Ship", "description": "Jump your ship from one system to another.", - "tags": [ - "fleet" - ], + "operationId": "jump-ship", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "destination": { + "description": "The system symbol to jump to.", + "type": "string" + } + }, + "required": [ + "destination" + ], + "type": "object" + } + } + } + }, "responses": { "201": { - "description": "Created", "content": { "application/json": { "schema": { "description": "", - "type": "object", "properties": { "data": { - "type": "object", "properties": { - "route": { - "$ref": "../models/ShipNavRoute.json" - }, "cooldown": { "$ref": "../models/Cooldown.json" + }, + "nav": { + "$ref": "../models/ShipNav.json" } }, "required": [ "route", "cooldown" - ] - } - }, - "required": [ - "data" - ] - } - } - } - } - }, - "operationId": "jump-ship", - "security": [ - { - "AgentToken": [] - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "destination": { - "type": "string", - "description": "The system symbol to jump to." - } - } - } - } - } - } - } - }, - "/my/ships/{shipSymbol}/purchase": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true - } - ], - "post": { - "description": "Purchase cargo.", - "summary": "Purchase Cargo", - "tags": [ - "fleet" - ], - "responses": { - "201": { - "description": "Created", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "properties": { - "data": { - "properties": { - "transaction": { - "$ref": "../models/MarketTransaction.json" - } - } - } - }, - "required": [ - "data" - ] - } - } - } - } - }, - "operationId": "purchase-cargo", - "security": [ - { - "AgentToken": [] - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "tradeSymbol": { - "type": "string" - }, - "units": { - "type": "integer" - } - } - } - } - } - } - } - }, - "/my/ships/{shipSymbol}/sell": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true - } - ], - "post": { - "summary": "Sell Cargo", - "tags": [ - "fleet" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": { - "waypointSymbol": "X1-OE-PM", - "tradeSymbol": "SILICON", - "credits": 144, - "units": -1 - } - } - }, - "properties": { - "data": { - "properties": { - "transaction": { - "$ref": "../models/MarketTransaction.json" - } - } - } - }, - "required": [ - "data" - ] - } - } - } - } - }, - "operationId": "sell-cargo", - "description": "Sell cargo from your ship's hold to the local market.", - "security": [ - { - "AgentToken": [] - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "tradeSymbol": { - "type": "string" - }, - "units": { - "type": "integer" - } - } - } - } - }, - "description": "" - } - } - }, - "/my/ships/{shipSymbol}/refuel": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true - } - ], - "post": { - "summary": "Refuel Ship", - "tags": [ - "fleet" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "credits": { - "type": "integer" - }, - "fuel": { - "type": "integer" - } - }, - "required": [ - "credits", - "fuel" - ] + ], + "type": "object" } }, "required": [ "data" ], - "x-examples": { - "example-1": { - "data": { - "credits": 0, - "fuel": 0 - } - } - } - }, - "examples": { - "Success": { - "value": { - "data": { - "credits": -1920, - "fuel": 800 - } - } - } + "type": "object" } } - } + }, + "description": "Created" } }, - "operationId": "refuel-ship", "security": [ { "AgentToken": [] } + ], + "summary": "Jump Ship", + "tags": [ + "fleet" ] } }, - "/my/ships/{shipSymbol}/deploy": { + "/my/ships/{shipSymbol}/navigate": { "parameters": [ { + "description": "The ship symbol", + "in": "path", + "name": "shipSymbol", + "required": true, "schema": { "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true, - "description": "The ship symbol" + } } ], "post": { - "summary": "Deploy Asset", - "tags": [ - "fleet" - ], - "responses": { - "204": { - "description": "OK" - } - }, - "operationId": "deploy-asset", - "security": [ - { - "AgentToken": [] - } - ], - "description": "Use this endpoint to deploy a Communications Relay to a waypoint. A waypoint with a communications relay will allow agents to retrieve price information from the market. Without a relay, agents must send a ship to a market to retrieve price information.\n\nCommunication relays can be purchased from a market that exports `COMM_RELAY_I`.", + "description": "Navigate to a target destination. The destination must be located within the same system as the ship. Navigating will consume the necessary fuel and supplies from the ship's manifest, and will pay out crew wages from the agent's account.\n\nThe returned response will detail the route information including the expected time of arrival. Most ship actions are unavailable until the ship has arrived at it's destination.\n\nFor faster-than-light travel between systems, see the ship's jump action.", + "operationId": "navigate-ship", "requestBody": { "content": { "application/json": { "schema": { - "type": "object", "properties": { - "tradeSymbol": { + "waypointSymbol": { + "description": "The target destination.", "type": "string" } }, "required": [ - "tradeSymbol" - ] + "waypointSymbol" + ], + "type": "object" + } + } + }, + "description": "" + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "fuel": { + "$ref": "../models/ShipFuel.json" + }, + "nav": { + "$ref": "../models/ShipNav.json" + } + }, + "required": [ + "nav", + "fuel" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "The successful transit information including the route details and changes to ship fuel, supplies, and crew wages paid. The route includes the expected time of arrival." + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Navigate Ship", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}/orbit": { + "parameters": [ + { + "description": "The symbol of the ship", + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Attempt to move your ship into orbit at it's current location. The request will only succeed if your ship is capable of moving into orbit at the time of the request.\n\nThe endpoint is idempotent - successive calls will succeed even if the ship is already in orbit.", + "operationId": "orbit-ship", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "nav": { + "$ref": "../models/ShipNav.json" + } + }, + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "The ship has successfully moved into orbit at it's current location." + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Orbit Ship", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}/purchase": { + "parameters": [ + { + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Purchase cargo.", + "operationId": "purchase-cargo", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "tradeSymbol": { + "type": "string" + }, + "units": { + "type": "integer" + } + }, + "required": [ + "tradeSymbol", + "units" + ], + "type": "object" } } } + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "agent": { + "$ref": "../models/Agent.json" + }, + "cargo": { + "$ref": "../models/ShipCargo.json" + }, + "transaction": { + "$ref": "../models/MarketTransaction.json" + } + }, + "required": [ + "cargo", + "transaction", + "agent" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "Created" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Purchase Cargo", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}/refuel": { + "parameters": [ + { + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } } + ], + "post": { + "description": "Refuel your ship from the local market.", + "operationId": "refuel-ship", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "agent": { + "$ref": "../models/Agent.json" + }, + "fuel": { + "$ref": "../models/ShipFuel.json" + } + }, + "required": [ + "agent", + "fuel" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Refuel Ship", + "tags": [ + "fleet" + ] } }, "/my/ships/{shipSymbol}/scan": { "parameters": [ { + "in": "path", + "name": "shipSymbol", + "required": true, "schema": { "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true + } } ], "post": { - "summary": "Scan", - "tags": [ - "fleet" - ], + "description": "Activate your ship's sensor arrays to scan for arriving ships, departing ships, system information, or waypoint information. Send a scan mode to select the type of scan performed by your ship.", + "operationId": "create-ship-scan", + "requestBody": { + "content": { + "application/json": { + "examples": { + "Approaching Ships": { + "value": { + "mode": "APPROACHING_SHIPS" + } + }, + "Departing Ships": { + "value": { + "mode": "DEPARTING_SHIPS" + } + } + }, + "schema": { + "properties": { + "mode": { + "enum": [ + "APPROACHING_SHIPS", + "DEPARTING_SHIPS", + "WAYPOINT" + ], + "type": "string" + } + }, + "required": [ + "mode" + ], + "type": "object" + } + } + }, + "description": "" + }, "responses": { "201": { - "description": "Created", "content": { "application/json": { "schema": { "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": { - "ships": [ - { - "symbol": "COMMERCE_REPUBLIC-0060A0", - "registration": { - "factionSymbol": "COMMERCE_REPUBLIC", - "role": "EXCAVATOR" - }, - "frameSymbol": "FRAME_HEAVY_FREIGHTER", - "reactorSymbol": "REACTOR_FUSION_I", - "engineSymbol": "ENGINE_ION_DRIVE_I", - "expiration": "2022-03-08T05:20:14.725Z" - }, - { - "symbol": "ZANZIBAR_TRIKES-DF0AAF", - "registration": { - "factionSymbol": "ZANZIBAR_TRIKES", - "role": "HAULER" - }, - "frameSymbol": "FRAME_SHUTTLE", - "reactorSymbol": "REACTOR_FUSION_I", - "engineSymbol": "ENGINE_ION_DRIVE_II", - "expiration": "2022-03-08T05:20:00.725Z" - }, - { - "symbol": "ZANZIBAR_TRIKES-9B80BE", - "registration": { - "factionSymbol": "ZANZIBAR_TRIKES", - "role": "TRANSPORT" - }, - "frameSymbol": "FRAME_TRANSPORT", - "reactorSymbol": "REACTOR_FUSION_I", - "engineSymbol": "ENGINE_ION_DRIVE_I", - "expiration": "2022-03-08T05:20:06.725Z" - }, - { - "symbol": "COMMERCE_REPUBLIC-117520", - "registration": { - "factionSymbol": "COMMERCE_REPUBLIC", - "role": "HARVESTER" - }, - "frameSymbol": "FRAME_SHUTTLE", - "reactorSymbol": "REACTOR_FUSION_I", - "engineSymbol": "ENGINE_ION_DRIVE_II", - "expiration": "2022-03-08T05:19:55.725Z" - }, - { - "symbol": "SPACERS_GUILD-609AA5", - "registration": { - "factionSymbol": "SPACERS_GUILD", - "role": "HAULER" - }, - "frameSymbol": "FRAME_FRIGATE", - "reactorSymbol": "REACTOR_FUSION_I", - "engineSymbol": "ENGINE_ION_DRIVE_I", - "expiration": "2022-03-08T05:19:38.725Z" - }, - { - "symbol": "MINERS_COLLECTIVE-7AD322", - "registration": { - "factionSymbol": "MINERS_COLLECTIVE", - "role": "EXCAVATOR" - }, - "frameSymbol": "FRAME_SHUTTLE", - "reactorSymbol": "REACTOR_FUSION_I", - "engineSymbol": "ENGINE_ION_DRIVE_I", - "expiration": "2022-03-08T05:19:11.725Z" - }, - { - "symbol": "ZANZIBAR_TRIKES-AE6D78", - "registration": { - "factionSymbol": "ZANZIBAR_TRIKES", - "role": "HAULER" - }, - "frameSymbol": "FRAME_SHUTTLE", - "reactorSymbol": "REACTOR_FUSION_I", - "engineSymbol": "ENGINE_ION_DRIVE_II", - "expiration": "2022-03-08T05:20:44.725Z" - }, - { - "symbol": "SPACERS_GUILD-92828B", - "registration": { - "factionSymbol": "SPACERS_GUILD", - "role": "SURVEYOR" - }, - "frameSymbol": "FRAME_LIGHT_FREIGHTER", - "reactorSymbol": "REACTOR_FUSION_I", - "engineSymbol": "ENGINE_ION_DRIVE_II", - "expiration": "2022-03-08T05:20:49.726Z" - }, - { - "symbol": "ZANZIBAR_TRIKES-B5EAD1", - "registration": { - "factionSymbol": "ZANZIBAR_TRIKES", - "role": "TRANSPORT" - }, - "frameSymbol": "FRAME_TRANSPORT", - "reactorSymbol": "REACTOR_FUSION_I", - "engineSymbol": "ENGINE_ION_DRIVE_I", - "expiration": "2022-03-08T05:20:25.726Z" - }, - { - "symbol": "ZANZIBAR_TRIKES-6A4E0D", - "registration": { - "factionSymbol": "ZANZIBAR_TRIKES", - "role": "HAULER" - }, - "frameSymbol": "FRAME_EXPLORER", - "reactorSymbol": "REACTOR_FUSION_I", - "engineSymbol": "ENGINE_ION_DRIVE_II", - "expiration": "2022-03-08T05:19:19.726Z" - } - ], - "cooldown": 60 - } - } - }, "properties": { "data": { "oneOf": [ { "properties": { - "ships": { - "type": "array", - "uniqueItems": true, - "minItems": 1, - "items": { - "$ref": "../models/ScannedShip.json" - } - }, "cooldown": { "$ref": "../models/Cooldown.json" + }, + "ships": { + "items": { + "$ref": "../models/ScannedShip.json" + }, + "type": "array" } }, "required": [ @@ -1529,20 +1388,6 @@ "cooldown" ] }, - { - "properties": { - "cooldown": { - "$ref": "../models/Cooldown.json" - }, - "system": { - "$ref": "../models/System.json" - } - }, - "required": [ - "cooldown", - "system" - ] - }, { "properties": { "cooldown": { @@ -1563,337 +1408,44 @@ }, "required": [ "data" - ] + ], + "type": "object" } } - } + }, + "description": "Created" } }, - "operationId": "create-ship-scan", "security": [ { "AgentToken": [] } ], - "description": "Activate your ship's sensor arrays to scan for arriving ships, departing ships, system information, or waypoint information. Send a scan mode to select the type of scan performed by your ship.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "mode": { - "type": "string", - "enum": [ - "APPROACHING_SHIPS", - "DEPARTING_SHIPS", - "SYSTEM", - "WAYPOINT" - ] - } - }, - "required": [ - "mode" - ] - }, - "examples": { - "Approaching Ships": { - "value": { - "mode": "APPROACHING_SHIPS" - } - }, - "Departing Ships": { - "value": { - "mode": "APPROACHING_SHIPS" - } - } - } - } - }, - "description": "" - } - } - }, - "/my/ships/{shipSymbol}/dock": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true, - "description": "The symbol of the ship" - } - ], - "post": { - "summary": "Dock Ship", - "tags": [ - "fleet" - ], - "responses": { - "200": { - "description": "The ship has successfully docked at it's current location.", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": { - "status": "DOCKED" - } - } - }, - "properties": { - "data": { - "type": "object", - "required": [ - "status" - ], - "properties": { - "status": { - "$ref": "../models/ShipNavStatus.json" - } - } - } - }, - "required": [ - "data" - ] - }, - "examples": { - "Success": { - "value": { - "data": { - "status": "DOCKED" - } - } - } - } - } - } - } - }, - "operationId": "dock-ship", - "security": [ - { - "AgentToken": [] - } - ], - "description": "Attempt to dock your ship at it's current location. Docking will only succeed if the waypoint is a dockable location, and your ship is capable of docking at the time of the request.\n\nThe endpoint is idempotent - successive calls will succeed even if the ship is already docked." - } - }, - "/my/ships/{shipSymbol}/orbit": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "shipSymbol", - "in": "path", - "required": true, - "description": "The symbol of the ship" - } - ], - "post": { - "summary": "Orbit Ship", - "responses": { - "200": { - "description": "The ship has successfully moved into orbit at it's current location.", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": { - "status": "ORBIT" - } - } - }, - "properties": { - "data": { - "type": "object", - "properties": { - "status": { - "$ref": "../models/ShipNavStatus.json" - } - } - } - }, - "required": [ - "data" - ] - }, - "examples": { - "Success": { - "value": { - "data": { - "status": "IN_ORBIT" - } - } - } - } - } - } - } - }, - "operationId": "orbit-ship", - "security": [ - { - "AgentToken": [] - } - ], - "description": "Attempt to move your ship into orbit at it's current location. The request will only succeed if your ship is capable of moving into orbit at the time of the request.\n\nThe endpoint is idempotent - successive calls will succeed even if the ship is already in orbit.", + "summary": "Scan", "tags": [ "fleet" ] } }, - "/my/contracts": { - "get": { - "summary": "List Contracts", - "tags": [ - "contracts" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "properties": { - "data": { - "type": "array", - "uniqueItems": true, - "minItems": 1, - "items": { - "$ref": "../models/Contract.json" - } - }, - "meta": { - "$ref": "../models/Meta.json" - } - }, - "required": [ - "data", - "meta" - ] - } - } - } - } - }, - "operationId": "list-contracts", - "security": [ - { - "AgentToken": [] - } - ], - "description": "List all of your contracts." - } - }, - "/my/contracts/{contractId}": { + "/my/ships/{shipSymbol}/sell": { "parameters": [ { + "in": "path", + "name": "shipSymbol", + "required": true, "schema": { "type": "string" - }, - "name": "contractId", - "in": "path", - "required": true, - "description": "The contract ID" - } - ], - "get": { - "summary": "Get Contract", - "tags": [ - "contracts" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "../models/Contract.json" - } - } - } - } - } } - }, - "operationId": "get-contract", - "security": [ - { - "AgentToken": [] - } - ], - "description": "Get the details of a contract by ID." - } - }, - "/my/contracts/{contractId}/deliver": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "contractId", - "in": "path", - "required": true, - "description": "The ID of the contract" } ], "post": { - "summary": "Deliver Contract", - "tags": [ - "contracts" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "properties": { - "data": { - "$ref": "../models/ContractProcurement.json" - } - }, - "required": [ - "data" - ] - } - } - } - } - }, - "operationId": "deliver-contract", - "security": [ - { - "AgentToken": [] - } - ], + "description": "Sell cargo from your ship's hold to the local market.", + "operationId": "sell-cargo", "requestBody": { "content": { "application/json": { "schema": { - "type": "object", "properties": { - "shipSymbol": { - "type": "string" - }, "tradeSymbol": { "type": "string" }, @@ -1902,179 +1454,221 @@ } }, "required": [ - "contractId", - "tradeSymbol" - ] + "tradeSymbol", + "units" + ], + "type": "object" } } - } - }, - "description": "Deliver cargo on a given contract." - } - }, - "/my/contracts/{contractId}/accept": { - "parameters": [ - { - "schema": { - "type": "string" }, - "name": "contractId", - "in": "path", - "required": true - } - ], - "post": { - "summary": "Accept Contract", - "tags": [ - "contracts" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "../models/Contract.json" - } - } - } - } - } - } + "description": "" }, - "operationId": "accept-contract", - "security": [ - { - "AgentToken": [] - } - ], - "description": "Accept a contract." - } - }, - "/my/contracts/{contractId}/fulfill": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "contractId", - "in": "path", - "required": true - } - ], - "post": { - "summary": "Fulfill Contract", - "tags": [ - "contracts" - ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "../models/Contract.json" - } - } - } - } - } - } - }, - "operationId": "fulfill-contract", - "security": [ - { - "AgentToken": [] - } - ], - "description": "Fulfill a contract." - } - }, - "/systems": { - "get": { - "summary": "List Systems", - "tags": [ - "systems" - ], - "responses": { - "200": { - "description": "OK", "content": { "application/json": { "schema": { "description": "", - "type": "object", - "x-examples": { - "example-1": { - "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, - "chartedBy": null - }, - { - "symbol": "X1-EV", - "sector": "X1", - "type": "ORANGE_STAR", - "x": 3, - "y": 4, - "waypoints": [ - "X1-EV-A004" - ], - "factions": [ - "COMMERCE_REPUBLIC" - ], - "charted": true, - "chartedBy": null - }, - { - "symbol": "X1-ZZ", - "sector": "X1", - "type": "BLUE_STAR", - "x": -2, - "y": 11, - "waypoints": [], - "factions": [], - "charted": false, - "chartedBy": null - } - ], - "meta": { - "total": 3, - "page": 1, - "limit": 20 - } - } - }, "properties": { "data": { - "type": "array", - "uniqueItems": true, - "minItems": 1, + "properties": { + "agent": { + "$ref": "../models/Agent.json" + }, + "cargo": { + "$ref": "../models/ShipCargo.json" + }, + "transaction": { + "$ref": "../models/MarketTransaction.json" + } + }, + "required": [ + "agent", + "cargo", + "transaction" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Sell Cargo", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}/survey": { + "parameters": [ + { + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "If you want to target specific yields for an extraction, you can survey a waypoint, such as an asteroid field, and send the survey in the body of the extract request. Each survey may have multiple deposits, and if a symbol shows up more than once, that indicates a higher chance of extracting that resource.\n\nYour ship will enter a cooldown between consecutive survey requests. Surveys will eventually expire after a period of time. Multiple ships can use the same survey for extraction.", + "operationId": "survey-waypoint", + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "cooldown": { + "$ref": "../models/Cooldown.json" + }, + "surveys": { + "items": { + "$ref": "../models/Survey.json" + }, + "type": "array" + } + }, + "required": [ + "surveys", + "cooldown" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "Created" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Survey Waypoint", + "tags": [ + "fleet" + ] + } + }, + "/register": { + "post": { + "description": "Creates a new agent and ties it to a temporary Account. Use `COMMERCE_REPUBLIC` as your starting faction if you don't know any other factions to choose from.\n\nThe agent symbol is a 4-8 character string that will represent your agent. This symbol will prefix the symbol of every ship you own. Agent symbols will be cast to all uppercase characters.\n\nA new agent will be granted an authorization token, a contract with their starting faction, a command ship with a jump drive, and one hundred thousand credits.\n\n> #### Keep your token safe and secure\n>\n> Save your token during the alpha phase. There is no way to regenerate this token without starting a new agent. In the future you will be able to generate and manage your tokens from the SpaceTraders website.\n\nYou can accept your contract using the `/my/contracts/{contractId}/accept` endpoint. You will want to navigate your command ship to a nearby asteroid field waypoint, and execute the `/my/ships/{shipSymbol}/accept` endpoint to mine various types of ores and minerals.\n\nReturn to the contract destination and execute the `/my/ships/{shipSymbol}/deliver` endpoint to deposit goods into the contract.\n\nWhen your contract is fulfilled, you can call `/my/contracts/{contractId}/fulfill` to retrieve payment.", + "operationId": "register", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "faction": { + "default": "COMMERCE_REPUBLIC", + "description": "The faction you choose determines your headquarters.", + "type": "string" + }, + "symbol": { + "description": "How other agents will see your ships and information.", + "example": "BADGER", + "maxLength": 8, + "minLength": 4, + "type": "string" + } + }, + "required": [ + "symbol", + "faction" + ], + "type": "object" + } + } + }, + "description": "" + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "agent": { + "$ref": "../models/Agent.json" + }, + "contract": { + "$ref": "../models/Contract.json" + }, + "faction": { + "$ref": "../models/Faction.json" + }, + "ship": { + "$ref": "../models/Ship.json" + }, + "token": { + "description": "A Bearer token for accessing secured API endpoints.", + "type": "string" + } + }, + "required": [ + "token", + "agent", + "faction", + "contract", + "ship" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "summary": "Register New Agent", + "tags": [] + } + }, + "/systems": { + "get": { + "description": "Return a list of all systems.", + "operationId": "get-systems", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { "items": { "$ref": "../models/System.json" - } + }, + "type": "array" }, "meta": { "$ref": "../models/Meta.json" @@ -2083,62 +1677,35 @@ "required": [ "data", "meta" - ] + ], + "type": "object" } } - } + }, + "description": "OK" } }, - "operationId": "get-systems", - "description": "Return a list of all systems.", "security": [ { "AgentToken": [] } + ], + "summary": "List Systems", + "tags": [ + "systems" ] } }, "/systems/{systemSymbol}": { - "parameters": [ - { - "schema": { - "type": "string", - "default": "X1-OE" - }, - "name": "systemSymbol", - "in": "path", - "required": true, - "description": "The system symbol" - } - ], "get": { - "summary": "Get System", - "tags": [ - "systems" - ], + "description": "Get the details of a system.", + "operationId": "get-system", "responses": { "200": { - "description": "OK", "content": { "application/json": { "schema": { "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": { - "symbol": "X1-ZZ", - "sector": "X1", - "type": "BLUE_STAR", - "x": -2, - "y": 9, - "waypoints": [], - "factions": [], - "charted": false, - "chartedBy": null - } - } - }, "properties": { "data": { "$ref": "../models/System.json" @@ -2146,312 +1713,156 @@ }, "required": [ "data" - ] + ], + "type": "object" } } - } + }, + "description": "OK" } }, - "operationId": "get-system", "security": [ { "AgentToken": [] } + ], + "summary": "Get System", + "tags": [ + "systems" ] - } - }, - "/systems/{systemSymbol}/waypoints": { + }, "parameters": [ { - "schema": { - "type": "string" - }, - "name": "systemSymbol", + "description": "The system symbol", "in": "path", + "name": "systemSymbol", "required": true, - "description": "The system symbol" + "schema": { + "default": "X1-OE", + "type": "string" + } } - ], + ] + }, + "/systems/{systemSymbol}/waypoints": { "get": { + "description": "Fetch all of the waypoints for a given system. System must be charted or a ship must be present to return waypoint details.", + "operationId": "get-system-waypoints", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "items": { + "$ref": "../models/Waypoint.json" + }, + "type": "array" + }, + "meta": { + "$ref": "../models/Meta.json" + } + }, + "required": [ + "data", + "meta" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], "summary": "List Waypoints", "tags": [ "systems" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "x-examples": { - "example-1": { - "data": [ - { - "system": "X1-OE", - "symbol": "X1-OE-PM", - "type": "PLANET", - "x": 10, - "y": 5, - "orbitals": [ - "X1-OE-PM01" - ], - "faction": "COMMERCE_REPUBLIC", - "features": [ - "MARKETPLACE", - "SHIPYARD" - ], - "traits": [ - "OVERCROWDED", - "HIGH_TECH", - "BUREAUCRATIC", - "TRADING_HUB", - "TEMPERATE" - ], - "charted": true, - "chartedBy": null - }, - { - "system": "X1-OE", - "symbol": "X1-OE-PM01", - "type": "MOON", - "x": 10, - "y": 5, - "orbitals": [], - "faction": "COMMERCE_REPUBLIC", - "features": [ - "MARKETPLACE" - ], - "traits": [ - "WEAK_GRAVITY" - ], - "charted": true, - "chartedBy": null - }, - { - "system": "X1-OE", - "symbol": "X1-OE-A005", - "type": "ASTEROID_FIELD", - "x": -1, - "y": -29, - "orbitals": [], - "faction": "MINERS_COLLECTIVE", - "features": [], - "traits": [ - "COMMON_METAL_DEPOSITS" - ], - "charted": true, - "chartedBy": null - }, - { - "system": "X1-OE", - "symbol": "X1-OE-25X", - "type": "JUMP_GATE", - "x": -38, - "y": 47, - "orbitals": [], - "faction": "SPACERS_GUILD", - "features": [], - "traits": [], - "charted": true, - "chartedBy": null - } - ], - "meta": { - "total": 4, - "page": 1, - "limit": 20 - } - } - }, - "properties": { - "data": { - "type": "array", - "uniqueItems": true, - "minItems": 1, - "items": { - "$ref": "../models/Waypoint.json" - } - }, - "meta": { - "$ref": "../models/Meta.json" - } - }, - "required": [ - "data", - "meta" - ] - } - } - } - } - }, - "operationId": "get-system-waypoints", - "security": [ - { - "AgentToken": [] - } - ], - "description": "Fetch all of the waypoints for a given system. System must be charted or a ship must be present to return waypoint details." - } - }, - "/systems/{systemSymbol}/waypoints/{waypointSymbol}": { + ] + }, "parameters": [ { - "schema": { - "type": "string" - }, + "description": "The system symbol", + "in": "path", "name": "systemSymbol", - "in": "path", "required": true, - "description": "The system symbol" - }, - { "schema": { "type": "string" - }, - "name": "waypointSymbol", - "in": "path", - "required": true, - "description": "The waypoint symbol" + } } - ], + ] + }, + "/systems/{systemSymbol}/waypoints/{waypointSymbol}": { "get": { - "summary": "Get Waypoint", - "tags": [ - "systems" - ], + "description": "View the details of a waypoint.", + "operationId": "get-waypoint", "responses": { "200": { - "description": "OK", "content": { "application/json": { "schema": { "description": "", - "type": "object", "properties": { "data": { "$ref": "../models/Waypoint.json" - }, - "meta": { - "$ref": "../models/Meta.json" } }, "required": [ - "data", - "meta" - ] + "data" + ], + "type": "object" } } - } + }, + "description": "OK" } }, - "operationId": "get-waypoint", - "security": [ - { - "AgentToken": [] - } - ], - "description": "View the details of a waypoint." - } - }, - "/systems/{systemSymbol}/waypoints/{waypointSymbol}/shipyard": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "systemSymbol", - "in": "path", - "required": true, - "description": "The system symbol" - }, - { - "schema": { - "type": "string" - }, - "name": "waypointSymbol", - "in": "path", - "required": true, - "description": "The waypoint symbol" - } - ], - "get": { - "summary": "Get Shipyard", - "description": "", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "description": "", - "type": "object", - "properties": { - "data": { - "type": "array", - "uniqueItems": true, - "minItems": 1, - "items": { - "$ref": "../models/Shipyard.json" - } - }, - "meta": { - "$ref": "../models/Meta.json" - } - }, - "required": [ - "data", - "meta" - ] - } - } - } - } - }, - "operationId": "get-shipyard", "security": [ { "AgentToken": [] } ], + "summary": "Get Waypoint", "tags": [ "systems" ] - } - }, - "/systems/{systemSymbol}/waypoints/{waypointSymbol}/market": { + }, "parameters": [ { + "description": "The system symbol", + "in": "path", + "name": "systemSymbol", + "required": true, "schema": { "type": "string" - }, - "name": "systemSymbol", - "in": "path", - "required": true, - "description": "The system symbol" + } }, { + "description": "The waypoint symbol", + "in": "path", + "name": "waypointSymbol", + "required": true, "schema": { "type": "string" - }, - "name": "waypointSymbol", - "in": "path", - "required": true, - "description": "The waypoint symbol" + } } - ], + ] + }, + "/systems/{systemSymbol}/waypoints/{waypointSymbol}/market": { "get": { - "summary": "Get Market", + "description": "Retrieve imports, exports and exchange data from a marketplace. Imports can be sold, exports can be purchased, and exchange trades can be purchased or sold.\n\nMarket data is only available if you have a ship at the location, or the location is charted and has a communications relay deployed.\n\nSee `/my/ships/{shipSymbol}/deploy` for deploying relays at a location.", + "operationId": "get-market", "responses": { "200": { - "description": "OK", "content": { "application/json": { "schema": { - "description": "", - "type": "object", "properties": { "data": { "$ref": "../models/Market.json" @@ -2459,98 +1870,133 @@ }, "required": [ "data" - ] + ], + "type": "object" } } - } + }, + "description": "OK" } }, - "operationId": "get-market", - "description": "Retrieve imports, exports and exchange data from a marketplace. Imports can be sold, exports can be purchased, and exchange trades can be purchased or sold.\n\nMarket data is only available if you have a ship at the location, or the location is charted and has a communications relay deployed.\n\nSee `/my/ships/{shipSymbol}/deploy` for deploying relays at a location.", "security": [ { "AgentToken": [] } ], + "summary": "Get Market", "tags": [ "systems" ] - } - }, - "/factions": { - "get": { - "summary": "List Factions", - "description": "List all discovered factions in the game.", - "tags": [ - "factions" - ], - "operationId": "list-factions", - "responses": { - "200": { - "description": "" - } - } - } - }, - "/factions/{factionSymbol}": { + }, "parameters": [ { - "schema": { - "type": "string", - "default": "CGR" - }, - "name": "factionSymbol", + "description": "The system symbol", "in": "path", + "name": "systemSymbol", "required": true, - "description": "The faction symbol" - } - ], - "get": { - "summary": "Get Faction", - "tags": [ - "factions" - ], - "operationId": "get-faction", - "description": "View the details of a faction.", - "responses": { - "200": { - "description": "" + "schema": { + "type": "string" + } + }, + { + "description": "The waypoint symbol", + "in": "path", + "name": "waypointSymbol", + "required": true, + "schema": { + "type": "string" } } - } + ] + }, + "/systems/{systemSymbol}/waypoints/{waypointSymbol}/shipyard": { + "get": { + "description": "Get the shipyard for a waypoint.", + "operationId": "get-shipyard", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "$ref": "../models/Shipyard.json" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Get Shipyard", + "tags": [ + "systems" + ] + }, + "parameters": [ + { + "description": "The system symbol", + "in": "path", + "name": "systemSymbol", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The waypoint symbol", + "in": "path", + "name": "waypointSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ] } }, - "tags": [ - { - "name": "factions" - }, - { - "name": "fleet" - }, - { - "name": "contracts" - }, - { - "name": "systems" - }, - { - "name": "agents" - } - ], - "components": { - "schemas": {}, - "securitySchemes": { - "AgentToken": { - "type": "http", - "scheme": "bearer", - "description": "When you register a new agent you will be granted a private bearer token which grants authorization to use the API." - } - }, - "requestBodies": {} - }, "security": [ { "AgentToken": [] } + ], + "servers": [ + { + "description": "v2.0.0-rc.2", + "url": "https://api-server-2-0-0-rc-2-vxxwq5xqdq-uc.a.run.app" + } + ], + "tags": [ + { + "description": "Factions", + "name": "factions" + }, + { + "description": "Fleet", + "name": "fleet" + }, + { + "description": "Contracts", + "name": "contracts" + }, + { + "description": "Systems", + "name": "systems" + }, + { + "description": "Agents", + "name": "agents" + } ] } \ No newline at end of file From 02d6f5da093fe88ccff5a99f639d9ac0ad3bce7d Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Thu, 27 Oct 2022 21:18:44 -0700 Subject: [PATCH 15/48] add a no cooldown response --- reference/SpaceTraders.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index db58ee0..eb54db0 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -666,7 +666,7 @@ }, "/my/ships/{shipSymbol}/cooldown": { "get": { - "description": "Retrieve the details of your ship's reactor cooldown. Some actions such as activating your jump drive, scanning, or extracting resources taxes your reactor and results in a cooldown.\n\nYour ship cannot perform additional actions until your cooldown has expired. The duration of your cooldown is relative to the power consumption of the related modules or mounts for the action taken.", + "description": "Retrieve the details of your ship's reactor cooldown. Some actions such as activating your jump drive, scanning, or extracting resources taxes your reactor and results in a cooldown.\n\nYour ship cannot perform additional actions until your cooldown has expired. The duration of your cooldown is relative to the power consumption of the related modules or mounts for the action taken.\n\nResponse returns a 204 status code (no-content) when the ship has no cooldown.", "operationId": "get-ship-cooldown", "responses": { "200": { @@ -687,6 +687,9 @@ } }, "description": "OK" + }, + "204": { + "description": "No cooldown" } }, "security": [ From 905cf01de826aa9c321c24ddc6f888e54f6661dc Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Sat, 29 Oct 2022 11:23:05 -0700 Subject: [PATCH 16/48] clean up trade symbols --- models/ContractDeliverGood.json | 4 ++-- reference/SpaceTraders.json | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/models/ContractDeliverGood.json b/models/ContractDeliverGood.json index 02e1377..c0a452f 100644 --- a/models/ContractDeliverGood.json +++ b/models/ContractDeliverGood.json @@ -2,7 +2,7 @@ "description": "The details of a delivery contract. Includes the type of good, units needed, and the destination.", "type": "object", "properties": { - "tradeSymbol": { + "symbol": { "type": "string", "description": "The symbol of the trade good to deliver.", "minLength": 1 @@ -22,7 +22,7 @@ } }, "required": [ - "tradeSymbol", + "symbol", "destinationSymbol", "unitsRequired", "unitsFulfilled" diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index eb54db0..74afd65 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -733,12 +733,12 @@ "application/json": { "schema": { "properties": { - "tradeSymbol": { + "symbol": { "type": "string" } }, "required": [ - "tradeSymbol" + "symbol" ], "type": "object" } @@ -912,7 +912,7 @@ "application/json": { "schema": { "properties": { - "tradeSymbol": { + "symbol": { "type": "string" }, "units": { @@ -921,7 +921,7 @@ } }, "required": [ - "tradeSymbol", + "symbol", "units" ], "type": "object" @@ -1194,7 +1194,7 @@ "application/json": { "schema": { "properties": { - "tradeSymbol": { + "symbol": { "type": "string" }, "units": { @@ -1202,7 +1202,7 @@ } }, "required": [ - "tradeSymbol", + "symbol", "units" ], "type": "object" @@ -1449,7 +1449,7 @@ "application/json": { "schema": { "properties": { - "tradeSymbol": { + "symbol": { "type": "string" }, "units": { @@ -1457,7 +1457,7 @@ } }, "required": [ - "tradeSymbol", + "symbol", "units" ], "type": "object" From 20f67e68b55eb235119d8dfb1bdc4e5a80f0750d Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Tue, 15 Nov 2022 21:55:50 -0800 Subject: [PATCH 17/48] fixes to the docs for api updates --- models/MarketTransaction.json | 10 +- models/ShipReactor.json | 1 - models/ShipRole.json | 3 +- reference/SpaceTraders.json | 3111 ++++++++++++++++----------------- 4 files changed, 1526 insertions(+), 1599 deletions(-) diff --git a/models/MarketTransaction.json b/models/MarketTransaction.json index 30d71e7..56234b1 100644 --- a/models/MarketTransaction.json +++ b/models/MarketTransaction.json @@ -1,7 +1,11 @@ { "type": "object", "properties": { - "symbol": { + "shipSymbol": { + "type": "string", + "description": "The symbol of the ship that made the transaction." + }, + "tradeSymbol": { "type": "string", "description": "The symbol of the trade good." }, @@ -28,10 +32,6 @@ "description": "The total price of the transaction.", "minimum": 1 }, - "shipSymbol": { - "type": "string", - "description": "The symbol of the ship that made the transaction." - }, "timestamp": { "type": "string", "format": "date-time", diff --git a/models/ShipReactor.json b/models/ShipReactor.json index 6abc42c..4a96c85 100644 --- a/models/ShipReactor.json +++ b/models/ShipReactor.json @@ -29,7 +29,6 @@ "required": [ "symbol", "name", - "condition", "powerOutput", "requirements" ] diff --git a/models/ShipRole.json b/models/ShipRole.json index b6867b7..01863b1 100644 --- a/models/ShipRole.json +++ b/models/ShipRole.json @@ -11,6 +11,7 @@ "SURVEYOR", "COMMAND", "CARRIER", - "PATROL" + "PATROL", + "SATELLITE" ] } \ No newline at end of file diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 74afd65..9441c69 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -1,15 +1,5 @@ { - "components": { - "requestBodies": {}, - "schemas": {}, - "securitySchemes": { - "AgentToken": { - "description": "When you register a new agent you will be granted a private bearer token which grants authorization to use the API.", - "scheme": "bearer", - "type": "http" - } - } - }, + "openapi": "3.0.0", "info": { "contact": { "email": "joel@spacetraders.io", @@ -23,1558 +13,51 @@ "title": "SpaceTraders API", "version": "2.0.0-rc.2" }, - "openapi": "3.0.0", + "security": [ + { + "AgentToken": [] + } + ], + "servers": [ + { + "description": "v2.0.0-rc.2", + "url": "https://api-server-2-0-0-rc-2-vxxwq5xqdq-uc.a.run.app" + } + ], + "tags": [ + { + "description": "Factions", + "name": "factions" + }, + { + "description": "Fleet", + "name": "fleet" + }, + { + "description": "Contracts", + "name": "contracts" + }, + { + "description": "Systems", + "name": "systems" + }, + { + "description": "Agents", + "name": "agents" + } + ], + "components": { + "requestBodies": {}, + "schemas": {}, + "securitySchemes": { + "AgentToken": { + "description": "When you register a new agent you will be granted a private bearer token which grants authorization to use the API.", + "scheme": "bearer", + "type": "http" + } + } + }, "paths": { - "/factions": { - "get": { - "description": "List all discovered factions in the game.", - "operationId": "get-factions", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "items": { - "$ref": "../models/Faction.json" - }, - "type": "array" - }, - "meta": { - "$ref": "../models/Meta.json" - } - }, - "required": [ - "data", - "meta" - ], - "type": "object" - } - } - }, - "description": "" - } - }, - "summary": "List Factions", - "tags": [ - "factions" - ] - } - }, - "/factions/{factionSymbol}": { - "get": { - "description": "View the details of a faction.", - "operationId": "get-faction", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "$ref": "../models/Faction.json" - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "OK" - } - }, - "summary": "Get Faction", - "tags": [ - "factions" - ] - }, - "parameters": [ - { - "description": "The faction symbol", - "in": "path", - "name": "factionSymbol", - "required": true, - "schema": { - "default": "CGR", - "type": "string" - } - } - ] - }, - "/my/agent": { - "get": { - "description": "Fetch your agent's details.", - "operationId": "get-my-agent", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "$ref": "../models/Agent.json" - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "OK" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "My Agent Details", - "tags": [ - "agents" - ] - } - }, - "/my/contracts": { - "get": { - "description": "List all of your contracts.", - "operationId": "get-contracts", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "description": "", - "properties": { - "data": { - "items": { - "$ref": "../models/Contract.json" - }, - "type": "array" - }, - "meta": { - "$ref": "../models/Meta.json" - } - }, - "required": [ - "data", - "meta" - ], - "type": "object" - } - } - }, - "description": "OK" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "List Contracts", - "tags": [ - "contracts" - ] - } - }, - "/my/contracts/{contractId}": { - "get": { - "description": "Get the details of a contract by ID.", - "operationId": "get-contract", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "$ref": "../models/Contract.json" - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "OK" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Get Contract", - "tags": [ - "contracts" - ] - }, - "parameters": [ - { - "description": "The contract ID", - "in": "path", - "name": "contractId", - "required": true, - "schema": { - "type": "string" - } - } - ] - }, - "/my/contracts/{contractId}/accept": { - "parameters": [ - { - "in": "path", - "name": "contractId", - "required": true, - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Accept a contract.", - "operationId": "accept-contract", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "agent": { - "$ref": "../models/Agent.json" - }, - "contract": { - "$ref": "../models/Contract.json" - } - }, - "required": [ - "contract", - "agent" - ], - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "OK" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Accept Contract", - "tags": [ - "contracts" - ] - } - }, - "/my/contracts/{contractId}/deliver": { - "parameters": [ - { - "description": "The ID of the contract", - "in": "path", - "name": "contractId", - "required": true, - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Deliver cargo on a given contract.", - "operationId": "deliver-contract", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "shipSymbol": { - "type": "string" - }, - "tradeSymbol": { - "type": "string" - }, - "units": { - "type": "integer" - } - }, - "required": [ - "shipSymbol", - "tradeSymbol", - "units" - ], - "type": "object" - } - } - } - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "description": "", - "properties": { - "data": { - "properties": { - "contract": { - "$ref": "../models/Contract.json" - }, - "shipCargo": { - "$ref": "../models/ShipCargo.json" - } - }, - "required": [ - "contract", - "shipCargo" - ], - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "OK" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Deliver Contract", - "tags": [ - "contracts" - ] - } - }, - "/my/contracts/{contractId}/fulfill": { - "parameters": [ - { - "description": "The ID of the contract", - "in": "path", - "name": "contractId", - "required": true, - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Fulfill a contract", - "operationId": "fulfill-contract", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "description": "", - "properties": { - "data": { - "properties": { - "agent": { - "$ref": "../models/Agent.json" - }, - "contract": { - "$ref": "../models/Contract.json" - } - }, - "required": [ - "contract", - "agent" - ], - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "OK" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Fulfill Contract", - "tags": [ - "contracts" - ] - } - }, - "/my/ships": { - "get": { - "description": "Retrieve all of your ships.", - "operationId": "get-my-ships", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "description": "", - "properties": { - "data": { - "items": { - "$ref": "../models/Ship.json" - }, - "type": "array" - }, - "meta": { - "$ref": "../models/Meta.json" - } - }, - "required": [ - "data", - "meta" - ], - "type": "object" - } - } - }, - "description": "OK" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "List Ships", - "tags": [ - "fleet" - ] - }, - "post": { - "description": "Purchase a ship", - "operationId": "purchase-ship", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "description": "The ID of the ship you want to purchase.", - "type": "string" - } - }, - "required": [ - "id" - ], - "type": "object" - } - } - } - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "description": "", - "properties": { - "data": { - "properties": { - "agent": { - "$ref": "../models/Agent.json" - }, - "ship": { - "$ref": "../models/Ship.json" - } - }, - "required": [ - "ship", - "agent" - ], - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "OK" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Purchase Ship", - "tags": [ - "fleet" - ] - } - }, - "/my/ships/{shipSymbol}": { - "get": { - "description": "Retrieve the details of your ship.", - "operationId": "get-my-ship", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "description": "", - "properties": { - "data": { - "$ref": "../models/Ship.json" - } - }, - "required": [ - "data" - ], - "type": "object", - "x-examples": { - "example-1": { - "data": { - "cargo": [], - "crew": null, - "engine": "ENGINE_SOLAR_PROPULSION", - "frame": "FRAME_DRONE", - "integrity": { - "engine": 1, - "frame": 1, - "reactor": 1 - }, - "location": "X1-OE-PM", - "modules": [ - "MODULE_CARGO_HOLD" - ], - "mounts": [ - "MOUNT_MINING_LASER_I" - ], - "officers": null, - "reactor": "REACTOR_SOLAR_I", - "registration": { - "agentSymbol": "653298", - "factionSymbol": "COMMERCE_REPUBLIC", - "fee": 100, - "role": "EXCAVATOR" - }, - "status": "DOCKED", - "symbol": "653298-1" - } - } - } - } - } - }, - "description": "OK" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Get Ship", - "tags": [ - "fleet" - ] - }, - "parameters": [ - { - "in": "path", - "name": "shipSymbol", - "required": true, - "schema": { - "type": "string" - } - } - ] - }, - "/my/ships/{shipSymbol}/chart": { - "parameters": [ - { - "description": "The symbol of the ship", - "in": "path", - "name": "shipSymbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Command a ship to chart the current waypoint.\n\nWaypoints in the universe are uncharted by default. These locations will not show up in the API until they have been charted by a ship.\n\nCharting a location will record your agent as the one who created the chart.", - "operationId": "create-chart", - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "chart": { - "$ref": "../models/Chart.json" - } - }, - "required": [ - "chart" - ], - "type": "object" - } - }, - "type": "object" - } - } - }, - "description": "Created" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Create Chart", - "tags": [ - "fleet" - ] - } - }, - "/my/ships/{shipSymbol}/cooldown": { - "get": { - "description": "Retrieve the details of your ship's reactor cooldown. Some actions such as activating your jump drive, scanning, or extracting resources taxes your reactor and results in a cooldown.\n\nYour ship cannot perform additional actions until your cooldown has expired. The duration of your cooldown is relative to the power consumption of the related modules or mounts for the action taken.\n\nResponse returns a 204 status code (no-content) when the ship has no cooldown.", - "operationId": "get-ship-cooldown", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "description": "", - "properties": { - "data": { - "$ref": "../models/Cooldown.json" - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "OK" - }, - "204": { - "description": "No cooldown" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Get Ship Cooldown", - "tags": [ - "fleet" - ] - }, - "parameters": [ - { - "in": "path", - "name": "shipSymbol", - "required": true, - "schema": { - "type": "string" - } - } - ] - }, - "/my/ships/{shipSymbol}/deploy": { - "parameters": [ - { - "description": "The ship symbol", - "in": "path", - "name": "shipSymbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Use this endpoint to deploy a Communications Relay to a waypoint. A waypoint with a communications relay will allow agents to retrieve price information from the market. Without a relay, agents must send a ship to a market to retrieve price information.\n\nCommunication relays can be purchased from a market that exports `COMM_RELAY_I`.", - "operationId": "deploy-asset", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "symbol": { - "type": "string" - } - }, - "required": [ - "symbol" - ], - "type": "object" - } - } - } - }, - "responses": { - "204": { - "description": "OK" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Deploy Asset", - "tags": [ - "fleet" - ] - } - }, - "/my/ships/{shipSymbol}/dock": { - "parameters": [ - { - "description": "The symbol of the ship", - "in": "path", - "name": "shipSymbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Attempt to dock your ship at it's current location. Docking will only succeed if the waypoint is a dockable location, and your ship is capable of docking at the time of the request.\n\nThe endpoint is idempotent - successive calls will succeed even if the ship is already docked.", - "operationId": "dock-ship", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "description": "", - "properties": { - "data": { - "properties": { - "nav": { - "$ref": "../models/ShipNav.json" - } - }, - "required": [ - "nav" - ], - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "The ship has successfully docked at it's current location." - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Dock Ship", - "tags": [ - "fleet" - ] - } - }, - "/my/ships/{shipSymbol}/extract": { - "parameters": [ - { - "description": "The ship symbol", - "in": "path", - "name": "shipSymbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Extract resources from the waypoint into your ship. Send a survey as the payload to target specific yields. The entire survey must be sent as it contains a signature that the backend verifies.", - "operationId": "extract-resources", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "survey": { - "$ref": "../models/Survey.json" - } - }, - "required": [ - "survey" - ], - "type": "object" - } - } - }, - "description": "" - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "description": "", - "properties": { - "data": { - "properties": { - "cooldown": { - "$ref": "../models/Cooldown.json" - }, - "extraction": { - "$ref": "../models/Extraction.json" - } - }, - "required": [ - "extraction", - "cooldown" - ], - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "Created" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Extract Resources", - "tags": [ - "fleet" - ] - } - }, - "/my/ships/{shipSymbol}/jettison": { - "parameters": [ - { - "in": "path", - "name": "shipSymbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Jettison cargo from your ship's cargo hold.", - "operationId": "jettison", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "symbol": { - "type": "string" - }, - "units": { - "minimum": 1, - "type": "integer" - } - }, - "required": [ - "symbol", - "units" - ], - "type": "object" - } - } - } - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "description": "", - "properties": { - "data": { - "properties": { - "cargo": { - "$ref": "../models/ShipCargo.json" - } - }, - "required": [ - "cargo" - ], - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "OK" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Jettison Cargo", - "tags": [ - "fleet" - ] - } - }, - "/my/ships/{shipSymbol}/jump": { - "parameters": [ - { - "in": "path", - "name": "shipSymbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Jump your ship from one system to another.", - "operationId": "jump-ship", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "destination": { - "description": "The system symbol to jump to.", - "type": "string" - } - }, - "required": [ - "destination" - ], - "type": "object" - } - } - } - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "description": "", - "properties": { - "data": { - "properties": { - "cooldown": { - "$ref": "../models/Cooldown.json" - }, - "nav": { - "$ref": "../models/ShipNav.json" - } - }, - "required": [ - "route", - "cooldown" - ], - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "Created" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Jump Ship", - "tags": [ - "fleet" - ] - } - }, - "/my/ships/{shipSymbol}/navigate": { - "parameters": [ - { - "description": "The ship symbol", - "in": "path", - "name": "shipSymbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Navigate to a target destination. The destination must be located within the same system as the ship. Navigating will consume the necessary fuel and supplies from the ship's manifest, and will pay out crew wages from the agent's account.\n\nThe returned response will detail the route information including the expected time of arrival. Most ship actions are unavailable until the ship has arrived at it's destination.\n\nFor faster-than-light travel between systems, see the ship's jump action.", - "operationId": "navigate-ship", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "waypointSymbol": { - "description": "The target destination.", - "type": "string" - } - }, - "required": [ - "waypointSymbol" - ], - "type": "object" - } - } - }, - "description": "" - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "description": "", - "properties": { - "data": { - "properties": { - "fuel": { - "$ref": "../models/ShipFuel.json" - }, - "nav": { - "$ref": "../models/ShipNav.json" - } - }, - "required": [ - "nav", - "fuel" - ], - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "The successful transit information including the route details and changes to ship fuel, supplies, and crew wages paid. The route includes the expected time of arrival." - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Navigate Ship", - "tags": [ - "fleet" - ] - } - }, - "/my/ships/{shipSymbol}/orbit": { - "parameters": [ - { - "description": "The symbol of the ship", - "in": "path", - "name": "shipSymbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Attempt to move your ship into orbit at it's current location. The request will only succeed if your ship is capable of moving into orbit at the time of the request.\n\nThe endpoint is idempotent - successive calls will succeed even if the ship is already in orbit.", - "operationId": "orbit-ship", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "description": "", - "properties": { - "data": { - "properties": { - "nav": { - "$ref": "../models/ShipNav.json" - } - }, - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "The ship has successfully moved into orbit at it's current location." - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Orbit Ship", - "tags": [ - "fleet" - ] - } - }, - "/my/ships/{shipSymbol}/purchase": { - "parameters": [ - { - "in": "path", - "name": "shipSymbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Purchase cargo.", - "operationId": "purchase-cargo", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "symbol": { - "type": "string" - }, - "units": { - "type": "integer" - } - }, - "required": [ - "symbol", - "units" - ], - "type": "object" - } - } - } - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "description": "", - "properties": { - "data": { - "properties": { - "agent": { - "$ref": "../models/Agent.json" - }, - "cargo": { - "$ref": "../models/ShipCargo.json" - }, - "transaction": { - "$ref": "../models/MarketTransaction.json" - } - }, - "required": [ - "cargo", - "transaction", - "agent" - ], - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "Created" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Purchase Cargo", - "tags": [ - "fleet" - ] - } - }, - "/my/ships/{shipSymbol}/refuel": { - "parameters": [ - { - "in": "path", - "name": "shipSymbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Refuel your ship from the local market.", - "operationId": "refuel-ship", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "description": "", - "properties": { - "data": { - "properties": { - "agent": { - "$ref": "../models/Agent.json" - }, - "fuel": { - "$ref": "../models/ShipFuel.json" - } - }, - "required": [ - "agent", - "fuel" - ], - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "OK" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Refuel Ship", - "tags": [ - "fleet" - ] - } - }, - "/my/ships/{shipSymbol}/scan": { - "parameters": [ - { - "in": "path", - "name": "shipSymbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Activate your ship's sensor arrays to scan for arriving ships, departing ships, system information, or waypoint information. Send a scan mode to select the type of scan performed by your ship.", - "operationId": "create-ship-scan", - "requestBody": { - "content": { - "application/json": { - "examples": { - "Approaching Ships": { - "value": { - "mode": "APPROACHING_SHIPS" - } - }, - "Departing Ships": { - "value": { - "mode": "DEPARTING_SHIPS" - } - } - }, - "schema": { - "properties": { - "mode": { - "enum": [ - "APPROACHING_SHIPS", - "DEPARTING_SHIPS", - "WAYPOINT" - ], - "type": "string" - } - }, - "required": [ - "mode" - ], - "type": "object" - } - } - }, - "description": "" - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "description": "", - "properties": { - "data": { - "oneOf": [ - { - "properties": { - "cooldown": { - "$ref": "../models/Cooldown.json" - }, - "ships": { - "items": { - "$ref": "../models/ScannedShip.json" - }, - "type": "array" - } - }, - "required": [ - "ships", - "cooldown" - ] - }, - { - "properties": { - "cooldown": { - "$ref": "../models/Cooldown.json" - }, - "waypoint": { - "$ref": "../models/Waypoint.json" - } - }, - "required": [ - "cooldown", - "waypoint" - ] - } - ], - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "Created" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Scan", - "tags": [ - "fleet" - ] - } - }, - "/my/ships/{shipSymbol}/sell": { - "parameters": [ - { - "in": "path", - "name": "shipSymbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Sell cargo from your ship's hold to the local market.", - "operationId": "sell-cargo", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "symbol": { - "type": "string" - }, - "units": { - "type": "integer" - } - }, - "required": [ - "symbol", - "units" - ], - "type": "object" - } - } - }, - "description": "" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "description": "", - "properties": { - "data": { - "properties": { - "agent": { - "$ref": "../models/Agent.json" - }, - "cargo": { - "$ref": "../models/ShipCargo.json" - }, - "transaction": { - "$ref": "../models/MarketTransaction.json" - } - }, - "required": [ - "agent", - "cargo", - "transaction" - ], - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "OK" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Sell Cargo", - "tags": [ - "fleet" - ] - } - }, - "/my/ships/{shipSymbol}/survey": { - "parameters": [ - { - "in": "path", - "name": "shipSymbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "If you want to target specific yields for an extraction, you can survey a waypoint, such as an asteroid field, and send the survey in the body of the extract request. Each survey may have multiple deposits, and if a symbol shows up more than once, that indicates a higher chance of extracting that resource.\n\nYour ship will enter a cooldown between consecutive survey requests. Surveys will eventually expire after a period of time. Multiple ships can use the same survey for extraction.", - "operationId": "survey-waypoint", - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "description": "", - "properties": { - "data": { - "properties": { - "cooldown": { - "$ref": "../models/Cooldown.json" - }, - "surveys": { - "items": { - "$ref": "../models/Survey.json" - }, - "type": "array" - } - }, - "required": [ - "surveys", - "cooldown" - ], - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "Created" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Survey Waypoint", - "tags": [ - "fleet" - ] - } - }, "/register": { "post": { "description": "Creates a new agent and ties it to a temporary Account. Use `COMMERCE_REPUBLIC` as your starting faction if you don't know any other factions to choose from.\n\nThe agent symbol is a 4-8 character string that will represent your agent. This symbol will prefix the symbol of every ship you own. Agent symbols will be cast to all uppercase characters.\n\nA new agent will be granted an authorization token, a contract with their starting faction, a command ship with a jump drive, and one hundred thousand credits.\n\n> #### Keep your token safe and secure\n>\n> Save your token during the alpha phase. There is no way to regenerate this token without starting a new agent. In the future you will be able to generate and manage your tokens from the SpaceTraders website.\n\nYou can accept your contract using the `/my/contracts/{contractId}/accept` endpoint. You will want to navigate your command ship to a nearby asteroid field waypoint, and execute the `/my/ships/{shipSymbol}/accept` endpoint to mine various types of ores and minerals.\n\nReturn to the contract destination and execute the `/my/ships/{shipSymbol}/deliver` endpoint to deposit goods into the contract.\n\nWhen your contract is fulfilled, you can call `/my/contracts/{contractId}/fulfill` to retrieve payment.", @@ -1967,39 +450,1483 @@ } } ] - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "servers": [ - { - "description": "v2.0.0-rc.2", - "url": "https://api-server-2-0-0-rc-2-vxxwq5xqdq-uc.a.run.app" - } - ], - "tags": [ - { - "description": "Factions", - "name": "factions" }, - { - "description": "Fleet", - "name": "fleet" + "/factions": { + "get": { + "description": "List all discovered factions in the game.", + "operationId": "get-factions", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "items": { + "$ref": "../models/Faction.json" + }, + "type": "array" + }, + "meta": { + "$ref": "../models/Meta.json" + } + }, + "required": [ + "data", + "meta" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "summary": "List Factions", + "tags": [ + "factions" + ] + } }, - { - "description": "Contracts", - "name": "contracts" + "/factions/{factionSymbol}": { + "get": { + "description": "View the details of a faction.", + "operationId": "get-faction", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "$ref": "../models/Faction.json" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "summary": "Get Faction", + "tags": [ + "factions" + ] + }, + "parameters": [ + { + "description": "The faction symbol", + "in": "path", + "name": "factionSymbol", + "required": true, + "schema": { + "default": "CGR", + "type": "string" + } + } + ] }, - { - "description": "Systems", - "name": "systems" + "/my/agent": { + "get": { + "description": "Fetch your agent's details.", + "operationId": "get-my-agent", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "$ref": "../models/Agent.json" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "My Agent Details", + "tags": [ + "agents" + ] + } }, - { - "description": "Agents", - "name": "agents" + "/my/contracts": { + "get": { + "description": "List all of your contracts.", + "operationId": "get-contracts", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "items": { + "$ref": "../models/Contract.json" + }, + "type": "array" + }, + "meta": { + "$ref": "../models/Meta.json" + } + }, + "required": [ + "data", + "meta" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "List Contracts", + "tags": [ + "contracts" + ] + } + }, + "/my/contracts/{contractId}": { + "get": { + "description": "Get the details of a contract by ID.", + "operationId": "get-contract", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "$ref": "../models/Contract.json" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Get Contract", + "tags": [ + "contracts" + ] + }, + "parameters": [ + { + "description": "The contract ID", + "in": "path", + "name": "contractId", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/my/contracts/{contractId}/accept": { + "parameters": [ + { + "in": "path", + "name": "contractId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Accept a contract.", + "operationId": "accept-contract", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "agent": { + "$ref": "../models/Agent.json" + }, + "contract": { + "$ref": "../models/Contract.json" + } + }, + "required": [ + "contract", + "agent" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Accept Contract", + "tags": [ + "contracts" + ] + } + }, + "/my/contracts/{contractId}/deliver": { + "parameters": [ + { + "description": "The ID of the contract", + "in": "path", + "name": "contractId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Deliver cargo on a given contract.", + "operationId": "deliver-contract", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "shipSymbol": { + "type": "string" + }, + "tradeSymbol": { + "type": "string" + }, + "units": { + "type": "integer" + } + }, + "required": [ + "shipSymbol", + "tradeSymbol", + "units" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "contract": { + "$ref": "../models/Contract.json" + }, + "cargo": { + "$ref": "../models/ShipCargo.json" + } + }, + "required": [ + "contract", + "cargo" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Deliver Contract", + "tags": [ + "contracts" + ] + } + }, + "/my/contracts/{contractId}/fulfill": { + "parameters": [ + { + "description": "The ID of the contract", + "in": "path", + "name": "contractId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Fulfill a contract", + "operationId": "fulfill-contract", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "agent": { + "$ref": "../models/Agent.json" + }, + "contract": { + "$ref": "../models/Contract.json" + } + }, + "required": [ + "contract", + "agent" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Fulfill Contract", + "tags": [ + "contracts" + ] + } + }, + "/my/ships/{shipSymbol}/orbit": { + "parameters": [ + { + "description": "The symbol of the ship", + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Attempt to move your ship into orbit at it's current location. The request will only succeed if your ship is capable of moving into orbit at the time of the request.\n\nThe endpoint is idempotent - successive calls will succeed even if the ship is already in orbit.", + "operationId": "orbit-ship", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Orbit Ship 200 Response", + "description": "", + "properties": { + "data": { + "properties": { + "nav": { + "$ref": "../models/ShipNav.json" + } + }, + "type": "object", + "required": [ + "nav" + ] + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "The ship has successfully moved into orbit at it's current location." + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Orbit Ship", + "tags": [ + "fleet" + ] + } + }, + "/my/ships": { + "get": { + "description": "Retrieve all of your ships.", + "operationId": "get-my-ships", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "items": { + "$ref": "../models/Ship.json" + }, + "type": "array" + }, + "meta": { + "$ref": "../models/Meta.json" + } + }, + "required": [ + "data", + "meta" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "List Ships", + "tags": [ + "fleet" + ] + }, + "post": { + "description": "Purchase a ship", + "operationId": "purchase-ship", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "shipSymbol": { + "description": "The symbol of the ship you want to purchase.", + "type": "string" + }, + "waypointSymbol": { + "description": "The symbol of the waypoint you want to purchase the ship at.", + "type": "string" + } + }, + "required": [ + "shipSymbol", + "waypointSymbol" + ], + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "agent": { + "$ref": "../models/Agent.json" + }, + "ship": { + "$ref": "../models/Ship.json" + } + }, + "required": [ + "ship", + "agent" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "Created" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Purchase Ship", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}": { + "get": { + "description": "Retrieve the details of your ship.", + "operationId": "get-my-ship", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "$ref": "../models/Ship.json" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Get Ship", + "tags": [ + "fleet" + ] + }, + "parameters": [ + { + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/my/ships/{shipSymbol}/chart": { + "parameters": [ + { + "description": "The symbol of the ship", + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Command a ship to chart the current waypoint.\n\nWaypoints in the universe are uncharted by default. These locations will not show up in the API until they have been charted by a ship.\n\nCharting a location will record your agent as the one who created the chart.", + "operationId": "create-chart", + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "chart": { + "$ref": "../models/Chart.json" + } + }, + "required": [ + "chart" + ], + "type": "object" + } + }, + "type": "object", + "required": [ + "data" + ] + } + } + }, + "description": "Created" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Create Chart", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}/cooldown": { + "get": { + "description": "Retrieve the details of your ship's reactor cooldown. Some actions such as activating your jump drive, scanning, or extracting resources taxes your reactor and results in a cooldown.\n\nYour ship cannot perform additional actions until your cooldown has expired. The duration of your cooldown is relative to the power consumption of the related modules or mounts for the action taken.\n\nResponse returns a 204 status code (no-content) when the ship has no cooldown.", + "operationId": "get-ship-cooldown", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "$ref": "../models/Cooldown.json" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + }, + "204": { + "description": "No cooldown" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Get Ship Cooldown", + "tags": [ + "fleet" + ] + }, + "parameters": [ + { + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/my/ships/{shipSymbol}/deploy": { + "parameters": [ + { + "description": "The ship symbol", + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Use this endpoint to deploy a Communications Relay to a waypoint. A waypoint with a communications relay will allow agents to retrieve price information from the market. Without a relay, agents must send a ship to a market to retrieve price information.\n\nCommunication relays can be purchased from a market that exports `COMM_RELAY_I`.", + "operationId": "deploy-asset", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "symbol": { + "type": "string" + } + }, + "required": [ + "symbol" + ], + "type": "object" + } + } + } + }, + "responses": { + "204": { + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Deploy Asset", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}/dock": { + "parameters": [ + { + "description": "The symbol of the ship", + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Attempt to dock your ship at it's current location. Docking will only succeed if the waypoint is a dockable location, and your ship is capable of docking at the time of the request.\n\nThe endpoint is idempotent - successive calls will succeed even if the ship is already docked.", + "operationId": "dock-ship", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Dock Ship 200 Response", + "description": "", + "properties": { + "data": { + "properties": { + "nav": { + "$ref": "../models/ShipNav.json" + } + }, + "required": [ + "nav" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "The ship has successfully docked at it's current location." + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Dock Ship", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}/extract": { + "parameters": [ + { + "description": "The ship symbol", + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Extract resources from the waypoint into your ship. Send a survey as the payload to target specific yields. The entire survey must be sent as it contains a signature that the backend verifies.", + "operationId": "extract-resources", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "survey": { + "$ref": "../models/Survey.json" + } + }, + "required": [ + "survey" + ], + "type": "object" + } + } + }, + "description": "" + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "cooldown": { + "$ref": "../models/Cooldown.json" + }, + "extraction": { + "$ref": "../models/Extraction.json" + }, + "cargo": { + "$ref": "../models/ShipCargo.json" + } + }, + "required": [ + "extraction", + "cooldown", + "cargo" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "Created" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Extract Resources", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}/jettison": { + "parameters": [ + { + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Jettison cargo from your ship's cargo hold.", + "operationId": "jettison", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "symbol": { + "type": "string" + }, + "units": { + "minimum": 1, + "type": "integer" + } + }, + "required": [ + "symbol", + "units" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "cargo": { + "$ref": "../models/ShipCargo.json" + } + }, + "required": [ + "cargo" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Jettison Cargo", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}/jump": { + "parameters": [ + { + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Jump your ship from one system to another.", + "operationId": "jump-ship", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "systemSymbol": { + "description": "The system symbol to jump to.", + "type": "string" + } + }, + "required": [ + "systemSymbol" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "cooldown": { + "$ref": "../models/Cooldown.json" + }, + "nav": { + "$ref": "../models/ShipNav.json" + } + }, + "required": [ + "route", + "cooldown" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Jump Ship", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}/navigate": { + "parameters": [ + { + "description": "The ship symbol", + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Navigate to a target destination. The destination must be located within the same system as the ship. Navigating will consume the necessary fuel and supplies from the ship's manifest, and will pay out crew wages from the agent's account.\n\nThe returned response will detail the route information including the expected time of arrival. Most ship actions are unavailable until the ship has arrived at it's destination.\n\nFor faster-than-light travel between systems, see the ship's jump action.", + "operationId": "navigate-ship", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "waypointSymbol": { + "description": "The target destination.", + "type": "string" + } + }, + "required": [ + "waypointSymbol" + ], + "type": "object" + } + } + }, + "description": "" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "fuel": { + "$ref": "../models/ShipFuel.json" + }, + "nav": { + "$ref": "../models/ShipNav.json" + } + }, + "required": [ + "nav", + "fuel" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "The successful transit information including the route details and changes to ship fuel, supplies, and crew wages paid. The route includes the expected time of arrival." + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Navigate Ship", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}/sell": { + "parameters": [ + { + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Sell cargo.", + "operationId": "sell-cargo", + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "SellCargoRequest", + "properties": { + "symbol": { + "type": "string" + }, + "units": { + "type": "integer" + } + }, + "required": [ + "symbol", + "units" + ], + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "title": "Sell Cargo 201 Response", + "description": "", + "properties": { + "data": { + "properties": { + "agent": { + "$ref": "../models/Agent.json" + }, + "cargo": { + "$ref": "../models/ShipCargo.json" + }, + "transaction": { + "$ref": "../models/MarketTransaction.json" + } + }, + "required": [ + "cargo", + "transaction", + "agent" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "Created" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Sell Cargo", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}/scan": { + "parameters": [ + { + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Activate your ship's sensor arrays to scan for arriving ships, departing ships, system information, or waypoint information. Send a scan mode to select the type of scan performed by your ship.", + "operationId": "create-ship-scan", + "requestBody": { + "content": { + "application/json": { + "examples": { + "Approaching Ships": { + "value": { + "mode": "APPROACHING_SHIPS" + } + }, + "Departing Ships": { + "value": { + "mode": "DEPARTING_SHIPS" + } + } + }, + "schema": { + "properties": { + "mode": { + "enum": [ + "APPROACHING_SHIPS", + "DEPARTING_SHIPS", + "WAYPOINT" + ], + "type": "string" + } + }, + "required": [ + "mode" + ], + "type": "object" + } + } + }, + "description": "" + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "oneOf": [ + { + "properties": { + "cooldown": { + "$ref": "../models/Cooldown.json" + }, + "ships": { + "items": { + "$ref": "../models/ScannedShip.json" + }, + "type": "array" + } + }, + "required": [ + "ships", + "cooldown" + ] + }, + { + "properties": { + "cooldown": { + "$ref": "../models/Cooldown.json" + }, + "waypoint": { + "$ref": "../models/Waypoint.json" + } + }, + "required": [ + "cooldown", + "waypoint" + ] + } + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "Created" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Scan", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}/refuel": { + "parameters": [ + { + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Refuel your ship from the local market.", + "operationId": "refuel-ship", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "agent": { + "$ref": "../models/Agent.json" + }, + "fuel": { + "$ref": "../models/ShipFuel.json" + } + }, + "required": [ + "agent", + "fuel" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Refuel Ship", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}/purchase": { + "parameters": [ + { + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Purchase cargo.", + "operationId": "purchase-cargo", + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "Purchase Cargo Request", + "properties": { + "symbol": { + "type": "string" + }, + "units": { + "type": "integer" + } + }, + "required": [ + "symbol", + "units" + ], + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "title": "Purchase Cargo 201 Response", + "description": "", + "properties": { + "data": { + "properties": { + "agent": { + "$ref": "../models/Agent.json" + }, + "cargo": { + "$ref": "../models/ShipCargo.json" + }, + "transaction": { + "$ref": "../models/MarketTransaction.json" + } + }, + "required": [ + "cargo", + "transaction", + "agent" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "Created" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Purchase Cargo", + "tags": [ + "fleet" + ] + } } - ] + } } \ No newline at end of file From 15ae4a2ce68487761a5ebd893599cf7c4556d3b6 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Wed, 23 Nov 2022 14:45:08 -0800 Subject: [PATCH 18/48] add the survey endpoint --- models/ContractDeliverGood.json | 4 +- models/Survey.json | 6 +++ reference/SpaceTraders.json | 69 ++++++++++++++++++++++++++++++--- 3 files changed, 71 insertions(+), 8 deletions(-) diff --git a/models/ContractDeliverGood.json b/models/ContractDeliverGood.json index c0a452f..02e1377 100644 --- a/models/ContractDeliverGood.json +++ b/models/ContractDeliverGood.json @@ -2,7 +2,7 @@ "description": "The details of a delivery contract. Includes the type of good, units needed, and the destination.", "type": "object", "properties": { - "symbol": { + "tradeSymbol": { "type": "string", "description": "The symbol of the trade good to deliver.", "minLength": 1 @@ -22,7 +22,7 @@ } }, "required": [ - "symbol", + "tradeSymbol", "destinationSymbol", "unitsRequired", "unitsFulfilled" diff --git a/models/Survey.json b/models/Survey.json index c663875..a9d8837 100644 --- a/models/Survey.json +++ b/models/Survey.json @@ -7,6 +7,11 @@ "description": "A unique signature for the location of this survey. This signature is verified when attempting an extraction using this survey.", "minLength": 1 }, + "symbol": { + "type": "string", + "description": "The symbol of the waypoint that this survey is for.", + "minLength": 1 + }, "deposits": { "type": "array", "description": "A list of deposits that can be found at this location.", @@ -23,6 +28,7 @@ }, "required": [ "signature", + "symbol", "deposits", "expiration" ] diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 9441c69..d905571 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -1275,6 +1275,67 @@ ] } }, + "/my/ships/{shipSymbol}/survey": { + "parameters": [ + { + "description": "The symbol of the ship", + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "If you want to target specific yields for an extraction, you can survey a waypoint, such as an asteroid field, and send the survey in the body of the extract request. Each survey may have multiple deposits, and if a symbol shows up more than once, that indicates a higher chance of extracting that resource.\n\nYour ship will enter a cooldown between consecutive survey requests. Surveys will eventually expire after a period of time. Multiple ships can use the same survey for extraction.", + "operationId": "create-survey", + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "cooldown": { + "$ref": "../models/Cooldown.json" + }, + "surveys": { + "items": { + "$ref": "../models/Survey.json" + }, + "type": "array" + } + }, + "required": [ + "surveys", + "cooldown" + ], + "type": "object" + } + }, + "type": "object", + "required": [ + "data" + ] + } + } + }, + "description": "Created" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Create Survey", + "tags": [ + "fleet" + ] + } + }, "/my/ships/{shipSymbol}/extract": { "parameters": [ { @@ -1288,7 +1349,7 @@ } ], "post": { - "description": "Extract resources from the waypoint into your ship. Send a survey as the payload to target specific yields. The entire survey must be sent as it contains a signature that the backend verifies.", + "description": "Extract resources from the waypoint into your ship. Send an optional survey as the payload to target specific yields.", "operationId": "extract-resources", "requestBody": { "content": { @@ -1299,14 +1360,10 @@ "$ref": "../models/Survey.json" } }, - "required": [ - "survey" - ], "type": "object" } } - }, - "description": "" + } }, "responses": { "201": { From eac54a6f6916af3ea66b71d246fceb2e79e65d71 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Sun, 4 Dec 2022 08:38:00 -0800 Subject: [PATCH 19/48] add enum for symbols --- models/FactionTrait.json | 37 ++++++++++- models/ShipCargoItem.json | 5 ++ models/ShipEngine.json | 11 ++-- models/ShipFrame.json | 4 ++ models/ShipModule.json | 14 ++-- models/ShipMount.json | 8 ++- models/ShipReactor.json | 13 ++-- models/ShipRole.json | 15 +---- models/ShipyardShip.json | 20 +++++- models/System.json | 14 +--- models/SystemType.json | 16 +++++ models/TradeGood.json | 134 ++++++++++++++++++++++++++++++++++++++ models/WaypointTrait.json | 7 +- models/WaypointType.json | 4 +- 14 files changed, 256 insertions(+), 46 deletions(-) create mode 100644 models/SystemType.json create mode 100644 models/TradeGood.json diff --git a/models/FactionTrait.json b/models/FactionTrait.json index 2e95d0c..4c0fe72 100644 --- a/models/FactionTrait.json +++ b/models/FactionTrait.json @@ -35,7 +35,42 @@ "ESTABLISHED", "NOTABLE", "DOMINANT", - "INESCAPABLE" + "INESCAPABLE", + "INNOVATIVE", + "BOLD", + "VISIONARY", + "CURIOUS", + "DARING", + "EXPLORATORY", + "RESOURCEFUL", + "FLEXIBLE", + "COOPERATIVE", + "UNITED", + "STRATEGIC", + "INTELLIGENT", + "RESEARCH_FOCUSED", + "COLLABORATIVE", + "PROGRESSIVE", + "MILITARISTIC", + "TECHNOLOGICALLY_ADVANCED", + "AGGRESSIVE", + "IMPERIALISTIC", + "TREASURE_HUNTERS", + "DEXTEROUS", + "UNPREDICTABLE", + "BRUTAL", + "FLEETING", + "ADAPTABLE", + "SELF_SUFFICIENT", + "DEFENSIVE", + "PROUD", + "DIVERSE", + "INDEPENDENT", + "SELF_INTERESTED", + "FRAGMENTED", + "COMMERCIAL", + "FREE_MARKETS", + "ENTREPRENEURIAL" ] }, "name": { diff --git a/models/ShipCargoItem.json b/models/ShipCargoItem.json index 1a1621c..052a220 100644 --- a/models/ShipCargoItem.json +++ b/models/ShipCargoItem.json @@ -10,6 +10,10 @@ "type": "string", "description": "The name of the cargo item type." }, + "description": { + "type": "string", + "description": "The description of the cargo item type." + }, "units": { "type": "integer", "description": "The number of units of the cargo item.", @@ -19,6 +23,7 @@ "required": [ "symbol", "name", + "description", "units" ] } \ No newline at end of file diff --git a/models/ShipEngine.json b/models/ShipEngine.json index 5b0b1de..65cae0b 100644 --- a/models/ShipEngine.json +++ b/models/ShipEngine.json @@ -5,15 +5,18 @@ "symbol": { "type": "string", "enum": [ - "IMPULSE_DRIVE", - "ION_DRIVE_I", - "ION_DRIVE_II", - "HYPER_DRIVE" + "ENGINE_IMPULSE_DRIVE", + "ENGINE_ION_DRIVE_I", + "ENGINE_ION_DRIVE_II", + "ENGINE_HYPER_DRIVE" ] }, "name": { "type": "string" }, + "description": { + "type": "string" + }, "condition": { "$ref": "./ShipCondition.json" }, diff --git a/models/ShipFrame.json b/models/ShipFrame.json index 03b5782..2bb856e 100644 --- a/models/ShipFrame.json +++ b/models/ShipFrame.json @@ -5,6 +5,7 @@ "symbol": { "type": "string", "enum": [ + "FRAME_PROBE", "FRAME_DRONE", "FRAME_INTERCEPTOR", "FRAME_RACER", @@ -23,6 +24,9 @@ "name": { "type": "string" }, + "description": { + "type": "string" + }, "condition": { "$ref": "./ShipCondition.json" }, diff --git a/models/ShipModule.json b/models/ShipModule.json index 9b6c866..4e3c145 100644 --- a/models/ShipModule.json +++ b/models/ShipModule.json @@ -5,20 +5,26 @@ "symbol": { "type": "string", "enum": [ - "MODULE_PASSENGER_CABIN", - "MODULE_ENVOY_QUARTERS", - "MODULE_MICRO_REFINERY", "MODULE_MINERAL_PROCESSOR", "MODULE_CARGO_HOLD", + "MODULE_CREW_QUARTERS", + "MODULE_ENVOY_QUARTERS", + "MODULE_PASSENGER_CABIN", + "MODULE_MICRO_REFINERY", + "MODULE_SCIENCE_LAB", "MODULE_JUMP_DRIVE_I", "MODULE_JUMP_DRIVE_II", "MODULE_JUMP_DRIVE_III", - "MODULE_CREW_QUARTERS" + "MODULE_SHIELD_GENERATOR_I", + "MODULE_SHIELD_GENERATOR_II" ] }, "name": { "type": "string" }, + "description": { + "type": "string" + }, "requirements": { "$ref": "./ShipRequirements.json" } diff --git a/models/ShipMount.json b/models/ShipMount.json index 043c3c1..889cf8d 100644 --- a/models/ShipMount.json +++ b/models/ShipMount.json @@ -13,12 +13,18 @@ "MOUNT_SENSOR_ARRAY_III", "MOUNT_MINING_LASER_I", "MOUNT_MINING_LASER_II", - "MOUNT_MINING_LASER_III" + "MOUNT_MINING_LASER_III", + "MOUNT_LASER_CANNON_I", + "MOUNT_MISSILE_LAUNCHER_I", + "MOUNT_TURRET_I" ] }, "name": { "type": "string" }, + "description": { + "type": "string" + }, "requirements": { "$ref": "./ShipRequirements.json" } diff --git a/models/ShipReactor.json b/models/ShipReactor.json index 4a96c85..d6573f9 100644 --- a/models/ShipReactor.json +++ b/models/ShipReactor.json @@ -5,16 +5,19 @@ "symbol": { "type": "string", "enum": [ - "SOLAR_REACTOR", - "FUSION_REACTOR", - "FISSION_REACTOR", - "CHEMICAL_REACTOR", - "DARK_MATTER_REACTOR" + "REACTOR_SOLAR_I", + "REACTOR_FUSION_I", + "REACTOR_FISSION_I", + "REACTOR_CHEMICAL_I", + "REACTOR_ANTIMATTER_I" ] }, "name": { "type": "string" }, + "description": { + "type": "string" + }, "condition": { "$ref": "./ShipCondition.json" }, diff --git a/models/ShipRole.json b/models/ShipRole.json index 01863b1..23d7210 100644 --- a/models/ShipRole.json +++ b/models/ShipRole.json @@ -1,17 +1,4 @@ { "type": "string", - "description": "The registered role of the ship", - "enum": [ - "FABRICATOR", - "HARVESTER", - "HAULER", - "EXCAVATOR", - "TRANSPORT", - "REPAIR", - "SURVEYOR", - "COMMAND", - "CARRIER", - "PATROL", - "SATELLITE" - ] + "description": "The registered role of the ship" } \ No newline at end of file diff --git a/models/ShipyardShip.json b/models/ShipyardShip.json index 393807f..3df7d82 100644 --- a/models/ShipyardShip.json +++ b/models/ShipyardShip.json @@ -4,7 +4,23 @@ "properties": { "symbol": { "type": "string", - "minLength": 1 + "enum": [ + "SHIP_PROBE_SATELLITE", + "SHIP_MINING_DRONE", + "SHIP_INTERCEPTOR", + "SHIP_LIGHT_HAULER", + "SHIP_COMMAND_FRIGATE", + "SHIP_EXPLORER", + "SHIP_HEAVY_FREIGHTER", + "SHIP_LIGHT_SHUTTLE", + "SHIP_ORE_HOUND" + ] + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" }, "purchasePrice": { "type": "integer" @@ -33,6 +49,8 @@ }, "required": [ "symbol", + "name", + "description", "purchasePrice", "frame", "reactor", diff --git a/models/System.json b/models/System.json index bb6da08..4be99e0 100644 --- a/models/System.json +++ b/models/System.json @@ -11,19 +11,7 @@ "minLength": 1 }, "type": { - "type": "string", - "enum": [ - "NEUTRON_STAR", - "RED_STAR", - "ORANGE_STAR", - "BLUE_STAR", - "YOUNG_STAR", - "WHITE_DWARF", - "BLACK_HOLE", - "HYPERGIANT", - "NEBULA", - "UNSTABLE" - ] + "$ref": "./SystemType.json" }, "x": { "type": "integer" diff --git a/models/SystemType.json b/models/SystemType.json new file mode 100644 index 0000000..16f3dcc --- /dev/null +++ b/models/SystemType.json @@ -0,0 +1,16 @@ +{ + "type": "string", + "description": "The type of waypoint.", + "enum": [ + "NEUTRON_STAR", + "RED_STAR", + "ORANGE_STAR", + "BLUE_STAR", + "YOUNG_STAR", + "WHITE_DWARF", + "BLACK_HOLE", + "HYPERGIANT", + "NEBULA", + "UNSTABLE" + ] +} \ No newline at end of file diff --git a/models/TradeGood.json b/models/TradeGood.json new file mode 100644 index 0000000..c67768d --- /dev/null +++ b/models/TradeGood.json @@ -0,0 +1,134 @@ +{ + "symbol": { + "type": "string", + "enum": [ + "PRECIOUS_STONES", + "QUARTZ_SAND", + "SILICON_CRYSTALS", + "AMMONIA_ICE", + "LIQUID_HYDROGEN", + "LIQUID_NITROGEN", + "ICE_WATER", + "EXOTIC_MATTER", + "ADVANCED_CIRCUITRY", + "GRAVITON_EMITTERS", + "IRON", + "IRON_ORE", + "COPPER", + "COPPER_ORE", + "ALUMINUM", + "ALUMINUM_ORE", + "SILVER", + "SILVER_ORE", + "GOLD", + "GOLD_ORE", + "PLATINUM", + "PLATINUM_ORE", + "DIAMONDS", + "URANITE", + "URANITE_ORE", + "MERITIUM", + "MERITIUM_ORE", + "HYDROCARBON", + "ANTIMATTER", + "FERTILIZERS", + "FABRICS", + "FOOD", + "JEWELRY", + "MACHINERY", + "FIREARMS", + "ASSAULT_RIFLES", + "MILITARY_EQUIPMENT", + "EXPLOSIVES", + "LAB_INSTRUMENTS", + "AMMUNITION", + "ELECTRONICS", + "SHIP_PLATING", + "EQUIPMENT", + "FUEL", + "MEDICINE", + "DRUGS", + "CLOTHING", + "MICROPROCESSORS", + "PLASTICS", + "POLYNUCLEOTIDES", + "BIOCOMPOSITES", + "NANOBOTS", + "AI_MAINFRAMES", + "QUANTUM_DRIVES", + "ROBOTIC_DRONES", + "CYBER_IMPLANTS", + "GENE_THERAPEUTICS", + "NEURAL_CHIPS", + "MOOD_REGULATORS", + "VIRAL_AGENTS", + "MICRO_FUSION_GENERATORS", + "SUPERGRAINS", + "LASER_RIFLES", + "HOLOGRAPHICS", + "SHIP_SALVAGE", + "RELIC_TECH", + "NOVEL_LIFEFORMS", + "BOTANICAL_SPECIMENS", + "CULTURAL_ARTIFACTS", + "FRAME_PROBE", + "FRAME_DRONE", + "FRAME_INTERCEPTOR", + "FRAME_RACER", + "FRAME_FIGHTER", + "FRAME_FRIGATE", + "FRAME_SHUTTLE", + "FRAME_EXPLORER", + "FRAME_LIGHT_FREIGHTER", + "FRAME_HEAVY_FREIGHTER", + "FRAME_TRANSPORT", + "FRAME_DESTROYER", + "FRAME_CRUISER", + "FRAME_CARRIER", + "REACTOR_SOLAR_I", + "REACTOR_FUSION_I", + "REACTOR_FISSION_I", + "REACTOR_CHEMICAL_I", + "REACTOR_ANTIMATTER_I", + "ENGINE_IMPULSE_DRIVE", + "ENGINE_ION_DRIVE_I", + "ENGINE_ION_DRIVE_II", + "ENGINE_HYPER_DRIVE", + "MODULE_MINERAL_PROCESSOR", + "MODULE_CARGO_HOLD", + "MODULE_CREW_QUARTERS", + "MODULE_ENVOY_QUARTERS", + "MODULE_PASSENGER_CABIN", + "MODULE_MICRO_REFINERY", + "MODULE_SCIENCE_LAB", + "MODULE_JUMP_DRIVE_I", + "MODULE_JUMP_DRIVE_II", + "MODULE_JUMP_DRIVE_III", + "MODULE_SHIELD_GENERATOR_I", + "MODULE_SHIELD_GENERATOR_II", + "MOUNT_GAS_SIPHON_I", + "MOUNT_GAS_SIPHON_II", + "MOUNT_GAS_SIPHON_III", + "MOUNT_SENSOR_ARRAY_I", + "MOUNT_SENSOR_ARRAY_II", + "MOUNT_SENSOR_ARRAY_III", + "MOUNT_MINING_LASER_I", + "MOUNT_MINING_LASER_II", + "MOUNT_MINING_LASER_III", + "MOUNT_LASER_CANNON_I", + "MOUNT_MISSILE_LAUNCHER_I", + "MOUNT_TURRET_I" + ] + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "required": [ + "symbol", + "name", + "description" + ] +} \ No newline at end of file diff --git a/models/WaypointTrait.json b/models/WaypointTrait.json index 8d28956..97b68c1 100644 --- a/models/WaypointTrait.json +++ b/models/WaypointTrait.json @@ -6,6 +6,8 @@ "description": "The unique identifier of the trait.", "enum": [ "UNCHARTED", + "MARKETPLACE", + "SHIPYARD", "OUTPOST", "SCATTERED_SETTLEMENTS", "SPRAWLING_CITIES", @@ -28,6 +30,7 @@ "METHANE_POOLS", "ICE_CRYSTALS", "EXPLOSIVE_GASES", + "STRONG_MAGNETOSPHERE", "VIBRANT_AURORAS", "SALT_FLATS", "CANYONS", @@ -39,6 +42,9 @@ "ASH_CLOUDS", "VAST_RUINS", "MUTATED_FLORA", + "TERRAFORMED", + "EXTREME_TEMPERATURES", + "EXTREME_PRESSURE", "DIVERSE_LIFE", "SCARCE_LIFE", "FOSSILS", @@ -48,7 +54,6 @@ "TOXIC_ATMOSPHERE", "CORROSIVE_ATMOSPHERE", "BREATHABLE_ATMOSPHERE", - "COMM_RELAY_I", "JOVIAN", "ROCKY", "VOLCANIC", diff --git a/models/WaypointType.json b/models/WaypointType.json index 1f8f820..4b978cb 100644 --- a/models/WaypointType.json +++ b/models/WaypointType.json @@ -8,8 +8,8 @@ "ORBITAL_STATION", "JUMP_GATE", "ASTEROID_FIELD", + "NEBULA", "DEBRIS_FIELD", - "GRAVITY_WELL", - "NEBULA" + "GRAVITY_WELL" ] } \ No newline at end of file From 9995cb9dcfab3f8e29546f5fa86d013be2fcd51f Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Mon, 5 Dec 2022 09:54:01 -0800 Subject: [PATCH 20/48] add description, fix symbols --- models/ShipEngine.json | 1 + models/ShipFrame.json | 1 + models/ShipNav.json | 5 +++++ models/ShipReactor.json | 1 + models/WaypointTrait.json | 4 +--- 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/models/ShipEngine.json b/models/ShipEngine.json index 65cae0b..3a1d032 100644 --- a/models/ShipEngine.json +++ b/models/ShipEngine.json @@ -31,6 +31,7 @@ "required": [ "symbol", "name", + "description", "speed", "requirements" ] diff --git a/models/ShipFrame.json b/models/ShipFrame.json index 2bb856e..e171deb 100644 --- a/models/ShipFrame.json +++ b/models/ShipFrame.json @@ -49,6 +49,7 @@ "required": [ "symbol", "name", + "description", "moduleSlots", "mountingPoints", "fuelCapacity", diff --git a/models/ShipNav.json b/models/ShipNav.json index 400ce4b..4250faf 100644 --- a/models/ShipNav.json +++ b/models/ShipNav.json @@ -2,6 +2,10 @@ "type": "object", "description": "The navigation information of the ship.", "properties": { + "systemSymbol": { + "type": "string", + "description": "The system symbol of the ship's current location." + }, "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." @@ -17,6 +21,7 @@ } }, "required": [ + "systemSymbol", "waypointSymbol", "route", "status", diff --git a/models/ShipReactor.json b/models/ShipReactor.json index d6573f9..53614d7 100644 --- a/models/ShipReactor.json +++ b/models/ShipReactor.json @@ -32,6 +32,7 @@ "required": [ "symbol", "name", + "description", "powerOutput", "requirements" ] diff --git a/models/WaypointTrait.json b/models/WaypointTrait.json index 97b68c1..a4e4287 100644 --- a/models/WaypointTrait.json +++ b/models/WaypointTrait.json @@ -62,9 +62,7 @@ "BARREN", "TEMPERATE", "JUNGLE", - "OCEAN", - "MARKETPLACE", - "SHIPYARD" + "OCEAN" ] }, "name": { From 6e395d755117f4d8926d5ad797ba6667e4024d43 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Wed, 7 Dec 2022 08:24:07 -0800 Subject: [PATCH 21/48] normalize attr fields --- docs/alpha.md | 190 ----------------------------- docs/markets.md | 73 ----------- docs/quickstart.md | 108 ++++++++++++++++ models/ShipCrew.json | 16 +-- models/ShipFuel.json | 6 +- models/TradeGood.json | 14 --- resources/agent/MyAgent.json | 44 ------- resources/agent/RegisterAgent.json | 68 ----------- 8 files changed, 119 insertions(+), 400 deletions(-) delete mode 100644 docs/alpha.md delete mode 100644 docs/markets.md create mode 100644 docs/quickstart.md delete mode 100644 resources/agent/MyAgent.json delete mode 100644 resources/agent/RegisterAgent.json diff --git a/docs/alpha.md b/docs/alpha.md deleted file mode 100644 index 64f220b..0000000 --- a/docs/alpha.md +++ /dev/null @@ -1,190 +0,0 @@ -# Alpha Preview Guide - -Hello everyone and welcome to the SpaceTraders v2.0.0-alpha preview! We are excited to share progress with our supporters and hope you enjoy the new changes to the game. - -We've re-thought some elements of the API using lessons learned from the v1 release. We hope you will enjoy some of the fleshed out ship mechanics, larger universe to explore, and various new ideas that are still in the works. - -Our goal continues to be to create a fun and beginner friendly API that developers can reliably build on top of. We appreciate all of the positive comments and feedback, and look forward to a second year of building SpaceTraders! - -## Overview - -The alpha release will be a period of about a month where we fix any critical bugs and make any significant changes to API endpoints. The alpha phase will be shared mostly with our supporters and some close members of the community, so please don't advertise the release too broadly. Having said that, the alpha won't be a secret, so there is no harm if you want to share it directly with friends. - -Following the alpha will be a public beta release, at which point it should be relatively safe to build an SDK on top of the API. We'll continue to add new features, but we will be hesitant to make any significant breaking changes to existing endpoints. We expect the beta to be a few weeks as we confirm the API is scaling well and performance issues are addressed. - -Then we will finally update all of the documentation and website to point to the new 2.0 release. - -### Alpha Goals - -Our goals for the early alpha are to gather feedback so we can guarantee API stability for those that want to start building SDKs. Once we go into a beta release, we will be much less likely to change any specific endpoint, and after a full release we will strive to only make backwards-compatible changes. - -### Feedback - -We're genuinely happy to just have people play the game and try the API. Sharing your feedback or progress will be super motivating for us as we continue to work in our free time. - -If you want to help in a specific way, we're looking for the following feedback from the alpha release: - -- Find and report bugs or exploits in the game -- Look for typos or errors in the game data, symbols, etc. -- Let us know if performance is an issue for any of the endpoints -- Tell us which endpoints are painful to use or game mechanics that are tedious / uninteresting / not fun -- Anything you think will be difficult for us to add later without breaking how the API works - -Again the goal is to catch significant changes that need to be made before the beta release. We appreciate any time you can dedicate to test out the new API endpoints. - -### New Terminology - -The 2.0 version of the API has been significantly reworked and introduces some new terminology. Before reviewing the new endpoints in the next section, it's worth reading through some of the new terms and what they mean. - -- **Account** - you can register an account (not required) with your email address and discord handle and it will persist across resets. We will eventually add registration to the website, but for now you can do it via API calls. You will also be able to register your patreon contribution for special in-game recognition. -- **Agent** - when you start a new game, you register as an agent and choose a symbol (4-8 characters) as your call sign. All of your ships, credits, etc. exist under your agent entity, and you can only have one agent at a time under your account. You will be able to start a new game by retiring your agent and creating a new one. -- **Sector** - a slice of the universe filled with systems of different types such as star systems, black holes, or nebulae. -- **System** - a collection of waypoints orbiting around a central feature such as a star. Systems contain an array of waypoints on an x, y plane. -- **Waypoint** - a location within a system that you can travel to and interact with. Some common types of waypoints include planets, asteroid fields and jump gates. -- **Ship** - your ships can navigate between waypoints and jump across systems. A ship consists of a frame, reactor, engine, modules and mounts. -- **Ship Frame** - the structure of a ship which determines the number of modules and mounts that can be installed. -- **Ship Reactor** - the power module of the ship and limits the types of power-intensive modules and mounts that can be installed. -- **Ship Engine** - the engine of your ship and determines how fast your ship travels when navigating at slower-than-light speeds. -- **Ship Module** - an internal module that can be added or removed from your ship. Common modules include cargo bays, passenger cabins, and jump drives. -- **Ship Mount** - an external mount that can be added or removed from your ship. Common mounts include mining lasers and sensor arrays. -- **Ship Fuel** - a resource that is consumed by your ship when navigating. You can refuel your ship, and one unit of the FUEL trade good adds 100 units to your fuel to your ship's tank. -- **Ship Crew** - the staff that run your ship and keep it operating at peek performance. Crew can be recruited throughout the universe and will eventually be subject to changes in morale, which will impact how your ship performs. Ships which are understaffed will perform poorly such as longer cooldowns, slower navigation, and more damage to the ship while navigating. -- **Drone** - drone ships are the simplest type of ship to automate. They don't require fuel or crew, but are slower, wear down quickly, and are incapable of jumping between systems without access to a jump gate. -- **Navigate** - slower-than-light travel between waypoints. A ship will depart from a waypoint and arrive at a destination after a duration has passed. -- **Orbit** - when your ship arrives at a waypoint, it will be in orbit. Your ship must be in orbit to execute certain actions such as a scan or extraction. You can transition your ship from docked to orbit. -- **Dock** - you can dock your ship at a waypoint after navigating to it. You will be able to execute market trades, and other planet-side actions once you've docked at a waypoint. -- **Jump** - faster-than-light travel between systems. Jumping requires a jump drive or access to a jump gate. Jumps are instantaneous but subject to a cooldown between jumps. -- **Extraction** - mines ore at an asteroid field or siphons gases at various waypoint types and deposits cargo into your ship. Surveying can be used to target specific yield types from a waypoint. -- **Survey** - analyze a waypoint for specific yields such as ore or hydrocarbons. The resulting surveys are time-sensitive and will eventually expire as they move out of reach of your ship. -- **Scan** - analyze a waypoint, route or system for more details. We currently support scanning approaching or departing ships at a waypoint, and will later support more modes of scanning. -- **Chart** - most systems and waypoints are unexplored and will need to be charted by an agent before others will be able to query that location. -- **Cooldown** - actions such as jumping, scanning and extracting will put your ship on a cooldown for that action. You should wait until the number of seconds have passed on the cooldown before attempting the action again. -- **Contract** - contracts are generated through factions, and might request your agent to procure goods of a certain type, or transport goods to a location by a certain time, in return for payment. -- **Delivery** - transfers goods from your ship's cargo bay into a contract. -- **Jettison** - ejects cargo from your ship's hold -- **Trade** - all goods in the universe have a unique trade symbol (in all caps), such as `IRON_ORE`, `NANOBOTS` or `REACTOR_FISSION_I`. -- **Market** - most populated waypoints have a market where you can buy and sell goods. Each market will have a list of imports, exports and commodities that you can trade in. Markets evolve with player activity - prices will rise and fall with trades, and new imports or exports will be added as the market grows. -- **Tariff** - a flat tax added to each unit of a good traded at a market -- **Shipyards** - where agents can purchase ships, perform maintenance, or install new modules and mounts. - -### New API Endpoints - -Here is a list of the new endpoints for the terms above. For this alpha-preview, some of the parameters for an endpoint are not fully implemented, but we've included them here to give an indication of what will be supported. - -Each endpoint also has an example response you can retrieve by sending `stub=true` as a query parameter or in your POST body. You can also view a stubbed response for an error code by sending `errorCode={code}` with the stub parameter. - -All routes that are prefixed with `/my` will require an agent access token to be passed as an `Authorization: Bearer {token}` header in the request. - -When registering your account, you will be given a different type of token called an Account Token, which allows you to create a new Agent or update your account details such as email address, discord handle or patreon code. - -All routes targeting a specific ship, such as `/my/ships/COBRA-00AF/survey` will put a lock on your ship until the request is resolved. This means you can only take a single action at a time for your ship. Sending two simultaneous actions for a single ship will throw a 409 conflict response code. - -All routes with the prefix `/systems` will return limited data until an agent submits the chart for that system or you have a ship present in the system. - -All actions are typically sent as a POST request and return a 201 status code. All query endpoints are sent as a GET request and will return a 200. Errors are detailed in the response body of a failed request, with a message and unique error code. - -Static game data can be queried and should be cached using the `/game/data` endpoint. Most objects returned in the response of a request will include only the symbols for static data, which you will want to map to the objects from the game data endpoint. - -```bash -# view agent details -/my/agent - -# view account details -/my/account - -# view all ships -/my/ships - -# view ship details -/my/ships/EMBER-01 - -# jump to a target system -/my/ships/EMBER-01/jump destination=X1-OE - -# navigate between waypoints (modes coming soon) -/my/ships/EMBER-01/navigate mode=CRUISE destination=OE-PM00A - -# dock at a waypoint if permitted -/my/ships/EMBER-01/dock mode=STEALTH - -# put your ship into orbit around a waypoint -/my/ships/EMBER-01/orbit mode=BLOCKADE,SPY,PATROL - -# acquire specific yield signatures in an asteroid field for extraction -/my/ships/EMBER-01/survey - -# extract raw materials from a waypoint such as an asteroid field or gas cloud -# send the full survey object as the payload to target a specific signature -/my/ships/EMBER-01/extract survey='{signature: "...", deposits: "...", expiration: "..."}' - -# purchase cargo and load it into your ship -/my/ships/EMBER-01/purchase tradeSymbol=HEAVY_MACHINERY units=99999 - -# sell cargo and unload it from your ship -/my/ships/EMBER-01/sell tradeSymbol=HEAVY_MACHINERY units=99999 - -# jettison cargo from your ship -/my/ships/EMBER-01/jettison tradeSymbol=HEAVY_MACHINERY units=99999 - -# view all systems -/systems - -# view system details -/systems/X1-OE - -# view waypoint details -/systems/X1-OE/waypoints/X1-OE-001A - -# view all shipyards in a system -/systems/X1-OE/shipyards - -# view all ships for sale at a shipyard -/systems/X1-OE/shipyards/X1-OE-001A/ships - -# view all markets in a system -/systems/X1-OE/markets - -# view all trades at a given market -/systems/X1-OE/markets/X1-OE-001A -``` - -## Quick Start - -If you are ready to dive in, just hit the endpoint to register as a new agent. Don't worry too much about account creation right now - temporary accounts will be setup when creating a new agent. We will likely still be doing hard resets during the alpha. - -```json http -{ - "method": "POST", - "url": "https://v2-0-0.alpha.spacetraders.io/agents", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "symbol": "YOUR_SYMBOL_HERE", - "faction": "COMMERCE_REPUBLIC" - } -} -``` - -When starting a new game, you'll have a command ship to fly around and a contract with the Commerce Republic that you can accept for some credits. Try completing the contract, or just fly around and begin trading and exploring. You can also purchase some low-upkeep drones to begin automating trade routes. - -## Roadmap - -We're still hard at work completing items we have envisioned for the alpha release. We're working on full API documentation in Spotlight Studio, seeding new types of ships and balancing stats, and so much more. - -Here is a list of what we are working on behind the scenes: - -- Full API documentation -- Seeding shipyards across the sector -- Command Points that are expended to control your ships -- A ship logs endpoint that keeps track of all your ship's actions and events that occur -- Markets evolving and systems growing / collapsing with agent activity -- Seeding unique factions across the universe and new contracts -- Ability to scavenge, salvage and run planet-side expeditions to discover hidden ruins and valuable relics -- Bi-weekly seasons with leaderboards for various achievements -- New documentation website with guides and explanation of game mechanics -- Tweaking API throttling -- Faction licenses to patrol and trade -- Ability to interdict ships as a patrol or pirate -- Shuttle populations around to grow new systems -- Constructing goods with the micro-fabricator / micro-refinery modules diff --git a/docs/markets.md b/docs/markets.md deleted file mode 100644 index 821c114..0000000 --- a/docs/markets.md +++ /dev/null @@ -1,73 +0,0 @@ -# Markets - -This document is an overview of how markets will work in the game. Not all of these details are currently implemented, but we wanted to share some of what SpaceTraders will offer when the game is released. - -Markets and trade are core concepts in the game and the primary credit-earning mechanism in SpaceTraders. Markets are dynamic and evolve over time as they are influenced by player activity. - -- Prices will fluctuate with trade and the natural production / consumption of goods. -- Trading drives the growth of a system, but a sudden drop in trade could also cause the system to fall into turmoil, instability and piracy. -- Agents can earn credits from markets through arbitrage - connect a trade route between the export of one market to the import of another and collect the difference in trade price. -- Markets evolve every day and agents who capitalize on these developing opportunities will be rewarded. -- Early markets can be dominated by a single player, but several players will have to work together to grow and maintain more mature markets. -- Agents can gain advanced notice of market events and shifts by leveraging their faction reputation or by spying on local comms. - -## Mechanics - -Markets have hidden mechanics that influence the price of goods, the trade volume of those goods, and market events that can occur with agent activity. Here is a quick overview of the basic mechanics of how markets function: - -- Markets are always in flux - prices are changing with the supply or consumption of goods. Sudden events can also disrupt or enhance trade. -- Every trade good has a production rate (exports) and consumption rate (imports) which naturally drive price changes over time. -- As agents purchase more and more of a exported trade good, the production of that good will increase until it catches up with demand -- As agents supply more and more of an imported trade good, the consumption of that good will increase and may trigger new exports or settlement growth -- A sudden drop in the trade of a good can quickly throw the market into instability - prices will hit extremes and eventually the settlement may fall into turmoil. -- If you are investing long-term in a market or faction, you will want to trade consistently to keep prices stable. - -## Market Stages - -All markets can be categorized into three stages: early, developing, and mature. There will be higher profits in mature markets, but they will be difficult to find and maintain. The best way to trade in a mature market is to trade in an early or developing market until it evolves. - -### Early Markets - -Early stage markets trade in low volume and high price volatility but with better margins. - -- Early settlements often demand commodities such as food, clothing and medicine. -- Supplying these settlements with their needs will provide high reputation rewards for early supporters, which can trigger the market to grow. -- Early markets evolve into developing markets after a period of sustained trade and stability. - -### Developing Markets - -Middle stage markets rely on a steady supply of imports and regular transport of exports to continue to grow. Trade failures at this stage can quickly send the system into turmoil and piracy. - -- Settlements will eventually develop a primary export and may develop related imports -- Developing markets will grow in trade volume and develop price stability with player activity -- These markets are at the highest risk of collapse - a sudden drop in trade volume can throw the whole settlement into turmoil -- Some markets will expand horizontally into related exports or develop brand new exports - -### Mature Markets - -Late stage markets export much rarer and higher-priced trade goods. These markets are often only accessible to agents with high reputation. - -- Export high-tech and luxury goods that are in high demand at most other settlements -- Mature market goods are primarily sold through negotiation -- Ships transporting high value goods will be likely targets for pirates and hostile factions - -### Black Markets - -Some goods will be prohibited by factions but can still be traded through negotiation. Although these trades can be lucrative, they can also destabilize the settlement and throw it into turmoil or piracy. Agents may want to prevent others from trading in black market goods by offering to patrol waypoints on behalf of the local faction. - -- Trading in black market goods can cause a significant drop in reputation if you're caught. -- Ship modules such as hidden cargo holds, higher-tier envoys, and stealth tech can improve attempts at black market trade. -- Ships can be scanned for black market goods which will be seized by patrols. -- Agents can help factions patrol for black market cargo to prevent damage to the overall market by other agents or competing factions. - -## Exchanges - -Exchanges are markets with many types of goods listed and the prices remain fairly stable over time. These markets don't have a natural production or consumption rate, but slowly trend toward a medium price over time. Exchanges are a good way to exchange goods between agents or other ships. - -## Negotiation - -Not all opportunities are listed in the markets. Every settlement has the potential to buy or sell any trade good in the game. You can send an envoy to a settlement and attempt to negotiate the purchase or selling of a good - however the trade is not guaranteed. This can often be a more lucrative way of unloading cargo rather than jettisoning it into space. - -- Regular trade via these negotiations can sometimes trigger the development of a new import or export in the market. -- High-tech and luxury goods are primarily sold through negotiation - these can net agents a great sum of credits. -- Reputation with the local faction can have a significant impact on the types, prices and quantities of goods offered through negotiation. diff --git a/docs/quickstart.md b/docs/quickstart.md new file mode 100644 index 0000000..6dd2f9b --- /dev/null +++ b/docs/quickstart.md @@ -0,0 +1,108 @@ +# What you do + +- you will register as a new agent and receive an API token +- you will gain a command ship and 100,000 credits in a starter system +- you will use the API to explore the universe and make money +- you will buy a mining ship, navigate to a neary asteroid field, and mine for resources +- you will find a nearby market to sell your resources +- you will explore new markets to find new goods to trade, better ships to buy, and upgrades for your ships +- you will scavenge derelict ships for parts and sell them for a profit +- you will send envoys to other factions to gain access to their markets +- you will send envoys to make trade deals not listed in the public markets +- you will search for lost artifacts and sell them for a profit or use them to upgrade your ships +- you will recruit crew members to help you run your ships +- you will chart new systems, discovering new factions and markets along the way + +# Game Restrictions + +- the API has a limit of 60 requests per minute +- you can only have one active agent per account +- account email must be verified to purchase ships +- you can only have 10 ships in your fleet at a time (including your command ship) +- each ship is limited to a single action at a time (don't send two requests for the same ship concurrently) +- your fleet must stay in range of your command ship (about 100 lightyears) +- you must maintain the condition of your ships or they will slow down considerably +- you must maintain crew morale or your ship will suffer from reduced performance and your crew may abandon your ship +- crew wages are due hourly and paid whenever your ship docks at a civilized waypoint +- you must maintain your ship's fuel or it may end up stranded without an ability to navigate +- ships can take damage when docking planet-side, orbiting dangerous waypoints, or when extracting resources from asteroids +- several factors will determine your ship's travel time including ship condition, engine stats, speed setting, crew morale, etc. +- more fuel is expended when traveling at higher speeds or when trying to leave a planet with atmospheric drag or high gravity +- uncharted systems will not have all details available until it has been charted by an agent +- most market data will only be available if you have a ship present at the given waypoint +- jump gates are typically restricted to other jump gates within the same faction +- most actions will result in a reactor cooldown, which will prevent your ship from taking other actions until the cooldown has expired + +# Factions and Reputation + +- faction contracts often provide better prices than public markets but may be more difficult to fulfill +- contracts grant some amount of payment upon accepting a contract, and the rest upon completing it +- you can send an envoy to generate new contracts with a faction +- failing to accept a generated contract will result in a minor loss of faction reputation +- failing to complete an accepted contract will result in a loss of faction reputation +- fulfilling a contract will result in a gain of faction reputation +- trading with a faction will marginally increase your reputation with that faction +- some markets are restricted until you have reached a certain threshold of reputation with a faction + +# Markets + +- a market lists imports and exports, recent transactions, and the current price of goods +- exports are typically listed at a lower purchasing price and imports listed at a higher selling price +- all other goods are considered "exchange" and are mostly driven by agent activity +- prices are driven by supply and demand, and typically change over time +- the listed imports and exports of a market also evolve over time, and some goods may become unavailable +- shipyard listings are also dynamically priced based on player activity +- you can send envoys to attempt to purchase or sell goods not listed in the public market +- off-market goods are typically traded in very low volumes and prices are typically volatile + +# Universe + +- the universe is procedurally generated with a few starter systems and factions +- the universe consists of systems, and systems are filled with waypoints, such as planets or asteroid fields +- each waypoint has an x, y coordinate, type and traits, and any orbitals that may be present +- a waypoint and it's orbitals share the same x, y coordinate + +# Navigation + +- jump gates are a type of waypoint that connects systems together, allowing your ship to jump to a new system instantly +- navigating between waypoints involves choosing a destination and waiting for your ship to arrive +- ships are either docked or in-orbit at a waypoint, which may limit what actions you can take + +# Generate an SDK from the API definition + +You can generate an SDK from the API definition using [OpenAPI Generator](https://openapi-generator.tech/). + +```bash +openapi-generator generate \ + -i reference/SpaceTraders.json \ + -o spacetraders-sdk \ + -g typescript-axios \ + --skip-validate-spec \ + --additional-properties=supportsES6=true +``` + +# Install HTTpie + +You can install [HTTpie](https://httpie.io/) using [Homebrew](https://brew.sh/). + +```bash +brew install httpie +``` + +# Register a temporary Account + +You can register a temporary account using the [Register](https://api-server-2-0-0-rc-2-vxxwq5xqdq-uc.a.run.app/register) endpoint. + +```json http +{ + "method": "POST", + "url": "https://api-server-2-0-0-rc-2-vxxwq5xqdq-uc.a.run.app/register", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "symbol": "YOUR_AGENT_SYMBOL", + "faction": "ASA" + } +} +``` diff --git a/models/ShipCrew.json b/models/ShipCrew.json index f48bcfb..16ad2d5 100644 --- a/models/ShipCrew.json +++ b/models/ShipCrew.json @@ -2,15 +2,15 @@ "type": "object", "description": "The ship's crew service and maintain the ship's systems and equipment.", "properties": { - "count": { + "current": { "type": "integer", - "description": "The total number of crew members on the ship." + "description": "The current number of crew members on the ship." }, - "min": { + "required": { "type": "integer", "description": "The minimum number of crew members required to maintain the ship." }, - "max": { + "capacity": { "type": "integer", "description": "The maximum number of crew members the ship can support." }, @@ -31,14 +31,14 @@ }, "wages": { "type": "integer", - "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.", + "description": "The amount of credits per crew member paid per hour. Wages are paid when a ship docks at a civilized waypoint.", "minimum": 0 } }, "required": [ - "count", - "min", - "max", + "current", + "required", + "capacity", "rotation", "morale", "wages" diff --git a/models/ShipFuel.json b/models/ShipFuel.json index 889ca5e..a86e324 100644 --- a/models/ShipFuel.json +++ b/models/ShipFuel.json @@ -2,9 +2,9 @@ "type": "object", "description": "Details of the ship's fuel tanks including how much fuel was consumed during the last transit or action.", "properties": { - "amount": { + "current": { "type": "integer", - "description": "The amount of fuel in the ship's tanks.", + "description": "The current amount of fuel in the ship's tanks.", "minimum": 0 }, "capacity": { @@ -33,7 +33,7 @@ } }, "required": [ - "amount", + "current", "capacity" ] } \ No newline at end of file diff --git a/models/TradeGood.json b/models/TradeGood.json index c67768d..62f5c9d 100644 --- a/models/TradeGood.json +++ b/models/TradeGood.json @@ -71,20 +71,6 @@ "NOVEL_LIFEFORMS", "BOTANICAL_SPECIMENS", "CULTURAL_ARTIFACTS", - "FRAME_PROBE", - "FRAME_DRONE", - "FRAME_INTERCEPTOR", - "FRAME_RACER", - "FRAME_FIGHTER", - "FRAME_FRIGATE", - "FRAME_SHUTTLE", - "FRAME_EXPLORER", - "FRAME_LIGHT_FREIGHTER", - "FRAME_HEAVY_FREIGHTER", - "FRAME_TRANSPORT", - "FRAME_DESTROYER", - "FRAME_CRUISER", - "FRAME_CARRIER", "REACTOR_SOLAR_I", "REACTOR_FUSION_I", "REACTOR_FISSION_I", diff --git a/resources/agent/MyAgent.json b/resources/agent/MyAgent.json deleted file mode 100644 index 925ffb5..0000000 --- a/resources/agent/MyAgent.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "get": { - "summary": "My Agent Details", - "tags": [ - "agents" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "../../models/Agent.yaml" - } - } - }, - "examples": { - "Agent": { - "value": { - "data": { - "accountId": "cl0hok34m0003ks0jjql5q8f2", - "symbol": "EMBER", - "headquarters": "X1-OE-PM", - "credits": 0 - } - } - } - } - } - } - } - }, - "operationId": "get-my-agent", - "security": [ - { - "AgentToken": [] - } - ], - "description": "Fetch your agent's details." - } -} \ No newline at end of file diff --git a/resources/agent/RegisterAgent.json b/resources/agent/RegisterAgent.json deleted file mode 100644 index a76abf5..0000000 --- a/resources/agent/RegisterAgent.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "post": { - "operationId": "register-agent", - "summary": "Register New Agent", - "description": "Creates a new agent and ties it to a temporary Account. Use `COMMERCE_REPUBLIC` as your starting faction if you don't know any other factions to choose from.\n\nThe agent symbol is a 4-8 character string that will represent your agent. This symbol will prefix the symbol of every ship you own. Agent symbols will be cast to all uppercase characters.\n\nA new agent will be granted an authorization token, a contract with their starting faction, a command ship with a jump drive, and one hundred thousand credits.\n\n> #### Keep your token safe and secure\n>\n> Save your token during the alpha phase. There is no way to regenerate this token without starting a new agent. In the future you will be able to generate and manage your tokens from the SpaceTraders website.\n\nYou can accept your contract using the `/my/contracts/{contractId}/accept` endpoint. You will want to navigate your command ship to a nearby asteroid field waypoint, and execute the `/my/ships/{shipSymbol}/accept` endpoint to mine various types of ores and minerals.\n\nReturn to the contract destination and execute the `/my/ships/{shipSymbol}/deliver` endpoint to deposit goods into the contract.\n\nWhen your contract is fulfilled, you can call `/my/contracts/{contractId}/fulfill` to retrieve payment.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "How other agents will see your ships and information.", - "minLength": 4, - "maxLength": 8, - "example": "BADGER" - }, - "faction": { - "type": "string", - "default": "COMMERCE_REPUBLIC", - "description": "The faction you choose determines your headquarters." - } - } - } - } - }, - "description": "" - }, - "responses": { - "201": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "token": { - "type": "string" - }, - "agent": { - "$ref": "../../models/Agent.yaml" - }, - "faction": { - "$ref": "../../models/Faction.yaml" - }, - "contract": { - "$ref": "../../models/Contract.yaml" - }, - "ship": { - "$ref": "../../models/Ship.json" - } - } - } - } - } - } - } - } - }, - "tags": [ - "agents" - ] - } -} \ No newline at end of file From b6a1eb7900172ae177f44213f090d75c7c528713 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Wed, 7 Dec 2022 22:12:49 -0800 Subject: [PATCH 22/48] better marketplace trade description --- models/MarketTradeGood.json | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/models/MarketTradeGood.json b/models/MarketTradeGood.json index 0b6ba5a..bfc3bba 100644 --- a/models/MarketTradeGood.json +++ b/models/MarketTradeGood.json @@ -7,26 +7,27 @@ }, "tradeVolume": { "type": "integer", - "description": "The typical volume flowing through the market for this type of good.", - "minimum": 1 + "description": "The typical volume flowing through the market for this type of good. The larger the trade volume, the more stable prices will be.", + "minimum": 10 }, "supply": { "type": "string", - "description": "A rough estimate of the total supply of this good in this marketplace.", + "description": "A rough estimate of the total supply of this good in the marketplace.", "enum": [ - "HIGH", - "AVERAGE", - "LOW" + "SCARCE", + "LIMITED", + "MODERATE", + "ABUNDANT" ] }, "purchasePrice": { "type": "integer", - "description": "The price at which this good is sold.", + "description": "The price at which this good can be purchased from the market.", "minimum": 0 }, "sellPrice": { "type": "integer", - "description": "The price at which this good is bought.", + "description": "The price at which this good can be sold to the market.", "minimum": 0 } }, From 8d508283cdbe1cec7d8018108b34ac8635443dac Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Sat, 10 Dec 2022 08:11:53 -0800 Subject: [PATCH 23/48] add quickstart WIP --- docs/quickstart.md | 1 + models/ShipNavSpeed.json | 7 ++++--- models/ShipyardTransaction.json | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/quickstart.md b/docs/quickstart.md index 6dd2f9b..70feb11 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -32,6 +32,7 @@ - most market data will only be available if you have a ship present at the given waypoint - jump gates are typically restricted to other jump gates within the same faction - most actions will result in a reactor cooldown, which will prevent your ship from taking other actions until the cooldown has expired +- markets have a limit on how many units can be bought or sold at a given time, which is the same as the market's trade volume # Factions and Reputation diff --git a/models/ShipNavSpeed.json b/models/ShipNavSpeed.json index 84e626c..0afac5d 100644 --- a/models/ShipNavSpeed.json +++ b/models/ShipNavSpeed.json @@ -1,10 +1,11 @@ { "type": "string", - "description": "The ship's set speed when travelling between waypoints. Nav speed can wear down the ship's engines and lower crew morale but improves travel time.", + "description": "The ship's set speed when travelling between waypoints.", "enum": [ - "CONSERVATIVE", + "DRIFT", + "STEALTH", "CRUISE", - "MAX" + "BURN" ], "default": "CRUISE" } \ No newline at end of file diff --git a/models/ShipyardTransaction.json b/models/ShipyardTransaction.json index dc0fd3e..8e9461b 100644 --- a/models/ShipyardTransaction.json +++ b/models/ShipyardTransaction.json @@ -1,7 +1,7 @@ { "type": "object", "properties": { - "symbol": { + "shipSymbol": { "type": "string", "description": "The symbol of the ship that was purchased." }, From 754b5784386a0601f5fd0ad6c601698c6e09e572 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Fri, 16 Dec 2022 19:03:59 -0800 Subject: [PATCH 24/48] add transfer endpoint, tweaks to market --- models/Market.json | 8 ++-- models/Waypoint.json | 2 +- reference/SpaceTraders.json | 95 ++++++++++++++++++++++++++++++++++++- 3 files changed, 97 insertions(+), 8 deletions(-) diff --git a/models/Market.json b/models/Market.json index 141e8d1..dca15cf 100644 --- a/models/Market.json +++ b/models/Market.json @@ -34,14 +34,14 @@ }, "transactions": { "type": "array", - "description": "The list of recent transactions at this market.", + "description": "The list of recent transactions at this market. Visible only when a ship is present at the market.", "items": { "$ref": "./MarketTransaction.json" } }, "tradeGoods": { "type": "array", - "description": "The list of goods that are traded at this market.", + "description": "The list of goods that are traded at this market. Visible only when a ship is present at the market.", "items": { "$ref": "./MarketTradeGood.json" } @@ -50,8 +50,6 @@ "required": [ "symbol", "exports", - "imports", - "transactions", - "tradeGoods" + "imports" ] } \ No newline at end of file diff --git a/models/Waypoint.json b/models/Waypoint.json index 50aaf18..b0ab1a2 100644 --- a/models/Waypoint.json +++ b/models/Waypoint.json @@ -26,7 +26,7 @@ } }, "faction": { - "$ref": "./Faction.json" + "$ref": "./WaypointFaction.json" }, "traits": { "type": "array", diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index d905571..a95ecd3 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -68,9 +68,19 @@ "schema": { "properties": { "faction": { - "default": "COMMERCE_REPUBLIC", "description": "The faction you choose determines your headquarters.", - "type": "string" + "enum": [ + "COSMIC", + "VOID", + "GALLACTIC", + "QUANTUM", + "DOMINION", + "ASTRO", + "CORSAIRS", + "UNITED", + "SOLITARY", + "COBALT" + ] }, "symbol": { "description": "How other agents will see your ships and information.", @@ -1984,6 +1994,87 @@ "fleet" ] } + }, + "/my/ships/{shipSymbol}/transfer": { + "parameters": [ + { + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Transfer cargo between ships.", + "operationId": "transfer-cargo", + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "Transfer Cargo Request", + "properties": { + "tradeSymbol": { + "type": "string" + }, + "units": { + "type": "integer" + }, + "shipSymbol": { + "type": "string" + } + }, + "required": [ + "tradeSymbol", + "units", + "shipSymbol" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Transfer Cargo 200 Response", + "description": "", + "properties": { + "data": { + "properties": { + "cargo": { + "$ref": "../models/ShipCargo.json" + } + }, + "required": [ + "cargo" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "Created" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Transfer Cargo", + "tags": [ + "fleet" + ] + } } } } \ No newline at end of file From cbcf07190d1f559f517b37b9663dbb6adfe93da4 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Sat, 17 Dec 2022 08:16:01 -0800 Subject: [PATCH 25/48] add missing attributes --- models/Cooldown.json | 6 ++++++ models/ShipModule.json | 8 ++++++++ models/ShipMount.json | 4 ++++ models/SystemWaypoint.json | 6 +++++- reference/SpaceTraders.json | 2 +- 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/models/Cooldown.json b/models/Cooldown.json index 148d98c..f10e582 100644 --- a/models/Cooldown.json +++ b/models/Cooldown.json @@ -2,6 +2,11 @@ "type": "object", "description": "A cooldown is a period of time in which a ship cannot perform certain actions.", "properties": { + "shipSymbol": { + "type": "string", + "description": "The symbol of the ship that is on cooldown", + "minLength": 1 + }, "totalSeconds": { "type": "integer", "description": "The total duration of the cooldown in seconds", @@ -20,6 +25,7 @@ } }, "required": [ + "shipSymbol", "totalSeconds", "remainingSeconds", "expiration" diff --git a/models/ShipModule.json b/models/ShipModule.json index 4e3c145..916b751 100644 --- a/models/ShipModule.json +++ b/models/ShipModule.json @@ -19,6 +19,14 @@ "MODULE_SHIELD_GENERATOR_II" ] }, + "capacity": { + "type": "integer", + "minimum": 0 + }, + "range": { + "type": "integer", + "minimum": 0 + }, "name": { "type": "string" }, diff --git a/models/ShipMount.json b/models/ShipMount.json index 889cf8d..48be0c5 100644 --- a/models/ShipMount.json +++ b/models/ShipMount.json @@ -25,6 +25,10 @@ "description": { "type": "string" }, + "strength": { + "type": "integer", + "minimum": 0 + }, "requirements": { "$ref": "./ShipRequirements.json" } diff --git a/models/SystemWaypoint.json b/models/SystemWaypoint.json index 3de74e8..39c74e1 100644 --- a/models/SystemWaypoint.json +++ b/models/SystemWaypoint.json @@ -3,9 +3,13 @@ "properties": { "symbol": { "type": "string" + }, + "type": { + "$ref": "./WaypointType.json" } }, "required": [ - "symbol" + "symbol", + "type" ] } \ No newline at end of file diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index a95ecd3..bb4e65f 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -60,7 +60,7 @@ "paths": { "/register": { "post": { - "description": "Creates a new agent and ties it to a temporary Account. Use `COMMERCE_REPUBLIC` as your starting faction if you don't know any other factions to choose from.\n\nThe agent symbol is a 4-8 character string that will represent your agent. This symbol will prefix the symbol of every ship you own. Agent symbols will be cast to all uppercase characters.\n\nA new agent will be granted an authorization token, a contract with their starting faction, a command ship with a jump drive, and one hundred thousand credits.\n\n> #### Keep your token safe and secure\n>\n> Save your token during the alpha phase. There is no way to regenerate this token without starting a new agent. In the future you will be able to generate and manage your tokens from the SpaceTraders website.\n\nYou can accept your contract using the `/my/contracts/{contractId}/accept` endpoint. You will want to navigate your command ship to a nearby asteroid field waypoint, and execute the `/my/ships/{shipSymbol}/accept` endpoint to mine various types of ores and minerals.\n\nReturn to the contract destination and execute the `/my/ships/{shipSymbol}/deliver` endpoint to deposit goods into the contract.\n\nWhen your contract is fulfilled, you can call `/my/contracts/{contractId}/fulfill` to retrieve payment.", + "description": "Creates a new agent and ties it to a temporary Account.\n\nThe agent symbol is a 4-8 character string that will represent your agent. This symbol will prefix the symbol of every ship you own. Agent symbols will be cast to all uppercase characters.\n\nA new agent will be granted an authorization token, a contract with their starting faction, a command ship with a jump drive, and one hundred thousand credits.\n\n> #### Keep your token safe and secure\n>\n> Save your token during the alpha phase. There is no way to regenerate this token without starting a new agent. In the future you will be able to generate and manage your tokens from the SpaceTraders website.\n\nYou can accept your contract using the `/my/contracts/{contractId}/accept` endpoint. You will want to navigate your command ship to a nearby asteroid field and execute the `/my/ships/{shipSymbol}/extract` endpoint to mine various types of ores and minerals.\n\nReturn to the contract destination and execute the `/my/ships/{shipSymbol}/deliver` endpoint to deposit goods into the contract.\n\nWhen your contract is fulfilled, you can call `/my/contracts/{contractId}/fulfill` to retrieve payment.", "operationId": "register", "requestBody": { "content": { From 19728e019cd53d34794f307f7b06327fbaa0e50f Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Sat, 17 Dec 2022 09:32:19 -0800 Subject: [PATCH 26/48] update scan endpoints --- models/ScannedSystem.json | 34 +++++++++ models/SystemWaypoint.json | 10 ++- reference/SpaceTraders.json | 144 +++++++++++++++++++----------------- 3 files changed, 119 insertions(+), 69 deletions(-) create mode 100644 models/ScannedSystem.json diff --git a/models/ScannedSystem.json b/models/ScannedSystem.json new file mode 100644 index 0000000..504c1c0 --- /dev/null +++ b/models/ScannedSystem.json @@ -0,0 +1,34 @@ +{ + "description": "", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "minLength": 1 + }, + "sectorSymbol": { + "type": "string", + "minLength": 1 + }, + "type": { + "$ref": "./SystemType.json" + }, + "x": { + "type": "integer" + }, + "y": { + "type": "integer" + }, + "distance": { + "type": "integer" + } + }, + "required": [ + "symbol", + "sectorSymbol", + "type", + "x", + "y", + "distance" + ] +} \ No newline at end of file diff --git a/models/SystemWaypoint.json b/models/SystemWaypoint.json index 39c74e1..8ca378c 100644 --- a/models/SystemWaypoint.json +++ b/models/SystemWaypoint.json @@ -6,10 +6,18 @@ }, "type": { "$ref": "./WaypointType.json" + }, + "x": { + "type": "integer" + }, + "y": { + "type": "integer" } }, "required": [ "symbol", - "type" + "type", + "x", + "y" ] } \ No newline at end of file diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index bb4e65f..3be2869 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -1738,7 +1738,7 @@ ] } }, - "/my/ships/{shipSymbol}/scan": { + "/my/ships/{shipSymbol}/scan/systems": { "parameters": [ { "in": "path", @@ -1750,43 +1750,8 @@ } ], "post": { - "description": "Activate your ship's sensor arrays to scan for arriving ships, departing ships, system information, or waypoint information. Send a scan mode to select the type of scan performed by your ship.", - "operationId": "create-ship-scan", - "requestBody": { - "content": { - "application/json": { - "examples": { - "Approaching Ships": { - "value": { - "mode": "APPROACHING_SHIPS" - } - }, - "Departing Ships": { - "value": { - "mode": "DEPARTING_SHIPS" - } - } - }, - "schema": { - "properties": { - "mode": { - "enum": [ - "APPROACHING_SHIPS", - "DEPARTING_SHIPS", - "WAYPOINT" - ], - "type": "string" - } - }, - "required": [ - "mode" - ], - "type": "object" - } - } - }, - "description": "" - }, + "description": "Activate your ship's sensor arrays to scan for system information.", + "operationId": "create-ship-system-scan", "responses": { "201": { "content": { @@ -1795,38 +1760,20 @@ "description": "", "properties": { "data": { - "oneOf": [ - { - "properties": { - "cooldown": { - "$ref": "../models/Cooldown.json" - }, - "ships": { - "items": { - "$ref": "../models/ScannedShip.json" - }, - "type": "array" - } - }, - "required": [ - "ships", - "cooldown" - ] + "properties": { + "cooldown": { + "$ref": "../models/Cooldown.json" }, - { - "properties": { - "cooldown": { - "$ref": "../models/Cooldown.json" - }, - "waypoint": { - "$ref": "../models/Waypoint.json" - } + "systems": { + "items": { + "$ref": "../models/ScannedSystem.json" }, - "required": [ - "cooldown", - "waypoint" - ] + "type": "array" } + }, + "required": [ + "cooldown", + "systems" ], "type": "object" } @@ -1846,7 +1793,68 @@ "AgentToken": [] } ], - "summary": "Scan", + "summary": "Scan Systems", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}/scan/ships": { + "parameters": [ + { + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Activate your ship's sensor arrays to scan for ship information.", + "operationId": "create-ship-ship-scan", + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "cooldown": { + "$ref": "../models/Cooldown.json" + }, + "ships": { + "items": { + "$ref": "../models/ScannedShip.json" + }, + "type": "array" + } + }, + "required": [ + "cooldown", + "ships" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "Created" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Scan Ships", "tags": [ "fleet" ] From a27432248e4ae045c7711e86524d75e7c49052f9 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Sun, 18 Dec 2022 15:04:13 -0800 Subject: [PATCH 27/48] - add warp endpoint - rename ship symbol to ship type - update ship modules and engines w/ new types --- models/ShipEngine.json | 4 +- models/ShipModule.json | 17 ++++--- models/ShipType.json | 15 +++++++ models/ShipyardShip.json | 15 +------ models/TradeGood.json | 18 ++++---- reference/SpaceTraders.json | 88 ++++++++++++++++++++++++++++++++++--- 6 files changed, 120 insertions(+), 37 deletions(-) create mode 100644 models/ShipType.json diff --git a/models/ShipEngine.json b/models/ShipEngine.json index 3a1d032..b5bdb88 100644 --- a/models/ShipEngine.json +++ b/models/ShipEngine.json @@ -5,10 +5,10 @@ "symbol": { "type": "string", "enum": [ - "ENGINE_IMPULSE_DRIVE", + "ENGINE_IMPULSE_DRIVE_I", "ENGINE_ION_DRIVE_I", "ENGINE_ION_DRIVE_II", - "ENGINE_HYPER_DRIVE" + "ENGINE_HYPER_DRIVE_I" ] }, "name": { diff --git a/models/ShipModule.json b/models/ShipModule.json index 916b751..813c9b2 100644 --- a/models/ShipModule.json +++ b/models/ShipModule.json @@ -5,16 +5,19 @@ "symbol": { "type": "string", "enum": [ - "MODULE_MINERAL_PROCESSOR", - "MODULE_CARGO_HOLD", - "MODULE_CREW_QUARTERS", - "MODULE_ENVOY_QUARTERS", - "MODULE_PASSENGER_CABIN", - "MODULE_MICRO_REFINERY", - "MODULE_SCIENCE_LAB", + "MODULE_MINERAL_PROCESSOR_I", + "MODULE_CARGO_HOLD_I", + "MODULE_CREW_QUARTERS_I", + "MODULE_ENVOY_QUARTERS_I", + "MODULE_PASSENGER_CABIN_I", + "MODULE_MICRO_REFINERY_I", + "MODULE_SCIENCE_LAB_I", "MODULE_JUMP_DRIVE_I", "MODULE_JUMP_DRIVE_II", "MODULE_JUMP_DRIVE_III", + "MODULE_WARP_DRIVE_I", + "MODULE_WARP_DRIVE_II", + "MODULE_WARP_DRIVE_III", "MODULE_SHIELD_GENERATOR_I", "MODULE_SHIELD_GENERATOR_II" ] diff --git a/models/ShipType.json b/models/ShipType.json new file mode 100644 index 0000000..0642999 --- /dev/null +++ b/models/ShipType.json @@ -0,0 +1,15 @@ +{ + "description": "", + "type": "string", + "enum": [ + "SHIP_PROBE", + "SHIP_MINING_DRONE", + "SHIP_INTERCEPTOR", + "SHIP_LIGHT_HAULER", + "SHIP_COMMAND_FRIGATE", + "SHIP_EXPLORER", + "SHIP_HEAVY_FREIGHTER", + "SHIP_LIGHT_SHUTTLE", + "SHIP_ORE_HOUND" + ] +} \ No newline at end of file diff --git a/models/ShipyardShip.json b/models/ShipyardShip.json index 3df7d82..6a4819b 100644 --- a/models/ShipyardShip.json +++ b/models/ShipyardShip.json @@ -2,19 +2,8 @@ "description": "", "type": "object", "properties": { - "symbol": { - "type": "string", - "enum": [ - "SHIP_PROBE_SATELLITE", - "SHIP_MINING_DRONE", - "SHIP_INTERCEPTOR", - "SHIP_LIGHT_HAULER", - "SHIP_COMMAND_FRIGATE", - "SHIP_EXPLORER", - "SHIP_HEAVY_FREIGHTER", - "SHIP_LIGHT_SHUTTLE", - "SHIP_ORE_HOUND" - ] + "type": { + "$ref": "./ShipType.json" }, "name": { "type": "string" diff --git a/models/TradeGood.json b/models/TradeGood.json index 62f5c9d..e7224e6 100644 --- a/models/TradeGood.json +++ b/models/TradeGood.json @@ -76,17 +76,17 @@ "REACTOR_FISSION_I", "REACTOR_CHEMICAL_I", "REACTOR_ANTIMATTER_I", - "ENGINE_IMPULSE_DRIVE", + "ENGINE_IMPULSE_DRIVE_I", "ENGINE_ION_DRIVE_I", "ENGINE_ION_DRIVE_II", - "ENGINE_HYPER_DRIVE", - "MODULE_MINERAL_PROCESSOR", - "MODULE_CARGO_HOLD", - "MODULE_CREW_QUARTERS", - "MODULE_ENVOY_QUARTERS", - "MODULE_PASSENGER_CABIN", - "MODULE_MICRO_REFINERY", - "MODULE_SCIENCE_LAB", + "ENGINE_HYPER_DRIVE_I", + "MODULE_MINERAL_PROCESSOR_I", + "MODULE_CARGO_HOLD_I", + "MODULE_CREW_QUARTERS_I", + "MODULE_ENVOY_QUARTERS_I", + "MODULE_PASSENGER_CABIN_I", + "MODULE_MICRO_REFINERY_I", + "MODULE_SCIENCE_LAB_I", "MODULE_JUMP_DRIVE_I", "MODULE_JUMP_DRIVE_II", "MODULE_JUMP_DRIVE_III", diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 3be2869..493a185 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -970,9 +970,8 @@ "application/json": { "schema": { "properties": { - "shipSymbol": { - "description": "The symbol of the ship you want to purchase.", - "type": "string" + "shipType": { + "$ref": "../models/ShipType.json" }, "waypointSymbol": { "description": "The symbol of the waypoint you want to purchase the ship at.", @@ -980,7 +979,7 @@ } }, "required": [ - "shipSymbol", + "shipType", "waypointSymbol" ], "type": "object" @@ -1511,7 +1510,7 @@ } ], "post": { - "description": "Jump your ship from one system to another.", + "description": "Jump your ship instantly to a target system. Unlike other forms of navigation, jumping requires a unit of antimatter.", "operationId": "jump-ship", "requestBody": { "content": { @@ -1588,7 +1587,7 @@ } ], "post": { - "description": "Navigate to a target destination. The destination must be located within the same system as the ship. Navigating will consume the necessary fuel and supplies from the ship's manifest, and will pay out crew wages from the agent's account.\n\nThe returned response will detail the route information including the expected time of arrival. Most ship actions are unavailable until the ship has arrived at it's destination.\n\nFor faster-than-light travel between systems, see the ship's jump action.", + "description": "Navigate to a target destination. The destination must be located within the same system as the ship. Navigating will consume the necessary fuel and supplies from the ship's manifest, and will pay out crew wages from the agent's account.\n\nThe returned response will detail the route information including the expected time of arrival. Most ship actions are unavailable until the ship has arrived at it's destination.\n\nTo travel between systems, see the ship's warp or jump actions.", "operationId": "navigate-ship", "requestBody": { "content": { @@ -1653,6 +1652,83 @@ ] } }, + "/my/ships/{shipSymbol}/warp": { + "parameters": [ + { + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Warp your ship to a target destination in another system. Warping will consume the necessary fuel and supplies from the ship's manifest, and will pay out crew wages from the agent's account.\n\nThe returned response will detail the route information including the expected time of arrival. Most ship actions are unavailable until the ship has arrived at it's destination.", + "operationId": "warp-ship", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "waypointSymbol": { + "description": "The target destination.", + "type": "string" + } + }, + "required": [ + "waypointSymbol" + ], + "type": "object" + } + } + }, + "description": "" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "fuel": { + "$ref": "../models/ShipFuel.json" + }, + "nav": { + "$ref": "../models/ShipNav.json" + } + }, + "required": [ + "nav", + "fuel" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "The successful transit information including the route details and changes to ship fuel, supplies, and crew wages paid. The route includes the expected time of arrival." + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Warp Ship", + "tags": [ + "fleet" + ] + } + }, "/my/ships/{shipSymbol}/sell": { "parameters": [ { From 7603bcfd674672c2d0e863fdcfa5a1622d81d697 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Sun, 18 Dec 2022 21:39:25 -0800 Subject: [PATCH 28/48] rename speed to flight mode --- models/ShipNav.json | 6 +++--- .../{ShipNavSpeed.json => ShipNavFlightMode.json} | 2 +- models/Shipyard.json | 14 +++++++++++++- 3 files changed, 17 insertions(+), 5 deletions(-) rename models/{ShipNavSpeed.json => ShipNavFlightMode.json} (57%) diff --git a/models/ShipNav.json b/models/ShipNav.json index 4250faf..c6aaf57 100644 --- a/models/ShipNav.json +++ b/models/ShipNav.json @@ -16,8 +16,8 @@ "status": { "$ref": "./ShipNavStatus.json" }, - "speed": { - "$ref": "./ShipNavSpeed.json" + "flightMode": { + "$ref": "./ShipNavFlightMode.json" } }, "required": [ @@ -25,6 +25,6 @@ "waypointSymbol", "route", "status", - "speed" + "flightMode" ] } \ No newline at end of file diff --git a/models/ShipNavSpeed.json b/models/ShipNavFlightMode.json similarity index 57% rename from models/ShipNavSpeed.json rename to models/ShipNavFlightMode.json index 0afac5d..39dee56 100644 --- a/models/ShipNavSpeed.json +++ b/models/ShipNavFlightMode.json @@ -1,6 +1,6 @@ { "type": "string", - "description": "The ship's set speed when travelling between waypoints.", + "description": "The ship's set speed when traveling between waypoints or systems.", "enum": [ "DRIFT", "STEALTH", diff --git a/models/Shipyard.json b/models/Shipyard.json index 9803aad..d63a7f9 100644 --- a/models/Shipyard.json +++ b/models/Shipyard.json @@ -7,6 +7,18 @@ "description": "The symbol of the shipyard. The symbol is the same as the waypoint where the shipyard is located.", "minLength": 1 }, + "shipTypes": { + "type": "array", + "description": "The list of ship types available for purchase at this shipyard.", + "items": { + "type": "object", + "properties": { + "type": { + "$ref": "./ShipType.json" + } + } + } + }, "transactions": { "type": "array", "description": "The list of recent transactions at this shipyard.", @@ -24,6 +36,6 @@ }, "required": [ "symbol", - "ships" + "shipTypes" ] } \ No newline at end of file From 2893a700dc6556ee23b13d9794eb76a06e65212d Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Mon, 19 Dec 2022 21:23:20 -0800 Subject: [PATCH 29/48] add size enum to survey --- models/Survey.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/models/Survey.json b/models/Survey.json index a9d8837..7cd4f44 100644 --- a/models/Survey.json +++ b/models/Survey.json @@ -24,12 +24,22 @@ "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 + }, + "size": { + "type": "string", + "description": "The size of the deposit. This value indicates how much can be extracted from the survey before it is exhausted.", + "enum": [ + "SMALL", + "MODERATE", + "LARGE" + ] } }, "required": [ "signature", "symbol", "deposits", - "expiration" + "expiration", + "size" ] } \ No newline at end of file From f64f87fa1da3cb429480285ccb289fcf5a4c9e88 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Tue, 20 Dec 2022 21:40:46 -0800 Subject: [PATCH 30/48] add refine endpoint add refinery modules add refining freighter ship add enum for TradeSymbol --- models/ShipModule.json | 4 +- models/ShipType.json | 3 +- models/TradeGood.json | 133 ++--------------- models/TradeSymbol.json | 109 ++++++++++++++ reference/SpaceTraders.json | 282 ++++++++++++++++++++++-------------- 5 files changed, 304 insertions(+), 227 deletions(-) create mode 100644 models/TradeSymbol.json diff --git a/models/ShipModule.json b/models/ShipModule.json index 813c9b2..05139e1 100644 --- a/models/ShipModule.json +++ b/models/ShipModule.json @@ -1,6 +1,6 @@ { "type": "object", - "description": "A module can be installed in a ship and provides a set of capabilities such as storage space or quarters for crew.", + "description": "A module can be installed in a ship and provides a set of capabilities such as storage space or quarters for crew. Module installations are permanent.", "properties": { "symbol": { "type": "string", @@ -11,6 +11,8 @@ "MODULE_ENVOY_QUARTERS_I", "MODULE_PASSENGER_CABIN_I", "MODULE_MICRO_REFINERY_I", + "MODULE_ORE_REFINERY_I", + "MODULE_FUEL_REFINERY_I", "MODULE_SCIENCE_LAB_I", "MODULE_JUMP_DRIVE_I", "MODULE_JUMP_DRIVE_II", diff --git a/models/ShipType.json b/models/ShipType.json index 0642999..15b8e21 100644 --- a/models/ShipType.json +++ b/models/ShipType.json @@ -10,6 +10,7 @@ "SHIP_EXPLORER", "SHIP_HEAVY_FREIGHTER", "SHIP_LIGHT_SHUTTLE", - "SHIP_ORE_HOUND" + "SHIP_ORE_HOUND", + "SHIP_REFINING_FREIGHTER" ] } \ No newline at end of file diff --git a/models/TradeGood.json b/models/TradeGood.json index e7224e6..e1af4ee 100644 --- a/models/TradeGood.json +++ b/models/TradeGood.json @@ -1,120 +1,19 @@ { - "symbol": { - "type": "string", - "enum": [ - "PRECIOUS_STONES", - "QUARTZ_SAND", - "SILICON_CRYSTALS", - "AMMONIA_ICE", - "LIQUID_HYDROGEN", - "LIQUID_NITROGEN", - "ICE_WATER", - "EXOTIC_MATTER", - "ADVANCED_CIRCUITRY", - "GRAVITON_EMITTERS", - "IRON", - "IRON_ORE", - "COPPER", - "COPPER_ORE", - "ALUMINUM", - "ALUMINUM_ORE", - "SILVER", - "SILVER_ORE", - "GOLD", - "GOLD_ORE", - "PLATINUM", - "PLATINUM_ORE", - "DIAMONDS", - "URANITE", - "URANITE_ORE", - "MERITIUM", - "MERITIUM_ORE", - "HYDROCARBON", - "ANTIMATTER", - "FERTILIZERS", - "FABRICS", - "FOOD", - "JEWELRY", - "MACHINERY", - "FIREARMS", - "ASSAULT_RIFLES", - "MILITARY_EQUIPMENT", - "EXPLOSIVES", - "LAB_INSTRUMENTS", - "AMMUNITION", - "ELECTRONICS", - "SHIP_PLATING", - "EQUIPMENT", - "FUEL", - "MEDICINE", - "DRUGS", - "CLOTHING", - "MICROPROCESSORS", - "PLASTICS", - "POLYNUCLEOTIDES", - "BIOCOMPOSITES", - "NANOBOTS", - "AI_MAINFRAMES", - "QUANTUM_DRIVES", - "ROBOTIC_DRONES", - "CYBER_IMPLANTS", - "GENE_THERAPEUTICS", - "NEURAL_CHIPS", - "MOOD_REGULATORS", - "VIRAL_AGENTS", - "MICRO_FUSION_GENERATORS", - "SUPERGRAINS", - "LASER_RIFLES", - "HOLOGRAPHICS", - "SHIP_SALVAGE", - "RELIC_TECH", - "NOVEL_LIFEFORMS", - "BOTANICAL_SPECIMENS", - "CULTURAL_ARTIFACTS", - "REACTOR_SOLAR_I", - "REACTOR_FUSION_I", - "REACTOR_FISSION_I", - "REACTOR_CHEMICAL_I", - "REACTOR_ANTIMATTER_I", - "ENGINE_IMPULSE_DRIVE_I", - "ENGINE_ION_DRIVE_I", - "ENGINE_ION_DRIVE_II", - "ENGINE_HYPER_DRIVE_I", - "MODULE_MINERAL_PROCESSOR_I", - "MODULE_CARGO_HOLD_I", - "MODULE_CREW_QUARTERS_I", - "MODULE_ENVOY_QUARTERS_I", - "MODULE_PASSENGER_CABIN_I", - "MODULE_MICRO_REFINERY_I", - "MODULE_SCIENCE_LAB_I", - "MODULE_JUMP_DRIVE_I", - "MODULE_JUMP_DRIVE_II", - "MODULE_JUMP_DRIVE_III", - "MODULE_SHIELD_GENERATOR_I", - "MODULE_SHIELD_GENERATOR_II", - "MOUNT_GAS_SIPHON_I", - "MOUNT_GAS_SIPHON_II", - "MOUNT_GAS_SIPHON_III", - "MOUNT_SENSOR_ARRAY_I", - "MOUNT_SENSOR_ARRAY_II", - "MOUNT_SENSOR_ARRAY_III", - "MOUNT_MINING_LASER_I", - "MOUNT_MINING_LASER_II", - "MOUNT_MINING_LASER_III", - "MOUNT_LASER_CANNON_I", - "MOUNT_MISSILE_LAUNCHER_I", - "MOUNT_TURRET_I" + "type": "object", + "attributes": { + "symbol": { + "$ref": "./TradeSymbol.json" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "required": [ + "symbol", + "name", + "description" ] - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "required": [ - "symbol", - "name", - "description" - ] + } } \ No newline at end of file diff --git a/models/TradeSymbol.json b/models/TradeSymbol.json new file mode 100644 index 0000000..2ef60ff --- /dev/null +++ b/models/TradeSymbol.json @@ -0,0 +1,109 @@ +{ + "type": "string", + "enum": [ + "PRECIOUS_STONES", + "QUARTZ_SAND", + "SILICON_CRYSTALS", + "AMMONIA_ICE", + "LIQUID_HYDROGEN", + "LIQUID_NITROGEN", + "ICE_WATER", + "EXOTIC_MATTER", + "ADVANCED_CIRCUITRY", + "GRAVITON_EMITTERS", + "IRON", + "IRON_ORE", + "COPPER", + "COPPER_ORE", + "ALUMINUM", + "ALUMINUM_ORE", + "SILVER", + "SILVER_ORE", + "GOLD", + "GOLD_ORE", + "PLATINUM", + "PLATINUM_ORE", + "DIAMONDS", + "URANITE", + "URANITE_ORE", + "MERITIUM", + "MERITIUM_ORE", + "HYDROCARBON", + "ANTIMATTER", + "FERTILIZERS", + "FABRICS", + "FOOD", + "JEWELRY", + "MACHINERY", + "FIREARMS", + "ASSAULT_RIFLES", + "MILITARY_EQUIPMENT", + "EXPLOSIVES", + "LAB_INSTRUMENTS", + "AMMUNITION", + "ELECTRONICS", + "SHIP_PLATING", + "EQUIPMENT", + "FUEL", + "MEDICINE", + "DRUGS", + "CLOTHING", + "MICROPROCESSORS", + "PLASTICS", + "POLYNUCLEOTIDES", + "BIOCOMPOSITES", + "NANOBOTS", + "AI_MAINFRAMES", + "QUANTUM_DRIVES", + "ROBOTIC_DRONES", + "CYBER_IMPLANTS", + "GENE_THERAPEUTICS", + "NEURAL_CHIPS", + "MOOD_REGULATORS", + "VIRAL_AGENTS", + "MICRO_FUSION_GENERATORS", + "SUPERGRAINS", + "LASER_RIFLES", + "HOLOGRAPHICS", + "SHIP_SALVAGE", + "RELIC_TECH", + "NOVEL_LIFEFORMS", + "BOTANICAL_SPECIMENS", + "CULTURAL_ARTIFACTS", + "REACTOR_SOLAR_I", + "REACTOR_FUSION_I", + "REACTOR_FISSION_I", + "REACTOR_CHEMICAL_I", + "REACTOR_ANTIMATTER_I", + "ENGINE_IMPULSE_DRIVE_I", + "ENGINE_ION_DRIVE_I", + "ENGINE_ION_DRIVE_II", + "ENGINE_HYPER_DRIVE_I", + "MODULE_MINERAL_PROCESSOR_I", + "MODULE_CARGO_HOLD_I", + "MODULE_CREW_QUARTERS_I", + "MODULE_ENVOY_QUARTERS_I", + "MODULE_PASSENGER_CABIN_I", + "MODULE_MICRO_REFINERY_I", + "MODULE_ORE_REFINERY_I", + "MODULE_FUEL_REFINERY_I", + "MODULE_SCIENCE_LAB_I", + "MODULE_JUMP_DRIVE_I", + "MODULE_JUMP_DRIVE_II", + "MODULE_JUMP_DRIVE_III", + "MODULE_SHIELD_GENERATOR_I", + "MODULE_SHIELD_GENERATOR_II", + "MOUNT_GAS_SIPHON_I", + "MOUNT_GAS_SIPHON_II", + "MOUNT_GAS_SIPHON_III", + "MOUNT_SENSOR_ARRAY_I", + "MOUNT_SENSOR_ARRAY_II", + "MOUNT_SENSOR_ARRAY_III", + "MOUNT_MINING_LASER_I", + "MOUNT_MINING_LASER_II", + "MOUNT_MINING_LASER_III", + "MOUNT_LASER_CANNON_I", + "MOUNT_MISSILE_LAUNCHER_I", + "MOUNT_TURRET_I" + ] +} \ No newline at end of file diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 493a185..0ffe130 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -745,7 +745,7 @@ "type": "string" }, "tradeSymbol": { - "type": "string" + "$ref": "../models/TradeSymbol.json" }, "units": { "type": "integer" @@ -864,62 +864,6 @@ ] } }, - "/my/ships/{shipSymbol}/orbit": { - "parameters": [ - { - "description": "The symbol of the ship", - "in": "path", - "name": "shipSymbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Attempt to move your ship into orbit at it's current location. The request will only succeed if your ship is capable of moving into orbit at the time of the request.\n\nThe endpoint is idempotent - successive calls will succeed even if the ship is already in orbit.", - "operationId": "orbit-ship", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "title": "Orbit Ship 200 Response", - "description": "", - "properties": { - "data": { - "properties": { - "nav": { - "$ref": "../models/ShipNav.json" - } - }, - "type": "object", - "required": [ - "nav" - ] - } - }, - "required": [ - "data" - ], - "type": "object" - } - } - }, - "description": "The ship has successfully moved into orbit at it's current location." - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Orbit Ship", - "tags": [ - "fleet" - ] - } - }, "/my/ships": { "get": { "description": "Retrieve all of your ships.", @@ -1077,6 +1021,176 @@ } ] }, + "/my/ships/{shipSymbol}/orbit": { + "parameters": [ + { + "description": "The symbol of the ship", + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Attempt to move your ship into orbit at it's current location. The request will only succeed if your ship is capable of moving into orbit at the time of the request.\n\nThe endpoint is idempotent - successive calls will succeed even if the ship is already in orbit.", + "operationId": "orbit-ship", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Orbit Ship 200 Response", + "description": "", + "properties": { + "data": { + "properties": { + "nav": { + "$ref": "../models/ShipNav.json" + } + }, + "type": "object", + "required": [ + "nav" + ] + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "The ship has successfully moved into orbit at it's current location." + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Orbit Ship", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}/refine": { + "parameters": [ + { + "description": "The symbol of the ship", + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Attempt to refine the raw materials on your ship. The request will only succeed if your ship is capable of refining at the time of the request.", + "operationId": "ship-refine", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "produce": { + "type": "string", + "enum": [ + "IRON", + "COPPER", + "SILVER", + "GOLD", + "ALUMINUM", + "PLATINUM", + "URANITE", + "MERITIUM", + "FUEL" + ] + } + }, + "required": [ + "produce" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Ship Refine 200 Response", + "description": "", + "properties": { + "data": { + "properties": { + "cargo": { + "$ref": "../models/ShipCargo.json" + }, + "produced": { + "type": "array", + "items": { + "type": "object", + "properties": { + "tradeSymbol": { + "$ref": "../models/TradeSymbol.json" + }, + "units": { + "type": "integer" + } + } + } + }, + "consumed": { + "type": "array", + "items": { + "type": "object", + "properties": { + "tradeSymbol": { + "$ref": "../models/TradeSymbol.json" + }, + "units": { + "type": "integer" + } + } + } + } + }, + "type": "object", + "required": [ + "cargo", + "produced", + "consumed" + ] + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "The ship has successfully started refining." + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Ship Refine", + "tags": [ + "fleet" + ] + } + }, "/my/ships/{shipSymbol}/chart": { "parameters": [ { @@ -1180,54 +1294,6 @@ } ] }, - "/my/ships/{shipSymbol}/deploy": { - "parameters": [ - { - "description": "The ship symbol", - "in": "path", - "name": "shipSymbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Use this endpoint to deploy a Communications Relay to a waypoint. A waypoint with a communications relay will allow agents to retrieve price information from the market. Without a relay, agents must send a ship to a market to retrieve price information.\n\nCommunication relays can be purchased from a market that exports `COMM_RELAY_I`.", - "operationId": "deploy-asset", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "symbol": { - "type": "string" - } - }, - "required": [ - "symbol" - ], - "type": "object" - } - } - } - }, - "responses": { - "204": { - "description": "OK" - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Deploy Asset", - "tags": [ - "fleet" - ] - } - }, "/my/ships/{shipSymbol}/dock": { "parameters": [ { @@ -1750,7 +1816,7 @@ "title": "SellCargoRequest", "properties": { "symbol": { - "type": "string" + "$ref": "../models/TradeSymbol.json" }, "units": { "type": "integer" @@ -2015,7 +2081,7 @@ "title": "Purchase Cargo Request", "properties": { "symbol": { - "type": "string" + "$ref": "../models/TradeSymbol.json" }, "units": { "type": "integer" @@ -2100,7 +2166,7 @@ "title": "Transfer Cargo Request", "properties": { "tradeSymbol": { - "type": "string" + "$ref": "../models/TradeSymbol.json" }, "units": { "type": "integer" From a1f95817b376c0459a36da4ef7c248a5862c9505 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Tue, 20 Dec 2022 21:44:49 -0800 Subject: [PATCH 31/48] revert TradeSymbol enforcement --- reference/SpaceTraders.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 0ffe130..2dbd541 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -745,7 +745,7 @@ "type": "string" }, "tradeSymbol": { - "$ref": "../models/TradeSymbol.json" + "type": "string" }, "units": { "type": "integer" @@ -1139,7 +1139,7 @@ "type": "object", "properties": { "tradeSymbol": { - "$ref": "../models/TradeSymbol.json" + "type": "string" }, "units": { "type": "integer" @@ -1153,7 +1153,7 @@ "type": "object", "properties": { "tradeSymbol": { - "$ref": "../models/TradeSymbol.json" + "type": "string" }, "units": { "type": "integer" @@ -1816,7 +1816,7 @@ "title": "SellCargoRequest", "properties": { "symbol": { - "$ref": "../models/TradeSymbol.json" + "type": "string" }, "units": { "type": "integer" @@ -2081,7 +2081,7 @@ "title": "Purchase Cargo Request", "properties": { "symbol": { - "$ref": "../models/TradeSymbol.json" + "type": "string" }, "units": { "type": "integer" @@ -2166,7 +2166,7 @@ "title": "Transfer Cargo Request", "properties": { "tradeSymbol": { - "$ref": "../models/TradeSymbol.json" + "type": "string" }, "units": { "type": "integer" From 7a5be6d3dfc7f4b91c77d9f3a78722cdd29d2c7b Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Tue, 20 Dec 2022 22:07:58 -0800 Subject: [PATCH 32/48] add cooldown to refinery --- reference/SpaceTraders.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 2dbd541..ad22593 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -1133,6 +1133,9 @@ "cargo": { "$ref": "../models/ShipCargo.json" }, + "cooldown": { + "$ref": "../models/Cooldown.json" + }, "produced": { "type": "array", "items": { @@ -1165,6 +1168,7 @@ "type": "object", "required": [ "cargo", + "cooldown", "produced", "consumed" ] From f9defdd086dd0949e339a6338c319b2339623585 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Fri, 23 Dec 2022 10:25:29 -0500 Subject: [PATCH 33/48] add surveyor mount --- models/ShipMount.json | 25 +++++++++++++++++++++++++ models/TradeSymbol.json | 3 +++ models/WaypointTrait.json | 3 ++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/models/ShipMount.json b/models/ShipMount.json index 48be0c5..218a482 100644 --- a/models/ShipMount.json +++ b/models/ShipMount.json @@ -8,6 +8,9 @@ "MOUNT_GAS_SIPHON_I", "MOUNT_GAS_SIPHON_II", "MOUNT_GAS_SIPHON_III", + "MOUNT_SURVEYOR_I", + "MOUNT_SURVEYOR_II", + "MOUNT_SURVEYOR_III", "MOUNT_SENSOR_ARRAY_I", "MOUNT_SENSOR_ARRAY_II", "MOUNT_SENSOR_ARRAY_III", @@ -29,6 +32,28 @@ "type": "integer", "minimum": 0 }, + "deposits": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "QUARTZ_SAND", + "SILICON_CRYSTALS", + "PRECIOUS_STONES", + "ICE_WATER", + "AMMONIA_ICE", + "IRON_ORE", + "COPPER_ORE", + "SILVER_ORE", + "ALUMINUM_ORE", + "GOLD_ORE", + "PLATINUM_ORE", + "DIAMONDS", + "URANITE_ORE", + "MERITIUM_ORE" + ] + } + }, "requirements": { "$ref": "./ShipRequirements.json" } diff --git a/models/TradeSymbol.json b/models/TradeSymbol.json index 2ef60ff..3a57047 100644 --- a/models/TradeSymbol.json +++ b/models/TradeSymbol.json @@ -96,6 +96,9 @@ "MOUNT_GAS_SIPHON_I", "MOUNT_GAS_SIPHON_II", "MOUNT_GAS_SIPHON_III", + "MOUNT_SURVEYOR_I", + "MOUNT_SURVEYOR_II", + "MOUNT_SURVEYOR_III", "MOUNT_SENSOR_ARRAY_I", "MOUNT_SENSOR_ARRAY_II", "MOUNT_SENSOR_ARRAY_III", diff --git a/models/WaypointTrait.json b/models/WaypointTrait.json index a4e4287..d7dc5ca 100644 --- a/models/WaypointTrait.json +++ b/models/WaypointTrait.json @@ -62,7 +62,8 @@ "BARREN", "TEMPERATE", "JUNGLE", - "OCEAN" + "OCEAN", + "STRIPPED" ] }, "name": { From 0e97d330af4894b31ff773c5574e81d794c04ec4 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Fri, 23 Dec 2022 10:25:46 -0500 Subject: [PATCH 34/48] add waypoint data to chart endpoint --- models/Chart.json | 3 +++ reference/SpaceTraders.json | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/models/Chart.json b/models/Chart.json index d2879d9..7e0da01 100644 --- a/models/Chart.json +++ b/models/Chart.json @@ -2,6 +2,9 @@ "type": "object", "description": "The chart of a system or waypoint, which makes the location visible to other agents.", "properties": { + "waypointSymbol": { + "type": "string" + }, "submittedBy": { "type": "string" }, diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index ad22593..7d3a42e 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -1220,10 +1220,14 @@ "properties": { "chart": { "$ref": "../models/Chart.json" + }, + "waypoint": { + "$ref": "../models/Waypoint.json" } }, "required": [ - "chart" + "chart", + "waypoint" ], "type": "object" } From 919a175551bdbeeb6724a31e804bdf79c1b5e081 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Fri, 23 Dec 2022 11:57:37 -0500 Subject: [PATCH 35/48] add jump gate endpoint --- models/ConnectedSystem.json | 38 +++++++++++++++++++++++++ models/JumpGate.json | 25 +++++++++++++++++ reference/SpaceTraders.json | 56 +++++++++++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+) create mode 100644 models/ConnectedSystem.json create mode 100644 models/JumpGate.json diff --git a/models/ConnectedSystem.json b/models/ConnectedSystem.json new file mode 100644 index 0000000..0d85a0c --- /dev/null +++ b/models/ConnectedSystem.json @@ -0,0 +1,38 @@ +{ + "description": "", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "minLength": 1 + }, + "sectorSymbol": { + "type": "string", + "minLength": 1 + }, + "type": { + "$ref": "./SystemType.json" + }, + "factionSymbol": { + "type": "string", + "description": "The symbol of the faction that owns the connected jump gate in the system." + }, + "x": { + "type": "integer" + }, + "y": { + "type": "integer" + }, + "distance": { + "type": "integer" + } + }, + "required": [ + "symbol", + "sectorSymbol", + "type", + "x", + "y", + "distance" + ] +} \ No newline at end of file diff --git a/models/JumpGate.json b/models/JumpGate.json new file mode 100644 index 0000000..69dad45 --- /dev/null +++ b/models/JumpGate.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "description": "", + "properties": { + "jumpRange": { + "type": "number", + "description": "The maximum jump range of the gate." + }, + "factionSymbol": { + "type": "string", + "description": "The symbol of the faction that owns the gate." + }, + "connectedSystems": { + "type": "array", + "description": "The systems within range of the gate that have a corresponding gate.", + "items": { + "$ref": "./ConnectedSystem.json" + } + } + }, + "required": [ + "jumpRange", + "connectedSystems" + ] +} \ No newline at end of file diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 7d3a42e..de6c34a 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -461,6 +461,62 @@ } ] }, + "/systems/{systemSymbol}/waypoints/{waypointSymbol}/jump-gate": { + "get": { + "description": "Get jump gate details for a waypoint.", + "operationId": "get-jump-gate", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "$ref": "../models/JumpGate.json" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "OK" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Get Jump Gate", + "tags": [ + "systems" + ] + }, + "parameters": [ + { + "description": "The system symbol", + "in": "path", + "name": "systemSymbol", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The waypoint symbol", + "in": "path", + "name": "waypointSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, "/factions": { "get": { "description": "List all discovered factions in the game.", From d6ebdd8c14afac42d42dd461c02860baf635f2a8 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Sat, 24 Dec 2022 14:29:51 -0500 Subject: [PATCH 36/48] add quickstart guide --- docs/quickstart.md | 1311 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 1224 insertions(+), 87 deletions(-) diff --git a/docs/quickstart.md b/docs/quickstart.md index 70feb11..46f1b40 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -1,109 +1,1246 @@ -# What you do +# Quickstart Guide -- you will register as a new agent and receive an API token -- you will gain a command ship and 100,000 credits in a starter system -- you will use the API to explore the universe and make money -- you will buy a mining ship, navigate to a neary asteroid field, and mine for resources -- you will find a nearby market to sell your resources -- you will explore new markets to find new goods to trade, better ships to buy, and upgrades for your ships -- you will scavenge derelict ships for parts and sell them for a profit -- you will send envoys to other factions to gain access to their markets -- you will send envoys to make trade deals not listed in the public markets -- you will search for lost artifacts and sell them for a profit or use them to upgrade your ships -- you will recruit crew members to help you run your ships -- you will chart new systems, discovering new factions and markets along the way +SpaceTraders is a fleet management game where all players operate in the same universe. You can use the API to explore star systems, manage your ships, make money, and grow your empire (or stop others from doing the same). -# Game Restrictions +Typical commands in the game include: purchasing ships, navigating to waypoints, mining asteroids, trading goods, taking on bounties, jumping to new systems, and more. -- the API has a limit of 60 requests per minute -- you can only have one active agent per account -- account email must be verified to purchase ships -- you can only have 10 ships in your fleet at a time (including your command ship) -- each ship is limited to a single action at a time (don't send two requests for the same ship concurrently) -- your fleet must stay in range of your command ship (about 100 lightyears) -- you must maintain the condition of your ships or they will slow down considerably -- you must maintain crew morale or your ship will suffer from reduced performance and your crew may abandon your ship -- crew wages are due hourly and paid whenever your ship docks at a civilized waypoint -- you must maintain your ship's fuel or it may end up stranded without an ability to navigate -- ships can take damage when docking planet-side, orbiting dangerous waypoints, or when extracting resources from asteroids -- several factors will determine your ship's travel time including ship condition, engine stats, speed setting, crew morale, etc. -- more fuel is expended when traveling at higher speeds or when trying to leave a planet with atmospheric drag or high gravity -- uncharted systems will not have all details available until it has been charted by an agent -- most market data will only be available if you have a ship present at the given waypoint -- jump gates are typically restricted to other jump gates within the same faction -- most actions will result in a reactor cooldown, which will prevent your ship from taking other actions until the cooldown has expired -- markets have a limit on how many units can be bought or sold at a given time, which is the same as the market's trade volume +You can use the API to automate your fleet or build a client for you and other players to play. -# Factions and Reputation + -- faction contracts often provide better prices than public markets but may be more difficult to fulfill -- contracts grant some amount of payment upon accepting a contract, and the rest upon completing it -- you can send an envoy to generate new contracts with a faction -- failing to accept a generated contract will result in a minor loss of faction reputation -- failing to complete an accepted contract will result in a loss of faction reputation -- fulfilling a contract will result in a gain of faction reputation -- trading with a faction will marginally increase your reputation with that faction -- some markets are restricted until you have reached a certain threshold of reputation with a faction +> #### Alpha 2.0 +> +> The game is a work in progress. We are currently in the alpha stage of development. We are actively working on the game and adding new features. If you have any questions or feedback, please join our [Discord](https://discord.gg/8YQZ3Z) and let us know. -# Markets +### Game Overview -- a market lists imports and exports, recent transactions, and the current price of goods -- exports are typically listed at a lower purchasing price and imports listed at a higher selling price -- all other goods are considered "exchange" and are mostly driven by agent activity -- prices are driven by supply and demand, and typically change over time -- the listed imports and exports of a market also evolve over time, and some goods may become unavailable -- shipyard listings are also dynamically priced based on player activity -- you can send envoys to attempt to purchase or sell goods not listed in the public market -- off-market goods are typically traded in very low volumes and prices are typically volatile +The following is a general overview of the game and what you can do as a player (some features are not yet implemented): -# Universe +- [x] you can register as a new agent which will grant you an API token, a command ship with 100,000 credits, and a faction contract in a starter system +- [x] you can use the API to explore the universe and make money by mining, trading, scavenging, and bounty hunting (scavenging and bounty hunting WIP) +- [x] you can purchase ships and upgrade them with new modules and mounts +- [x] you can chart new systems, discovering new factions and locations with valuable resources +- [x] you can grow systems by fulfilling faction contracts and supplying markets with necessary goods +- [x] you can connect trade routes between systems to automate the flow of goods +- [x] you can refine ores, minerals and other resources into valuable goods +- [ ] you can scavenge derelict ships for parts and sell them or use them to upgrade your ships +- [ ] you can take on bounties to earn credits or pirate other players trade routes +- [ ] you can send envoys to meet new factions and generate contracts or unique trade deals +- [ ] you can search for ancient artifacts on distant planets and sell them for a profit +- [ ] you can recruit crew members to help you run your ships -- the universe is procedurally generated with a few starter systems and factions -- the universe consists of systems, and systems are filled with waypoints, such as planets or asteroid fields -- each waypoint has an x, y coordinate, type and traits, and any orbitals that may be present -- a waypoint and it's orbitals share the same x, y coordinate +### Check Server Status -# Navigation - -- jump gates are a type of waypoint that connects systems together, allowing your ship to jump to a new system instantly -- navigating between waypoints involves choosing a destination and waiting for your ship to arrive -- ships are either docked or in-orbit at a waypoint, which may limit what actions you can take - -# Generate an SDK from the API definition - -You can generate an SDK from the API definition using [OpenAPI Generator](https://openapi-generator.tech/). - -```bash -openapi-generator generate \ - -i reference/SpaceTraders.json \ - -o spacetraders-sdk \ - -g typescript-axios \ - --skip-validate-spec \ - --additional-properties=supportsES6=true -``` - -# Install HTTpie - -You can install [HTTpie](https://httpie.io/) using [Homebrew](https://brew.sh/). +All of the steps in this guide are executed from the command line. You will want to install [HTTPie](http://httpie.io/docs#installation) to follow along. If you are on a Mac and you have homebrew installed, you can execute the following: ```bash brew install httpie ``` -# Register a temporary Account +You can then hit any API endpoint by simplying typing `https` along with the http method and the url. You can test this by hitting the game status endpoint which will tell us if the game is currently available to play: -You can register a temporary account using the [Register](https://api-server-2-0-0-rc-2-vxxwq5xqdq-uc.a.run.app/register) endpoint. +```bash +https GET api-server-2-0-0-rc-2-vxxwq5xqdq-uc.a.run.app +``` -```json http +```json { - "method": "POST", - "url": "https://api-server-2-0-0-rc-2-vxxwq5xqdq-uc.a.run.app/register", - "headers": { - "Content-Type": "application/json" + "status": "SpaceTraders is currently online and available to play", + "stats": { + "agents": 26, + "ships": 30, + "systems": 4, + "waypoints": 11 }, - "body": { - "symbol": "YOUR_AGENT_SYMBOL", - "faction": "ASA" + "leaderboards": { + "mostCredits": [], + "mostSubmittedCharts": [] + } +} +``` + + + +> #### After The Basics +> +> After you are comfortable with the basics, you may want to generate a client library for your favorite programming language. Our API documentation follows the OpenAPI specification, so you can use any tool that supports OpenAPI, such as [OpenAPI Generator](https://openapi-generator.tech/) to create a client library. + +### Generate An Access Token + +To access most API endpoints other than the game status, you will need to generate an API token by registering as an agent. + +Every agent is identified by a unique call sign (such as `ZER0` or `SP4CE_TR4DER`) and a starting faction. You can choose any symbol you want, but it must be unique. You can choose from one of the following starter factions: + +- [x] `COSMIC` - The Cosmic Engineers are a group of highly advanced scientists and engineers who seek to terraform and colonize new worlds, pushing the boundaries of technology and exploration. +- [x] `VOID` - The Voidfarers are a group of nomadic traders and adventurers who travel the galaxy in search of riches and adventure, willing to take risks and explore the unknown. +- [x] `GALLACTIC` - The Galactic Alliance is a coalition of planets and factions that have banded together for mutual protection and support, working together to defend against external threats and promote cooperation. +- [x] `QUANTUM` - The Quantum Federation is a group of planets and factions that have joined together to share knowledge and technology, using their collective expertise to advance the science and technology of the galaxy. +- [x] `DOMINION` - The Stellar Dominion is a powerful, expansionist faction that seeks to conquer and control as many systems as possible, using their advanced technology and military might to dominate their rivals. +- [x] `ASTRO` - The Astro-Salvage Alliance is a group of scavengers and salvagers who search the galaxy for ancient artifacts and valuable technology, often combing through old ship battlegrounds and derelict space stations. +- [x] `CORSAIRS` - The Seventh Space Corsairs are a feared group of pirates and raiders who operate throughout the galaxy, preying on merchant ships and plundering valuable cargo. + +```bash +https POST api-server-2-0-0-rc-2-vxxwq5xqdq-uc.a.run.app/register \ + symbol=ZER0 \ + faction=COSMIC +``` + +```json +{ + "data": { + "token": "eyJhbGciOiJSUzI1NiIsI...", + "agent": { + /* ... */ + }, + "contract": { + /* ... */ + }, + "faction": { + /* ... */ + }, + "ship": { + /* ... */ + } + } +} +``` + +You will see a JSON object with your token and agent details along with your starting contract, ship and faction. + +Copy your token somewhere safe and set it as a variable in your command prompt. You will need this token to access all of the other endpoints in this quickstart. You should also set a few more variables to make it easier to copy and paste the commands in this guide. The following is an example of how you might do this in a bash shell: + +```bash +apiToken= +shipSymbol= +contractId= +apiUrl=api-server-2-0-0-rc-2-vxxwq5xqdq-uc.a.run.app +``` + + + +> #### Keep Your Token Safe +> +> During the alpha phase, you will need to save your token and use it for all API requests. Keep in mind anyone with this token can access your agent and make changes to your fleet. We will be adding a token management portal in the future to make it easier to manage your tokens. + +### Contracts + +When registering as a new agent, you will be assigned your first faction contract. Your contract is a set of objectives that you must complete to earn credits and advance your reputation. You can view your current contract by calling the `/my/contracts` endpoint: + +```bash +https -A bearer -a $apiToken GET $apiUrl/my/contracts/$contractId +``` + +```json +{ + "data": [ + { + "id": "clc0u1d210005p4ys90philn5", + "factionSymbol": "COMMERCE_REPUBLIC", + "type": "PROCUREMENT", + "terms": { + "deadline": "2022-12-30T18:14:46.104Z", + "payment": { + "onAccepted": 58800, + "onFulfilled": 235200 + }, + "deliver": [ + { + "tradeSymbol": "QUARTZ_SAND", + "destinationSymbol": "X1-OE-PM", + "unitsRequired": 14000, + "unitsFulfilled": 0 + } + ] + }, + "accepted": false, + "fulfilled": false, + "expiration": "2022-12-26T18:14:46.103Z" + } + ], + "meta": { + "total": 1, + "page": 1, + "limit": 20 + } +} +``` + +#### Accept Contract + +Contracts will typically provide a small payment on acceptance and the final ammount on completion. Contracts also expire after a certain amount of time, so you will need to accept and complete them in time or take a reputation hit with the faction. Also note that contracts that are not accepted will also expire and result in a minor loss to reputation. + +You can accept a contract by calling the `/my/contracts/:contractId/accept` endpoint: + +```bash +https -A bearer -a $apiToken POST $apiUrl/my/contracts/$contractId/accept +``` + +```json +{ + "data": { + "contract": { + "id": "clc0u1d210005p4ys90philn5", + "factionSymbol": "COMMERCE_REPUBLIC", + "type": "PROCUREMENT", + "terms": { + "deadline": "2022-12-30T18:14:46.104Z", + "payment": { + "onAccepted": 58800, + "onFulfilled": 235200 + }, + "deliver": [ + { + "tradeSymbol": "QUARTZ_SAND", + "destinationSymbol": "X1-OE-PM", + "unitsRequired": 14000, + "unitsFulfilled": 0 + } + ] + }, + "accepted": true, + "fulfilled": false, + "expiration": "2022-12-26T18:14:46.103Z" + }, + "agent": { + "accountId": "clc0u1cvk0000p4ysdxjcuy2e", + "symbol": "595559", + "headquarters": "X1-OE-PM", + "credits": 125000 + } + } +} +``` + +Now that you have accepted the contract, let's look at how you can fulfill it by mining and delivering the required cargo. + +### Your Fleet + +Your fleet is a collection of ships that you own and control. You can purchase ships from shipyards and upgrade them with new modules and mounts. + +During the alpha release agents will start with a command ship. You can purchase additional ships from shipyards such as mining drones or freighters to help you transport cargo. + +#### View your ships + +You can view your ships by calling the `/my/ships` endpoint: + +```bash +https -A bearer -a $apiToken GET $apiUrl/my/ships +``` + +```json +{ + "data": [ + { + "symbol": "ELITE-1", + "nav": { + "systemSymbol": "X1-ST66", + "waypointSymbol": "X1-ST66-52115F", + "route": { + "departure": { + "symbol": "X1-ST66-22150C", + "type": "PLANET", + "systemSymbol": "X1-ST66", + "x": -6, + "y": -7 + }, + "destination": { + "symbol": "X1-ST66-52115F", + "type": "ASTEROID_FIELD", + "systemSymbol": "X1-ST66", + "x": 28, + "y": -12 + }, + "arrival": "2022-12-19T16:37:43.487Z" + }, + "status": "IN_ORBIT", + "flightMode": "CRUISE" + }, + "crew": { + "current": 62, + "capacity": 80, + "required": 62, + "rotation": "STRICT", + "morale": 100, + "wages": 0 + }, + "fuel": { + "current": 1166, + "capacity": 1200, + "consumed": { "amount": 34, "timestamp": "2022-12-19T16:36:20.487Z" } + }, + "frame": { + "symbol": "FRAME_FRIGATE", + "name": "Frame Frigate", + "description": "A medium-sized, multi-purpose spacecraft, often used for combat, transport, or support operations.", + "moduleSlots": 8, + "mountingPoints": 5, + "fuelCapacity": 1200, + "condition": 100, + "requirements": { "power": 8, "crew": 25 } + }, + "reactor": { + "symbol": "REACTOR_FISSION_I", + "name": "Fission Reactor I", + "description": "A basic fission power reactor, used to generate electricity from nuclear fission reactions.", + "condition": 100, + "powerOutput": 27, + "requirements": { "crew": 8 } + }, + "engine": { + "symbol": "ENGINE_ION_DRIVE_II", + "name": "Ion Drive II", + "description": "An advanced propulsion system that uses ionized particles to generate high-speed, low-thrust acceleration, with improved efficiency and performance.", + "condition": 100, + "speed": 30, + "requirements": { "power": 6, "crew": 8 } + }, + "modules": [ + { + "symbol": "MODULE_CARGO_HOLD_I", + "name": "Cargo Hold", + "description": "A module that increases a ship's cargo capacity.", + "capacity": 30, + "requirements": { "crew": 0, "power": 1, "slots": 1 } + }, + { + "symbol": "MODULE_CARGO_HOLD_I", + "name": "Cargo Hold", + "description": "A module that increases a ship's cargo capacity.", + "capacity": 30, + "requirements": { "crew": 0, "power": 1, "slots": 1 } + }, + { + "symbol": "MODULE_CREW_QUARTERS_I", + "name": "Crew Quarters", + "description": "A module that provides living space and amenities for the crew.", + "capacity": 40, + "requirements": { "crew": 2, "power": 1, "slots": 1 } + }, + { + "symbol": "MODULE_CREW_QUARTERS_I", + "name": "Crew Quarters", + "description": "A module that provides living space and amenities for the crew.", + "capacity": 40, + "requirements": { "crew": 2, "power": 1, "slots": 1 } + }, + { + "symbol": "MODULE_ENVOY_QUARTERS_I", + "name": "Envoy Quarters", + "description": "A module that provides living space and amenities for VIP passengers or diplomatic envoys.", + "capacity": 1, + "requirements": { "crew": 5, "power": 2, "slots": 2 } + }, + { + "symbol": "MODULE_JUMP_DRIVE_I", + "name": "Jump Drive I", + "description": "A basic antimatter jump drive that allows for instantaneous short-range interdimensional travel.", + "range": 500, + "requirements": { "crew": 10, "power": 4, "slots": 1 } + }, + { + "symbol": "MODULE_WARP_DRIVE_I", + "name": "Warp Drive I", + "description": "A basic warp drive that allows for short-range interstellar travel.", + "range": 2000, + "requirements": { "crew": 2, "power": 3, "slots": 1 } + } + ], + "mounts": [ + { + "symbol": "MOUNT_SENSOR_ARRAY_I", + "name": "Sensor Array I", + "description": "A basic sensor array that improves a ship's ability to detect and track other objects in space.", + "strength": 1, + "requirements": { "crew": 0, "power": 1 } + }, + { + "symbol": "MOUNT_MINING_LASER_I", + "name": "Mining Laser I", + "description": "A basic mining laser that can be used to extract valuable minerals from asteroids and other space objects.", + "strength": 10, + "requirements": { "crew": 0, "power": 1 } + }, + { + "symbol": "MOUNT_GAS_SIPHON_I", + "name": "Gas Siphon I", + "description": "A basic gas siphon that can extract gas from gas giants and other gas-rich bodies.", + "requirements": { "crew": 0, "power": 1 } + } + ], + "registration": { + "name": "ELITE-1", + "factionSymbol": "COSMIC", + "role": "COMMAND" + }, + "cargo": { + "capacity": 60, + "units": 15, + "inventory": [ + { + "symbol": "ANTIMATTER", + "name": "Antimatter", + "description": "A highly valuable and dangerous substance used for advanced propulsion and weapons systems.", + "units": 15 + } + ] + } + } + ], + "meta": { "total": 1, "page": 1, "limit": 20 } +} +``` + +This response contains a list of your ships, including nav details, cargo, and ship build. + +Your command ship comes equipped with a mining laser and survey mount, which you can use to extract minerals and ores from asteroids. Every ship has a symbol which is a unique identifier for that ship. You can use this symbol to refer to a specific ship in other API calls. + +To view a specific ship, use the following command: + +```bash +https -A bearer -a $apiToken GET $apiUrl/my/ships/$shipSymbol +``` + +### Scan nearby waypoints + +Your command ship is also equipped with a sensor array, which you can use to scan nearby waypoints. A waypoint is a location in space that you can travel to such as a planet or asteroid field. + +You can scan a waypoint to determine what type of location it is, any orbitals that are present, and any traits that it has including whether or not it has a shipyard or marketplace (to buy and sell goods). + +```bash +https -A bearer -a $apiToken POST $apiUrl/my/ships/$shipSymbol/scan/waypoints +``` + +```json +{ + "data": { + "cooldown": { + "shipSymbol": "DC4ECA-1", + "totalSeconds": 70, + "remainingSeconds": 69, + "expiration": "2022-12-23T22:17:09.284Z" + }, + "waypoints": [ + { + "systemSymbol": "X1-OE", + "symbol": "X1-OE-PM", + "type": "PLANET", + "x": -5, + "y": 9, + "orbitals": [ + { + "symbol": "X1-OE-PM01" + } + ], + "traits": [ + { + "symbol": "OVERCROWDED", + "name": "Overcrowded", + "description": "" + }, + { + "symbol": "HIGH_TECH", + "name": "High Tech", + "description": "" + }, + { + "symbol": "BUREAUCRATIC", + "name": "Bureaucratic", + "description": "" + }, + { + "symbol": "TEMPERATE", + "name": "Temperate", + "description": "" + }, + { + "symbol": "MARKETPLACE", + "name": "Marketplace", + "description": "" + }, + { + "symbol": "SHIPYARD", + "name": "Shipyard", + "description": "" + } + ], + "chart": { + "submittedBy": "COMMERCE_REPUBLIC", + "submittedOn": "2022-12-23T22:15:56.240Z" + }, + "faction": { + "symbol": "COMMERCE_REPUBLIC" + } + }, + { + "systemSymbol": "X1-OE", + "symbol": "X1-OE-PM01", + "type": "MOON", + "x": -5, + "y": 9, + "orbitals": [], + "traits": [ + { + "symbol": "WEAK_GRAVITY", + "name": "Weak Gravity", + "description": "" + }, + { + "symbol": "SCATTERED_SETTLEMENTS", + "name": "Scattered Settlements", + "description": "" + }, + { + "symbol": "MARKETPLACE", + "name": "Marketplace", + "description": "" + } + ], + "chart": { + "submittedBy": "COMMERCE_REPUBLIC", + "submittedOn": "2022-12-23T22:15:56.285Z" + }, + "faction": { + "symbol": "COMMERCE_REPUBLIC" + } + }, + { + "systemSymbol": "X1-OE", + "symbol": "X1-OE-A005", + "type": "ASTEROID_FIELD", + "x": 18, + "y": 25, + "orbitals": [], + "traits": [ + { + "symbol": "COMMON_METAL_DEPOSITS", + "name": "Common Metal Deposits", + "description": "" + } + ], + "chart": { + "submittedBy": "MINERS_COLLECTIVE", + "submittedOn": "2022-12-23T22:15:56.301Z" + }, + "faction": { + "symbol": "MINERS_COLLECTIVE" + } + }, + { + "systemSymbol": "X1-OE", + "symbol": "X1-OE-EL70", + "type": "ORBITAL_STATION", + "x": 42, + "y": 28, + "orbitals": [], + "traits": [ + { + "symbol": "TRADING_HUB", + "name": "Trading Hub", + "description": "" + }, + { + "symbol": "MARKETPLACE", + "name": "Marketplace", + "description": "" + } + ], + "chart": { + "submittedBy": "COMMERCE_REPUBLIC", + "submittedOn": "2022-12-23T22:15:56.308Z" + }, + "faction": { + "symbol": "COMMERCE_REPUBLIC" + } + }, + { + "systemSymbol": "X1-OE", + "symbol": "X1-OE-25X", + "type": "JUMP_GATE", + "x": 50, + "y": -34, + "orbitals": [], + "traits": [], + "chart": { + "submittedBy": "SPACERS_GUILD", + "submittedOn": "2022-12-23T22:15:56.321Z" + }, + "faction": { + "symbol": "SPACERS_GUILD" + } + } + ] + } +} +``` + +You will notice in the response that your ship has a cooldown after executing a scan. Most ship actions such as scanning, mining, or surveying will trigger a ship cooldown, preventing you from performing another action until the cooldown has expired. + +#### Viewing Systems and Waypoints + +You can also view system and waypoint details using the following endpoints. Note some details are unavailable unless you have a ship present in the system or at the waypoint, such as the exact pricing details of a market or shipyard. + +```bash +https -A bearer -a $apiToken GET $apiUrl/systems +https -A bearer -a $apiToken GET $apiUrl/systems/$systemSymbol +https -A bearer -a $apiToken GET $apiUrl/systems/$systemSymbol/waypoints +https -A bearer -a $apiToken GET $apiUrl/systems/$systemSymbol/waypoints/$waypointSymbol +https -A bearer -a $apiToken GET $apiUrl/systems/$systemSymbol/waypoints/$waypointSymbol/market +https -A bearer -a $apiToken GET $apiUrl/systems/$systemSymbol/waypoints/$waypointSymbol/shipyard +https -A bearer -a $apiToken GET $apiUrl/systems/$systemSymbol/waypoints/$waypointSymbol/jump-gate +``` + +#### Navigate to an asteroid field + +Find a waypoint with a type of ASTEROID_FIELD and navigate your command ship to it. Once your ship has arrived, we will be able to survey and mine the asteroid field for valuable minerals and ores. + +```bash +https -A bearer -a $apiToken POST $apiUrl/my/ships/$shipSymbol/navigate \ + waypointSymbol==$waypointSymbol +``` + +```json +{ + "data": { + "nav": { + "systemSymbol": "X1-OE", + "waypointSymbol": "X1-OE-A005", + "route": { + "departure": { + "symbol": "X1-OE-PM", + "type": "PLANET", + "systemSymbol": "X1-OE", + "x": -6, + "y": -7 + }, + "destination": { + "symbol": "X1-OE-A005", + "type": "ASTEROID_FIELD", + "systemSymbol": "X1-OE", + "x": -29, + "y": 1 + }, + "arrival": "2022-12-23T18:27:01.514Z" + }, + "status": "IN_TRANSIT", + "flightMode": "CRUISE" + }, + "fuel": { + "current": 176, + "capacity": 100, + "consumed": { + "amount": 24, + "timestamp": "2022-12-23T18:14:46.515Z" + } + } + } +} +``` + +Note the route departure and destination details. The departure is the waypoint your ship is currently at, and the destination is the waypoint you are navigating to. The arrival timestamp is the time when your ship will arrive at the destination. While your ship is in-transit, you will not be able to take any other actions. + +#### Refuel your ship + +You will also notice that your ship has consumed fuel upon navigation. You will want to refuel your ship whenever possible or risk getting stranded in space. Once your ship arrives at it's destination, you can refuel it using the following endpoint. + +```bash +https POST api.spacetraders.io/my/ships/$shipSymbol/refuel +``` + +```json +{ + "data": { + "agent": { + "accountId": "clc0u1cxh0000p4z0l6k6vuol", + "symbol": "860A44", + "headquarters": "X1-OE-PM", + "credits": 999912799 + }, + "fuel": { + "current": 900, + "capacity": 900, + "consumed": { + "amount": 100, + "timestamp": "2022-12-23T18:14:46.032Z" + } + } + } +} +``` + +### Asteroid Mining + +Asteroids contain valuable minerals and ores that can be extracted and sold for profit. You can mine asteroids using the following endpoint. + +```bash +https -A bearer -a $apiToken POST $apiUrl/my/ships/$shipSymbol/extract +``` + +```json +{ + "data": { + "extraction": { + "shipSymbol": "0B03EA-1", + "yield": { + "symbol": "ALUMINUM_ORE", + "units": 1 + } + }, + "cooldown": { + "shipSymbol": "0B03EA-1", + "totalSeconds": 70, + "remainingSeconds": 69, + "expiration": "2022-12-23T18:15:59.212Z" + }, + "cargo": { + "capacity": 30, + "units": 30, + "inventory": [ + { + "symbol": "ALUMINUM_ORE", + "name": "Aluminum Ore", + "description": "A valuable ore used in the production of aluminum and other alloys. Aluminum ore is an essential component in the construction of ship hulls and other structural components.", + "units": 30 + } + ] + } + } +} +``` + +If you are targeting specific minerals or ores, you will want to survey the asteroid field for targeted mining locations. + +#### Surveying + +Surveying an asteroid field will reveal the locations of specific mineral and ore deposits. You can survey an asteroid field using the following endpoint. + +```bash +https -A bearer -a $apiToken POST $apiUrl/my/ships/$shipSymbol/survey +``` + +```json +{ + "data": { + "cooldown": { + "shipSymbol": "7C8E51-1", + "totalSeconds": 69, + "remainingSeconds": 69, + "expiration": "2022-12-23T18:15:59.073Z" + }, + "surveys": [ + { + "signature": "X1-OE-A005-99501F", + "symbol": "X1-OE-A005", + "deposits": [ + { + "symbol": "ALUMINUM_ORE" + }, + { + "symbol": "ICE_WATER" + }, + { + "symbol": "SILICON_CRYSTALS" + } + ], + "expiration": "2022-12-23T19:04:01.088Z", + "size": "SMALL" + } + ] + } +} +``` + +Copy the entire object of the survey you want to target. You will need this information to extract those deposits from the asteroid field. + +#### Extracting from surveys + +Once you have surveyed an asteroid field, you can extract specific minerals and ores from the field using the following endpoint. + +Note you will need to paste the entire survey object as a JSON string in the body of the request. + +```bash +https -A bearer -a $apiToken POST $apiUrl/my/ships/$shipSymbol/extract \ + survey="{\"signature\":\"X1-OE-A005-99501F\",\"symbol\":\"X1-OE-A005\",\"deposits\":[{\"symbol\":\"ALUMINUM_ORE\"},{\"symbol\":\"ICE_WATER\"},{\"symbol\":\"SILICON_CRYSTALS\"}],\"expiration\":\"2022-12-23T19:04:01.088Z\",\"size\":\"SMALL\"}" +``` + +The ship will have a much higher chance of extracting ores and minerals from the list of deposits in the survey. + +### Contract Delivery + +Once your cargo hold is full and you have some of the desired minerals and ores for your contract, you should navigate to the destination waypoint of your contract. + +Upon arrival, you can deliver the goods using the following endpoint. + +```bash +https -A bearer -a $apiToken POST $apiUrl/my/contracts/$contractId/deliver \ + shipSymbol=$shipSymbol \ + tradeSymbol=$tradeSymbol \ + units=999 +``` + +```json +{ + "data": { + "contract": { + "id": "clc0u1d210005p4ys90philn5", + "factionSymbol": "COMMERCE_REPUBLIC", + "type": "PROCUREMENT", + "terms": { + "deadline": "2022-12-23T18:15:46.639Z", + "payment": { + "onAccepted": 58800, + "onFulfilled": 235200 + }, + "deliver": [ + { + "tradeSymbol": "QUARTZ_SAND", + "destinationSymbol": "X1-OE-PM", + "unitsRequired": 14000, + "unitsFulfilled": 1 + } + ] + }, + "accepted": true, + "fulfilled": false, + "expiration": "2022-12-26T18:14:46.103Z" + }, + "cargo": { + "capacity": 30, + "units": 999, + "inventory": [ + { + "symbol": "QUARTZ_SAND", + "name": "Quartz Sand", + "description": "High-purity quartz sand used in the production of glass and ceramics.", + "units": 499 + } + ] + } + } +} +``` + +Once the terms of the contract have been met, you can fulfill the contract and receive the final payment using the following endpoint. + +```bash +https -A bearer -a $apiToken POST $apiUrl/my/contracts/$contractId/fulfill +``` + +```json +{ + "data": { + "contract": { + "id": "clc0u1d210005p4ys90philn5", + "factionSymbol": "COMMERCE_REPUBLIC", + "type": "PROCUREMENT", + "terms": { + "deadline": "2022-12-23T18:15:46.639Z", + "payment": { + "onAccepted": 58800, + "onFulfilled": 235200 + }, + "deliver": [ + { + "tradeSymbol": "QUARTZ_SAND", + "destinationSymbol": "X1-OE-PM", + "unitsRequired": 14000, + "unitsFulfilled": 999999 + } + ] + }, + "accepted": true, + "fulfilled": true, + "expiration": "2022-12-26T18:14:46.103Z" + }, + "agent": { + "accountId": "clc0u1cvk0000p4ysdxjcuy2e", + "symbol": "595559", + "headquarters": "X1-OE-PM", + "credits": 1000208559 + } + } +} +``` + +### Markets + +You will likely extract some minerals and ores that you don't need for your current contract. You can sell these minerals and ores at the market. + +Find a waypoint with a market and check if it has the minerals and ores you want to sell listed as imports. Imports typically have a higher price than exports or goods generally available at the market. + +```bash +https -A bearer -a $apiToken GET $apiUrl/systems/$systemSymbol/waypoints/$waypointSymbol/market +``` + +```json +{ + "data": { + "symbol": "X1-ZZ-7-EE", + "imports": [ + { + "symbol": "HYDROCARBON" + }, + { + "symbol": "AMMONIA_ICE" + }, + { + "symbol": "LIQUID_NITROGEN" + } + ], + "exports": [ + { + "symbol": "POLYNUCLEOTIDES" + } + ], + "transactions": [] + } +} +``` + +#### Sell and Purchase + +When your ship is at a designated market waypoint, you can sell goods using the following endpoint. + +```bash +https -A bearer -a $apiToken POST $apiUrl/my/ships/$shipSymbol/sell \ + symbol=$tradeSymbol \ + units=999 +``` + +```json +{ + "data": { + "agent": { + "accountId": "clc0u1cvr0000p4yvjcbbdtkr", + "symbol": "ED3EFE", + "headquarters": "X1-OE-PM", + "credits": 999914595 + }, + "cargo": { + "capacity": 30, + "units": 30, + "inventory": [ + { + "symbol": "SILICON_CRYSTALS", + "name": "Silicon Crystals", + "description": "High-quality silicon crystals used in the production of advanced electronic components and solar panels.", + "units": 9 + } + ] + }, + "transaction": { + "shipSymbol": "ED3EFE-1", + "tradeSymbol": "SILICON_CRYSTALS", + "type": "SELL", + "units": 1, + "pricePerUnit": 36, + "totalPrice": 36, + "timestamp": "2022-12-23T18:14:46.413Z" + } + } +} +``` + +If you want to purchase any goods from the market, you can use the following endpoint. + +````bash + +```bash +https -A bearer -a $apiToken POST $apiUrl/my/ships/$shipSymbol/purchase \ + symbol=$tradeSymbol \ + units=10 +```` + +### Purchase Ships + +You can expedite your mining exports by purchasing a new ship. Find a waypoint with a shipyard and view available ships with the following endpoint. + +```bash +https -A bearer -a $apiToken $apiUrl/systems/$systemSymbol/waypoints/$waypointSymbol/shipyard +``` + +```json +{ + "data": { + "symbol": "X1-OE-PM", + "shipTypes": [ + { + "type": "SHIP_MINING_DRONE" + } + ] + } +} +``` + +Find a shipyard with a `SHIP_MINING_DRONE` available and purchase it with the following endpoint. + +```bash +https -A bearer -a $apiToken POST $apiUrl/my/ships \ + shipType=SHIP_MINING_DRONE \ + waypointSymbol=$waypointSymbol +``` + +```json +{ + "data": { + "agent": { + "accountId": "clc0u1cok0000p4ytz33fltey", + "symbol": "8C7441", + "headquarters": "X1-OE-PM", + "credits": 999401919 + }, + "ship": { + "symbol": "8C7441-7", + "nav": { + "systemSymbol": "X1-OE", + "waypointSymbol": "X1-OE-PM", + "route": { + "departure": { + "symbol": "X1-OE-PM", + "type": "PLANET", + "systemSymbol": "X1-OE", + "x": -6, + "y": -7 + }, + "destination": { + "symbol": "X1-OE-PM", + "type": "PLANET", + "systemSymbol": "X1-OE", + "x": -6, + "y": -7 + }, + "arrival": "2022-12-23T18:14:46.289Z" + }, + "status": "DOCKED", + "flightMode": "CRUISE" + }, + "crew": { + "current": 0, + "capacity": 0, + "required": 0, + "rotation": "STRICT", + "morale": 100, + "wages": 0 + }, + "fuel": { + "current": 100, + "capacity": 100, + "consumed": { + "amount": 0, + "timestamp": "2022-12-23T18:14:46.289Z" + } + }, + "frame": { + "symbol": "FRAME_DRONE", + "name": "Frame Drone", + "description": "A small, unmanned spacecraft used for various tasks, such as surveillance, transportation, or combat.", + "moduleSlots": 3, + "mountingPoints": 2, + "fuelCapacity": 100, + "condition": 100, + "requirements": { + "power": 1, + "crew": -3 + } + }, + "reactor": { + "symbol": "REACTOR_CHEMICAL_I", + "name": "Chemical Reactor I", + "description": "A basic chemical power reactor, used to generate electricity from chemical reactions.", + "condition": 100, + "powerOutput": 14, + "requirements": { + "crew": 3 + } + }, + "engine": { + "symbol": "ENGINE_IMPULSE_DRIVE_I", + "name": "Impulse Drive I", + "description": "A basic low-energy propulsion system that generates thrust for interplanetary travel.", + "condition": 100, + "speed": 2, + "requirements": { + "power": 1, + "crew": 0 + } + }, + "modules": [ + { + "symbol": "MODULE_CARGO_HOLD_I", + "name": "Cargo Hold", + "description": "A module that increases a ship's cargo capacity.", + "capacity": 30, + "requirements": { + "crew": 0, + "power": 1, + "slots": 1 + } + }, + { + "symbol": "MODULE_MINERAL_PROCESSOR_I", + "name": "Mineral Processor", + "description": "A module that processes raw ore and minerals into refined materials.", + "requirements": { + "crew": 0, + "power": 1, + "slots": 2 + } + } + ], + "mounts": [ + { + "symbol": "MOUNT_MINING_LASER_I", + "name": "Mining Laser I", + "description": "A basic mining laser that can be used to extract valuable minerals from asteroids and other space objects.", + "strength": 10, + "requirements": { + "crew": 0, + "power": 1 + } + } + ], + "registration": { + "name": "8C7441-7", + "factionSymbol": "COMMERCE_REPUBLIC", + "role": "EXCAVATOR" + }, + "cargo": { + "capacity": 30, + "units": 0, + "inventory": [] + } + } + } +} +``` + +Drones are quite a bit slower than other ships, but they require zero crew to operate which means they are easier to automate and maintain. + +### Exploration + +If you want to continue to explore the universe, you can use the warp and jump drives on your command ship to travel to new systems. Warp drives are slower and consume regular fuel, where as jump drives will instantly transport you to a new system but require a unit of antimatter to operate. + +#### Scan nearby systems + +If you want to explore nearby systems, you can use your sensor array to scan for new systems. You can see how far away the system is from your current location by looking at the `distance` property. The `type` property will tell you what type of star the system has. + +```bash +https -A bearer -a $apiToken POST $apiUrl/my/ships/$shipSymbol/scan/systems +``` + +```json +{ + "data": { + "cooldown": { + "shipSymbol": "DC4ECA-1", + "totalSeconds": 69, + "remainingSeconds": 69, + "expiration": "2022-12-23T22:17:09.240Z" + }, + "systems": [ + { + "symbol": "X1-EV", + "sectorSymbol": "X1", + "type": "ORANGE_STAR", + "x": 1, + "y": 1, + "distance": 1 + }, + { + "symbol": "X1-ZZ", + "sectorSymbol": "X1", + "type": "BLUE_STAR", + "x": 2, + "y": 2, + "distance": 3 + } + ] + } +} +``` + +#### Jump to a new system + +Choose a system to jump to and use the `jump` command to jump to that system. You will need to have a jump drive installed on your ship and you will need to have a unit of antimatter in your cargo hold. + +```bash +https -A bearer -a $apiToken POST $apiUrl/my/ships/$shipSymbol/jump systemSymbol=$systemSymbol +``` + +```json +{ + "data": { + "nav": { + "systemSymbol": "X1-EV", + "waypointSymbol": "X1-EV-A004", + "route": { + "departure": { + "symbol": "X1-OE-PM", + "type": "PLANET", + "systemSymbol": "X1-OE", + "x": -6, + "y": -7 + }, + "destination": { + "symbol": "X1-EV-A004", + "type": "PLANET", + "systemSymbol": "X1-EV", + "x": 3, + "y": 10 + }, + "arrival": "2022-12-23T18:14:49.168Z" + }, + "status": "IN_ORBIT", + "flightMode": "CRUISE" + }, + "cooldown": { + "shipSymbol": "04A691-1", + "totalSeconds": 99, + "remainingSeconds": 99, + "expiration": "2022-12-23T18:16:29.164Z" + } + } +} +``` + +If you don't have antimatter but you have a warp drive installed, you can also use the `warp` command to travel to a new system. This will take longer and consume fuel, but you won't need to have antimatter in your cargo hold. + +```bash +https -A bearer -a $apiToken POST $apiUrl/my/ships/$shipSymbol/warp waypointSymbol=$waypointSymbol +``` + +#### Chart a waypoint + +If you discover an uncharted waypoint, you can use the `chart` command to chart it. This will allow other agents to view more details about the waypoint. + +```bash +https -A bearer -a $apiToken POST $apiUrl/my/ships/$shipSymbol/chart +``` + +```json +{ + "data": { + "chart": { + "waypointSymbol": "X1-ZZ-Z9185A", + "submittedBy": "E0783A-1", + "submittedOn": "2022-12-23T18:14:46.699Z" + }, + "waypoint": { + "systemSymbol": "X1-ZZ", + "symbol": "X1-ZZ-Z9185A", + "type": "GAS_GIANT", + "x": 1005, + "y": 2569, + "orbitals": [], + "traits": [], + "chart": { + "waypointSymbol": "X1-ZZ-Z9185A", + "submittedBy": "E0783A-1", + "submittedOn": "2022-12-23T18:14:46.699Z" + }, + "faction": { + "symbol": "ZANZIBAR_TRIKES" + } + } } } ``` From be7f82878e5501c890811b4be660c8805cf11836 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Sat, 24 Dec 2022 14:30:13 -0500 Subject: [PATCH 37/48] add exchange property to market --- models/Market.json | 26 +++++++++++--------------- models/TradeGood.json | 16 ++++++++-------- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/models/Market.json b/models/Market.json index dca15cf..e1a97e8 100644 --- a/models/Market.json +++ b/models/Market.json @@ -10,26 +10,21 @@ "type": "array", "description": "The list of goods that are exported from this market.", "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "The symbol of the good." - } - } + "$ref": "./TradeGood.json" } }, "imports": { "type": "array", "description": "The list of goods that are sought as imports in this market.", "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "The symbol of the good." - } - } + "$ref": "./TradeGood.json" + } + }, + "exchange": { + "type": "array", + "description": "The list of goods that are bought and sold between agents at this market.", + "items": { + "$ref": "./TradeGood.json" } }, "transactions": { @@ -50,6 +45,7 @@ "required": [ "symbol", "exports", - "imports" + "imports", + "exchange" ] } \ No newline at end of file diff --git a/models/TradeGood.json b/models/TradeGood.json index e1af4ee..f5bb7ec 100644 --- a/models/TradeGood.json +++ b/models/TradeGood.json @@ -1,6 +1,6 @@ { "type": "object", - "attributes": { + "properties": { "symbol": { "$ref": "./TradeSymbol.json" }, @@ -9,11 +9,11 @@ }, "description": { "type": "string" - }, - "required": [ - "symbol", - "name", - "description" - ] - } + } + }, + "required": [ + "symbol", + "name", + "description" + ] } \ No newline at end of file From f28c02385e4670d6007d9fc1d196b7843ec00ac7 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Sat, 24 Dec 2022 16:12:13 -0500 Subject: [PATCH 38/48] updates to quickstart; scanned ship shows less detail --- docs/quickstart.md | 10 +++---- models/ScannedShip.json | 52 ++++++++++++++++++++++++++++++------- reference/SpaceTraders.json | 2 +- 3 files changed, 47 insertions(+), 17 deletions(-) diff --git a/docs/quickstart.md b/docs/quickstart.md index 46f1b40..ee5ebdf 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -10,7 +10,7 @@ You can use the API to automate your fleet or build a client for you and other p > #### Alpha 2.0 > -> The game is a work in progress. We are currently in the alpha stage of development. We are actively working on the game and adding new features. If you have any questions or feedback, please join our [Discord](https://discord.gg/8YQZ3Z) and let us know. +> The game is a work in progress. We are currently in the alpha stage of development. We are actively working on the game and adding new features. If you have any questions or feedback, please join our [Discord](https://discord.gg/QB8zyNW7RH) and let us know. ### Game Overview @@ -595,7 +595,7 @@ Find a waypoint with a type of ASTEROID_FIELD and navigate your command ship to ```bash https -A bearer -a $apiToken POST $apiUrl/my/ships/$shipSymbol/navigate \ - waypointSymbol==$waypointSymbol + waypointSymbol=$waypointSymbol ``` ```json @@ -643,7 +643,7 @@ Note the route departure and destination details. The departure is the waypoint You will also notice that your ship has consumed fuel upon navigation. You will want to refuel your ship whenever possible or risk getting stranded in space. Once your ship arrives at it's destination, you can refuel it using the following endpoint. ```bash -https POST api.spacetraders.io/my/ships/$shipSymbol/refuel +https -A bearer -a $apiToken POST api.spacetraders.io/my/ships/$shipSymbol/refuel ``` ```json @@ -942,13 +942,11 @@ https -A bearer -a $apiToken POST $apiUrl/my/ships/$shipSymbol/sell \ If you want to purchase any goods from the market, you can use the following endpoint. -````bash - ```bash https -A bearer -a $apiToken POST $apiUrl/my/ships/$shipSymbol/purchase \ symbol=$tradeSymbol \ units=10 -```` +``` ### Purchase Ships diff --git a/models/ScannedShip.json b/models/ScannedShip.json index d785295..7588a89 100644 --- a/models/ScannedShip.json +++ b/models/ScannedShip.json @@ -4,8 +4,7 @@ "properties": { "symbol": { "type": "string", - "description": "The globally unique identifier of the ship in the following format: `[AGENT_SYMBOL]_[HEX_ID]`", - "minLength": 8 + "description": "The globally unique identifier of the ship." }, "registration": { "$ref": "./ShipRegistration.json" @@ -14,18 +13,54 @@ "$ref": "./ShipNav.json" }, "frame": { - "$ref": "./ShipFrame.json" + "type": "object", + "description": "The frame of the ship.", + "properties": { + "symbol": { + "type": "string" + } + }, + "required": [ + "symbol" + ] }, "reactor": { - "$ref": "./ShipReactor.json" + "type": "object", + "description": "The reactor of the ship.", + "properties": { + "symbol": { + "type": "string" + } + }, + "required": [ + "symbol" + ] }, "engine": { - "$ref": "./ShipEngine.json" + "type": "object", + "description": "The engine of the ship.", + "properties": { + "symbol": { + "type": "string" + } + }, + "required": [ + "symbol" + ] }, "mounts": { "type": "array", "items": { - "$ref": "./ShipMount.json" + "type": "object", + "description": "A mount on the ship.", + "properties": { + "symbol": { + "type": "string" + } + }, + "required": [ + "symbol" + ] } } }, @@ -33,9 +68,6 @@ "symbol", "registration", "nav", - "frame", - "reactor", - "engine", - "mounts" + "engine" ] } \ No newline at end of file diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index de6c34a..7170af5 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -352,7 +352,7 @@ }, "/systems/{systemSymbol}/waypoints/{waypointSymbol}/market": { "get": { - "description": "Retrieve imports, exports and exchange data from a marketplace. Imports can be sold, exports can be purchased, and exchange trades can be purchased or sold.\n\nMarket data is only available if you have a ship at the location, or the location is charted and has a communications relay deployed.\n\nSee `/my/ships/{shipSymbol}/deploy` for deploying relays at a location.", + "description": "Retrieve imports, exports and exchange data from a marketplace. Imports can be sold, exports can be purchased, and exchange goods can be purchased or sold. Send a ship to the waypoint to access trade good prices and recent transactions.", "operationId": "get-market", "responses": { "200": { From df6821719d77562612a93b6f06a948af5aebcfe9 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Mon, 26 Dec 2022 12:50:36 -0500 Subject: [PATCH 39/48] fix min value on market trade volume --- models/MarketTradeGood.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/MarketTradeGood.json b/models/MarketTradeGood.json index bfc3bba..7319318 100644 --- a/models/MarketTradeGood.json +++ b/models/MarketTradeGood.json @@ -8,7 +8,7 @@ "tradeVolume": { "type": "integer", "description": "The typical volume flowing through the market for this type of good. The larger the trade volume, the more stable prices will be.", - "minimum": 10 + "minimum": 1 }, "supply": { "type": "string", From 489675716a4a77ec0962e89f046cd3a01106dbe1 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Mon, 26 Dec 2022 12:50:48 -0500 Subject: [PATCH 40/48] add ship frame miner to enum --- models/ShipFrame.json | 1 + 1 file changed, 1 insertion(+) diff --git a/models/ShipFrame.json b/models/ShipFrame.json index e171deb..de9b9d4 100644 --- a/models/ShipFrame.json +++ b/models/ShipFrame.json @@ -13,6 +13,7 @@ "FRAME_FRIGATE", "FRAME_SHUTTLE", "FRAME_EXPLORER", + "FRAME_MINER", "FRAME_LIGHT_FREIGHTER", "FRAME_HEAVY_FREIGHTER", "FRAME_TRANSPORT", From 16c7ff4988d9d1cb1a603cecad2aceb92479abff Mon Sep 17 00:00:00 2001 From: James Clague Date: Fri, 30 Dec 2022 16:16:28 -0700 Subject: [PATCH 41/48] Create .spectral.mjs --- .spectral.mjs | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .spectral.mjs diff --git a/.spectral.mjs b/.spectral.mjs new file mode 100644 index 0000000..cca9041 --- /dev/null +++ b/.spectral.mjs @@ -0,0 +1,2 @@ +import ruleset from "https://stoplight.io/api/v1/projects/cHJqOjE3NTU4OQ/spectral.js?branch=main&token=e4f4ffbe-f8ad-4829-b09f-cf2703afac49"; +export default { extends: ruleset }; From 27f63adf4a0338c0a8b0cb244c9fa848f783bad5 Mon Sep 17 00:00:00 2001 From: "james.clague@brct.io" Date: Fri, 30 Dec 2022 16:25:28 -0700 Subject: [PATCH 42/48] Add pagination params to GET:systems --- reference/SpaceTraders.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 7170af5..1a1e0da 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -189,6 +189,24 @@ "summary": "List Systems", "tags": [ "systems" + ], + "parameters": [ + { + "schema": { + "type": "number" + }, + "in": "query", + "name": "page", + "description": "What page to request" + }, + { + "schema": { + "type": "number" + }, + "in": "query", + "name": "limit", + "description": "How many entries to return per page" + } ] } }, From 6dc72cc7e5921512a1fa73529d0e4dc765f3987e Mon Sep 17 00:00:00 2001 From: "james.clague@brct.io" Date: Mon, 2 Jan 2023 09:41:04 -0700 Subject: [PATCH 43/48] Add meta query params to list factions, ships, contracts, systems, waypoints. Fix typo for Galactic faction /register enum. --- reference/SpaceTraders.json | 80 +++++++++++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 4 deletions(-) diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 1a1e0da..6443f28 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -72,7 +72,7 @@ "enum": [ "COSMIC", "VOID", - "GALLACTIC", + "GALACTIC", "QUANTUM", "DOMINION", "ASTRO", @@ -193,15 +193,15 @@ "parameters": [ { "schema": { - "type": "number" + "type": "integer" }, "in": "query", "name": "page", - "description": "What page to request" + "description": "What entry offset to request" }, { "schema": { - "type": "number" + "type": "integer" }, "in": "query", "name": "limit", @@ -298,6 +298,24 @@ "summary": "List Waypoints", "tags": [ "systems" + ], + "parameters": [ + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "page", + "description": "What entry offset to request" + }, + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "limit", + "description": "How many entries to return per page" + } ] }, "parameters": [ @@ -569,6 +587,24 @@ "summary": "List Factions", "tags": [ "factions" + ], + "parameters": [ + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "page", + "description": "What entry offset to request" + }, + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "limit", + "description": "How many entries to return per page" + } ] } }, @@ -689,6 +725,24 @@ "summary": "List Contracts", "tags": [ "contracts" + ], + "parameters": [ + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "page", + "description": "What entry offset to request" + }, + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "limit", + "description": "How many entries to return per page" + } ] } }, @@ -978,6 +1032,24 @@ "summary": "List Ships", "tags": [ "fleet" + ], + "parameters": [ + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "page", + "description": "What entry offset to request" + }, + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "limit", + "description": "How many entries to return per page" + } ] }, "post": { From 816a172288fb428ff15cfb244612518c9a46cdbc Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Mon, 2 Jan 2023 10:05:37 -0800 Subject: [PATCH 44/48] fix typo in quickstart --- docs/quickstart.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quickstart.md b/docs/quickstart.md index ee5ebdf..26f0d0d 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -73,7 +73,7 @@ Every agent is identified by a unique call sign (such as `ZER0` or `SP4CE_TR4DER - [x] `COSMIC` - The Cosmic Engineers are a group of highly advanced scientists and engineers who seek to terraform and colonize new worlds, pushing the boundaries of technology and exploration. - [x] `VOID` - The Voidfarers are a group of nomadic traders and adventurers who travel the galaxy in search of riches and adventure, willing to take risks and explore the unknown. -- [x] `GALLACTIC` - The Galactic Alliance is a coalition of planets and factions that have banded together for mutual protection and support, working together to defend against external threats and promote cooperation. +- [x] `GALACTIC` - The Galactic Alliance is a coalition of planets and factions that have banded together for mutual protection and support, working together to defend against external threats and promote cooperation. - [x] `QUANTUM` - The Quantum Federation is a group of planets and factions that have joined together to share knowledge and technology, using their collective expertise to advance the science and technology of the galaxy. - [x] `DOMINION` - The Stellar Dominion is a powerful, expansionist faction that seeks to conquer and control as many systems as possible, using their advanced technology and military might to dominate their rivals. - [x] `ASTRO` - The Astro-Salvage Alliance is a group of scavengers and salvagers who search the galaxy for ancient artifacts and valuable technology, often combing through old ship battlegrounds and derelict space stations. From 5c2057e79c7510f1447eb21fb37e1f7cf2721ee5 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Wed, 4 Jan 2023 08:33:31 -0800 Subject: [PATCH 45/48] apply min and max values to pagination params --- reference/SpaceTraders.json | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 6443f28..042d0c8 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -21,7 +21,7 @@ "servers": [ { "description": "v2.0.0-rc.2", - "url": "https://api-server-2-0-0-rc-2-vxxwq5xqdq-uc.a.run.app" + "url": "https://v2-0-0.rc-2.spacetraders.io" } ], "tags": [ @@ -193,7 +193,8 @@ "parameters": [ { "schema": { - "type": "integer" + "type": "integer", + "minimum": 1 }, "in": "query", "name": "page", @@ -201,7 +202,9 @@ }, { "schema": { - "type": "integer" + "type": "integer", + "minimum": 1, + "maximum": 100 }, "in": "query", "name": "limit", @@ -302,7 +305,8 @@ "parameters": [ { "schema": { - "type": "integer" + "type": "integer", + "minimum": 1 }, "in": "query", "name": "page", @@ -310,7 +314,9 @@ }, { "schema": { - "type": "integer" + "type": "integer", + "minimum": 1, + "maximum": 100 }, "in": "query", "name": "limit", @@ -591,7 +597,8 @@ "parameters": [ { "schema": { - "type": "integer" + "type": "integer", + "minimum": 1 }, "in": "query", "name": "page", @@ -599,7 +606,9 @@ }, { "schema": { - "type": "integer" + "type": "integer", + "minimum": 1, + "maximum": 100 }, "in": "query", "name": "limit", @@ -729,7 +738,8 @@ "parameters": [ { "schema": { - "type": "integer" + "type": "integer", + "minimum": 1 }, "in": "query", "name": "page", @@ -737,7 +747,9 @@ }, { "schema": { - "type": "integer" + "type": "integer", + "minimum": 1, + "maximum": 100 }, "in": "query", "name": "limit", @@ -1036,7 +1048,8 @@ "parameters": [ { "schema": { - "type": "integer" + "type": "integer", + "minimum": 1 }, "in": "query", "name": "page", @@ -1044,7 +1057,9 @@ }, { "schema": { - "type": "integer" + "type": "integer", + "minimum": 1, + "maximum": 100 }, "in": "query", "name": "limit", From 5b18aac076a9b2fe7b9fb6b4539b7f1d66aa5ca6 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Fri, 6 Jan 2023 09:20:41 -0800 Subject: [PATCH 46/48] update URL in guide --- docs/quickstart.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/quickstart.md b/docs/quickstart.md index 26f0d0d..6fd5c2e 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -40,7 +40,7 @@ brew install httpie You can then hit any API endpoint by simplying typing `https` along with the http method and the url. You can test this by hitting the game status endpoint which will tell us if the game is currently available to play: ```bash -https GET api-server-2-0-0-rc-2-vxxwq5xqdq-uc.a.run.app +https GET v2-0-0.rc-2.spacetraders.io ``` ```json @@ -80,7 +80,7 @@ Every agent is identified by a unique call sign (such as `ZER0` or `SP4CE_TR4DER - [x] `CORSAIRS` - The Seventh Space Corsairs are a feared group of pirates and raiders who operate throughout the galaxy, preying on merchant ships and plundering valuable cargo. ```bash -https POST api-server-2-0-0-rc-2-vxxwq5xqdq-uc.a.run.app/register \ +https POST v2-0-0.rc-2.spacetraders.io/register \ symbol=ZER0 \ faction=COSMIC ``` @@ -113,7 +113,7 @@ Copy your token somewhere safe and set it as a variable in your command prompt. apiToken= shipSymbol= contractId= -apiUrl=api-server-2-0-0-rc-2-vxxwq5xqdq-uc.a.run.app +apiUrl=v2-0-0.rc-2.spacetraders.io ``` From d5aa0454d4d124879d4b8632f4429608ac96ac17 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Mon, 9 Jan 2023 08:16:05 -0800 Subject: [PATCH 47/48] fix: add warp drives to enum --- models/TradeSymbol.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/models/TradeSymbol.json b/models/TradeSymbol.json index 3a57047..c76d80f 100644 --- a/models/TradeSymbol.json +++ b/models/TradeSymbol.json @@ -91,6 +91,9 @@ "MODULE_JUMP_DRIVE_I", "MODULE_JUMP_DRIVE_II", "MODULE_JUMP_DRIVE_III", + "MODULE_WARP_DRIVE_I", + "MODULE_WARP_DRIVE_II", + "MODULE_WARP_DRIVE_III", "MODULE_SHIELD_GENERATOR_I", "MODULE_SHIELD_GENERATOR_II", "MOUNT_GAS_SIPHON_I", From 26cc968eb30066d19c2a2404751a8ab082f272a9 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Sat, 21 Jan 2023 08:45:36 -0800 Subject: [PATCH 48/48] fix: update enums for factions and ship roles --- models/ShipRole.json | 18 +++++++++++++++++- reference/SpaceTraders.json | 7 +------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/models/ShipRole.json b/models/ShipRole.json index 23d7210..d6c3bb6 100644 --- a/models/ShipRole.json +++ b/models/ShipRole.json @@ -1,4 +1,20 @@ { "type": "string", - "description": "The registered role of the ship" + "description": "The registered role of the ship", + "enum": [ + "FABRICATOR", + "HARVESTER", + "HAULER", + "INTERCEPTOR", + "EXCAVATOR", + "TRANSPORT", + "REPAIR", + "SURVEYOR", + "COMMAND", + "CARRIER", + "PATROL", + "SATELLITE", + "EXPLORER", + "REFINERY" + ] } \ No newline at end of file diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 042d0c8..f09236b 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -74,12 +74,7 @@ "VOID", "GALACTIC", "QUANTUM", - "DOMINION", - "ASTRO", - "CORSAIRS", - "UNITED", - "SOLITARY", - "COBALT" + "DOMINION" ] }, "symbol": {