Skip to content

Commit 9219694

Browse files
committed
generate new client based on June 24, 2023 reset
1 parent 5610603 commit 9219694

File tree

72 files changed

+1222
-300
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1222
-300
lines changed

src/.openapi-generator/FILES

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ models/ExtractResourcesRequest.ts
3636
models/Extraction.ts
3737
models/ExtractionYield.ts
3838
models/Faction.ts
39+
models/FactionSymbols.ts
3940
models/FactionTrait.ts
4041
models/FulfillContract200Response.ts
42+
models/GetAgents200Response.ts
4143
models/GetContract200Response.ts
4244
models/GetContracts200Response.ts
4345
models/GetFaction200Response.ts
@@ -66,7 +68,6 @@ models/GetSystems200Response.ts
6668
models/GetWaypoint200Response.ts
6769
models/InstallMount201Response.ts
6870
models/InstallMount201ResponseData.ts
69-
models/InstallMount201ResponseDataTransaction.ts
7071
models/InstallMountRequest.ts
7172
models/Jettison200Response.ts
7273
models/Jettison200ResponseData.ts
@@ -94,10 +95,12 @@ models/PurchaseShip201ResponseData.ts
9495
models/PurchaseShipRequest.ts
9596
models/RefuelShip200Response.ts
9697
models/RefuelShip200ResponseData.ts
98+
models/RefuelShipRequest.ts
9799
models/Register201Response.ts
98100
models/Register201ResponseData.ts
99101
models/RegisterRequest.ts
100102
models/RemoveMount201Response.ts
103+
models/RemoveMount201ResponseData.ts
101104
models/RemoveMountRequest.ts
102105
models/ScannedShip.ts
103106
models/ScannedShipEngine.ts
@@ -117,6 +120,7 @@ models/ShipEngine.ts
117120
models/ShipFrame.ts
118121
models/ShipFuel.ts
119122
models/ShipFuelConsumed.ts
123+
models/ShipModificationTransaction.ts
120124
models/ShipModule.ts
121125
models/ShipMount.ts
122126
models/ShipNav.ts
@@ -125,9 +129,9 @@ models/ShipNavRoute.ts
125129
models/ShipNavRouteWaypoint.ts
126130
models/ShipNavStatus.ts
127131
models/ShipReactor.ts
128-
models/ShipRefine200Response.ts
129-
models/ShipRefine200ResponseData.ts
130-
models/ShipRefine200ResponseDataProducedInner.ts
132+
models/ShipRefine201Response.ts
133+
models/ShipRefine201ResponseData.ts
134+
models/ShipRefine201ResponseDataProducedInner.ts
131135
models/ShipRefineRequest.ts
132136
models/ShipRegistration.ts
133137
models/ShipRequirements.ts

src/apis/AgentsApi.ts

Lines changed: 98 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,117 @@
1515

1616
import * as runtime from '../runtime';
1717
import type {
18+
GetAgents200Response,
1819
GetMyAgent200Response,
1920
} from '../models';
2021
import {
22+
GetAgents200ResponseFromJSON,
23+
GetAgents200ResponseToJSON,
2124
GetMyAgent200ResponseFromJSON,
2225
GetMyAgent200ResponseToJSON,
2326
} from '../models';
2427

28+
export interface GetAgentRequest {
29+
agentSymbol: string;
30+
}
31+
32+
export interface GetAgentsRequest {
33+
page?: number;
34+
limit?: number;
35+
}
36+
2537
/**
2638
*
2739
*/
2840
export class AgentsApi extends runtime.BaseAPI {
2941

42+
/**
43+
* Fetch agent details.
44+
* Get Public Agent
45+
*/
46+
async getAgentRaw(requestParameters: GetAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetMyAgent200Response>> {
47+
if (requestParameters.agentSymbol === null || requestParameters.agentSymbol === undefined) {
48+
throw new runtime.RequiredError('agentSymbol','Required parameter requestParameters.agentSymbol was null or undefined when calling getAgent.');
49+
}
50+
51+
const queryParameters: any = {};
52+
53+
const headerParameters: runtime.HTTPHeaders = {};
54+
55+
if (this.configuration && this.configuration.accessToken) {
56+
const token = this.configuration.accessToken;
57+
const tokenString = await token("AgentToken", []);
58+
59+
if (tokenString) {
60+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
61+
}
62+
}
63+
const response = await this.request({
64+
path: `/agents/{agentSymbol}`.replace(`{${"agentSymbol"}}`, encodeURIComponent(String(requestParameters.agentSymbol))),
65+
method: 'GET',
66+
headers: headerParameters,
67+
query: queryParameters,
68+
}, initOverrides);
69+
70+
return new runtime.JSONApiResponse(response, (jsonValue) => GetMyAgent200ResponseFromJSON(jsonValue));
71+
}
72+
73+
/**
74+
* Fetch agent details.
75+
* Get Public Agent
76+
*/
77+
async getAgent(agentSymbol: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetMyAgent200Response> {
78+
const response = await this.getAgentRaw({ agentSymbol: agentSymbol }, initOverrides);
79+
return await response.value();
80+
}
81+
82+
/**
83+
* Fetch agents details.
84+
* List Agents
85+
*/
86+
async getAgentsRaw(requestParameters: GetAgentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetAgents200Response>> {
87+
const queryParameters: any = {};
88+
89+
if (requestParameters.page !== undefined) {
90+
queryParameters['page'] = requestParameters.page;
91+
}
92+
93+
if (requestParameters.limit !== undefined) {
94+
queryParameters['limit'] = requestParameters.limit;
95+
}
96+
97+
const headerParameters: runtime.HTTPHeaders = {};
98+
99+
if (this.configuration && this.configuration.accessToken) {
100+
const token = this.configuration.accessToken;
101+
const tokenString = await token("AgentToken", []);
102+
103+
if (tokenString) {
104+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
105+
}
106+
}
107+
const response = await this.request({
108+
path: `/agents`,
109+
method: 'GET',
110+
headers: headerParameters,
111+
query: queryParameters,
112+
}, initOverrides);
113+
114+
return new runtime.JSONApiResponse(response, (jsonValue) => GetAgents200ResponseFromJSON(jsonValue));
115+
}
116+
117+
/**
118+
* Fetch agents details.
119+
* List Agents
120+
*/
121+
async getAgents(page?: number, limit?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetAgents200Response> {
122+
const response = await this.getAgentsRaw({ page: page, limit: limit }, initOverrides);
123+
return await response.value();
124+
}
125+
30126
/**
31127
* Fetch your agent\'s details.
32-
* My Agent Details
128+
* Get Agent
33129
*/
34130
async getMyAgentRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetMyAgent200Response>> {
35131
const queryParameters: any = {};
@@ -56,7 +152,7 @@ export class AgentsApi extends runtime.BaseAPI {
56152

57153
/**
58154
* Fetch your agent\'s details.
59-
* My Agent Details
155+
* Get Agent
60156
*/
61157
async getMyAgent(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetMyAgent200Response> {
62158
const response = await this.getMyAgentRaw(initOverrides);

src/apis/ContractsApi.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export interface GetContractsRequest {
6565
export class ContractsApi extends runtime.BaseAPI {
6666

6767
/**
68-
* Accept a contract.
68+
* Accept a contract by ID. You can only accept contracts that were offered to you, were not accepted yet, and whose deadlines has not passed yet.
6969
* Accept Contract
7070
*/
7171
async acceptContractRaw(requestParameters: AcceptContractRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AcceptContract200Response>> {
@@ -96,7 +96,7 @@ export class ContractsApi extends runtime.BaseAPI {
9696
}
9797

9898
/**
99-
* Accept a contract.
99+
* Accept a contract by ID. You can only accept contracts that were offered to you, were not accepted yet, and whose deadlines has not passed yet.
100100
* Accept Contract
101101
*/
102102
async acceptContract(contractId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AcceptContract200Response> {
@@ -105,8 +105,8 @@ export class ContractsApi extends runtime.BaseAPI {
105105
}
106106

107107
/**
108-
* Deliver cargo on a given contract.
109-
* Deliver Contract
108+
* Deliver cargo to a contract. In order to use this API, a ship must be at the delivery location (denoted in the delivery terms as `destinationSymbol` of a contract) and must have a number of units of a good required by this contract in its cargo. Cargo that was delivered will be removed from the ship\'s cargo.
109+
* Deliver Cargo to Contract
110110
*/
111111
async deliverContractRaw(requestParameters: DeliverContractOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DeliverContract200Response>> {
112112
if (requestParameters.contractId === null || requestParameters.contractId === undefined) {
@@ -139,16 +139,16 @@ export class ContractsApi extends runtime.BaseAPI {
139139
}
140140

141141
/**
142-
* Deliver cargo on a given contract.
143-
* Deliver Contract
142+
* Deliver cargo to a contract. In order to use this API, a ship must be at the delivery location (denoted in the delivery terms as `destinationSymbol` of a contract) and must have a number of units of a good required by this contract in its cargo. Cargo that was delivered will be removed from the ship\'s cargo.
143+
* Deliver Cargo to Contract
144144
*/
145145
async deliverContract(contractId: string, deliverContractRequest?: DeliverContractRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DeliverContract200Response> {
146146
const response = await this.deliverContractRaw({ contractId: contractId, deliverContractRequest: deliverContractRequest }, initOverrides);
147147
return await response.value();
148148
}
149149

150150
/**
151-
* Fulfill a contract
151+
* Fulfill a contract. Can only be used on contracts that have all of their delivery terms fulfilled.
152152
* Fulfill Contract
153153
*/
154154
async fulfillContractRaw(requestParameters: FulfillContractRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FulfillContract200Response>> {
@@ -179,7 +179,7 @@ export class ContractsApi extends runtime.BaseAPI {
179179
}
180180

181181
/**
182-
* Fulfill a contract
182+
* Fulfill a contract. Can only be used on contracts that have all of their delivery terms fulfilled.
183183
* Fulfill Contract
184184
*/
185185
async fulfillContract(contractId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FulfillContract200Response> {
@@ -228,7 +228,7 @@ export class ContractsApi extends runtime.BaseAPI {
228228
}
229229

230230
/**
231-
* List all of your contracts.
231+
* Return a paginated list of all your contracts.
232232
* List Contracts
233233
*/
234234
async getContractsRaw(requestParameters: GetContractsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetContracts200Response>> {
@@ -263,7 +263,7 @@ export class ContractsApi extends runtime.BaseAPI {
263263
}
264264

265265
/**
266-
* List all of your contracts.
266+
* Return a paginated list of all your contracts.
267267
* List Contracts
268268
*/
269269
async getContracts(page?: number, limit?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetContracts200Response> {

src/apis/DefaultApi.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,22 @@ export interface RegisterOperationRequest {
3838
export class DefaultApi extends runtime.BaseAPI {
3939

4040
/**
41-
* Return the status of the game server.
41+
* Return the status of the game server. This also includes a few global elements, such as announcements, server reset dates and leaderboards.
4242
* Get Status
4343
*/
4444
async getStatusRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetStatus200Response>> {
4545
const queryParameters: any = {};
4646

4747
const headerParameters: runtime.HTTPHeaders = {};
4848

49+
if (this.configuration && this.configuration.accessToken) {
50+
const token = this.configuration.accessToken;
51+
const tokenString = await token("AgentToken", []);
52+
53+
if (tokenString) {
54+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
55+
}
56+
}
4957
const response = await this.request({
5058
path: `/`,
5159
method: 'GET',
@@ -57,7 +65,7 @@ export class DefaultApi extends runtime.BaseAPI {
5765
}
5866

5967
/**
60-
* Return the status of the game server.
68+
* Return the status of the game server. This also includes a few global elements, such as announcements, server reset dates and leaderboards.
6169
* Get Status
6270
*/
6371
async getStatus(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetStatus200Response> {
@@ -66,7 +74,7 @@ export class DefaultApi extends runtime.BaseAPI {
6674
}
6775

6876
/**
69-
* Creates a new agent and ties it to a temporary Account. The agent symbol is a 3-14 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 and execute the `/my/ships/{shipSymbol}/extract` 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.
77+
* Creates a new agent and ties it to an account. The agent symbol must consist of a 3-14 character string, and will be used to represent your agent. This symbol will prefix the symbol of every ship you own. Agent symbols will be cast to all uppercase characters. This new agent will be tied to a starting faction of your choice, which determines your starting location, and will be granted an authorization token, a contract with their starting faction, a command ship that can fly across space with advanced capabilities, a small probe ship that can be used for reconnaissance, and 150,000 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. If you are new to SpaceTraders, It is recommended to register with the COSMIC faction, a faction that is well connected to the rest of the universe. After registering, you should try our interactive [quickstart guide](https://docs.spacetraders.io/quickstart/new-game) which will walk you through basic API requests in just a few minutes.
7078
* Register New Agent
7179
*/
7280
async registerRaw(requestParameters: RegisterOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Register201Response>> {
@@ -88,7 +96,7 @@ export class DefaultApi extends runtime.BaseAPI {
8896
}
8997

9098
/**
91-
* Creates a new agent and ties it to a temporary Account. The agent symbol is a 3-14 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 and execute the `/my/ships/{shipSymbol}/extract` 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.
99+
* Creates a new agent and ties it to an account. The agent symbol must consist of a 3-14 character string, and will be used to represent your agent. This symbol will prefix the symbol of every ship you own. Agent symbols will be cast to all uppercase characters. This new agent will be tied to a starting faction of your choice, which determines your starting location, and will be granted an authorization token, a contract with their starting faction, a command ship that can fly across space with advanced capabilities, a small probe ship that can be used for reconnaissance, and 150,000 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. If you are new to SpaceTraders, It is recommended to register with the COSMIC faction, a faction that is well connected to the rest of the universe. After registering, you should try our interactive [quickstart guide](https://docs.spacetraders.io/quickstart/new-game) which will walk you through basic API requests in just a few minutes.
92100
* Register New Agent
93101
*/
94102
async register(registerRequest?: RegisterRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Register201Response> {

src/apis/FactionsApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class FactionsApi extends runtime.BaseAPI {
8080
}
8181

8282
/**
83-
* List all discovered factions in the game.
83+
* Return a paginated list of all the factions in the game.
8484
* List Factions
8585
*/
8686
async getFactionsRaw(requestParameters: GetFactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetFactions200Response>> {
@@ -115,7 +115,7 @@ export class FactionsApi extends runtime.BaseAPI {
115115
}
116116

117117
/**
118-
* List all discovered factions in the game.
118+
* Return a paginated list of all the factions in the game.
119119
* List Factions
120120
*/
121121
async getFactions(page?: number, limit?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetFactions200Response> {

0 commit comments

Comments
 (0)