From 6379a3c27f5bc5a3b7338882f0b24b588b375db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Baumk=C3=B6tter?= Date: Tue, 11 Jul 2023 23:44:03 +0000 Subject: [PATCH 1/2] public agent endpoints --- models/Agent.json | 7 ++- reference/SpaceTraders.json | 114 ++++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 2 deletions(-) diff --git a/models/Agent.json b/models/Agent.json index 2cc3710..f971d08 100644 --- a/models/Agent.json +++ b/models/Agent.json @@ -5,7 +5,7 @@ "accountId": { "type": "string", "minLength": 1, - "description": "Account ID that is tied to this agent." + "description": "Account ID that is tied to this agent. Only included on your own agent." }, "symbol": { "type": "string", @@ -26,10 +26,13 @@ "type": "string", "minLength": 1, "description": "The faction the agent started with." + }, + "shipCount": { + "type": "integer", + "description": "How many ships are owned by the agent." } }, "required": [ - "accountId", "symbol", "headquarters", "credits", diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index b039e4f..4a827aa 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -858,6 +858,120 @@ } ] }, + "/agents": { + "get": { + "description": "Fetch agents details.", + "operationId": "get-agents", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "items": { + "$ref": "../models/Agent.json" + }, + "type": "array" + }, + "meta": { + "$ref": "../models/Meta.json" + } + }, + "required": [ + "data", + "meta" + ], + "type": "object" + } + } + }, + "description": "Successfully fetched agents details." + } + }, + "summary": "List Agents", + "tags": [ + "Agents" + ], + "parameters": [ + { + "schema": { + "type": "integer", + "minimum": 1, + "default": 1 + }, + "in": "query", + "name": "page", + "description": "What entry offset to request" + }, + { + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "default": 10 + }, + "in": "query", + "name": "limit", + "description": "How many entries to return per page" + } + ], + "security": [ + {}, + { + "AgentToken": [] + } + ] + } + }, + "/agents/{agentSymbol}": { + "get": { + "description": "Fetch agent details.", + "operationId": "get-agent", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "$ref": "../models/Agent.json" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "Successfully fetched agent details." + } + }, + "summary": "Get Agent", + "tags": [ + "Agents" + ], + "parameters": [ + { + "description": "The agent symbol", + "in": "path", + "name": "agentSymbol", + "required": true, + "schema": { + "default": "FEBA66", + "type": "string" + } + } + ], + "security": [ + {}, + { + "AgentToken": [] + } + ] + } + }, "/my/agent": { "get": { "description": "Fetch your agent's details.", From da649dad933842b5cddb5df3f02585df8ce8ef8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Baumk=C3=B6tter?= Date: Wed, 12 Jul 2023 14:47:04 +0000 Subject: [PATCH 2/2] renamed the new endpoints --- reference/SpaceTraders.json | 72 ++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 4a827aa..e679ca0 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -858,6 +858,41 @@ } ] }, + "/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": "Successfully fetched agent details." + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Get Agent", + "tags": [ + "Agents" + ] + } + }, "/agents": { "get": { "description": "Fetch agents details.", @@ -948,7 +983,7 @@ "description": "Successfully fetched agent details." } }, - "summary": "Get Agent", + "summary": "Get Public Agent", "tags": [ "Agents" ], @@ -972,41 +1007,6 @@ ] } }, - "/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": "Successfully fetched agent details." - } - }, - "security": [ - { - "AgentToken": [] - } - ], - "summary": "Get Agent", - "tags": [ - "Agents" - ] - } - }, "/my/contracts": { "get": { "description": "Return a paginated list of all your contracts.",