Skip to content

Commit

Permalink
generate new client based on June 24, 2023 reset
Browse files Browse the repository at this point in the history
  • Loading branch information
jonchurch committed Aug 5, 2023
1 parent 5610603 commit 9219694
Show file tree
Hide file tree
Showing 72 changed files with 1,222 additions and 300 deletions.
12 changes: 8 additions & 4 deletions src/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ models/ExtractResourcesRequest.ts
models/Extraction.ts
models/ExtractionYield.ts
models/Faction.ts
models/FactionSymbols.ts
models/FactionTrait.ts
models/FulfillContract200Response.ts
models/GetAgents200Response.ts
models/GetContract200Response.ts
models/GetContracts200Response.ts
models/GetFaction200Response.ts
Expand Down Expand Up @@ -66,7 +68,6 @@ models/GetSystems200Response.ts
models/GetWaypoint200Response.ts
models/InstallMount201Response.ts
models/InstallMount201ResponseData.ts
models/InstallMount201ResponseDataTransaction.ts
models/InstallMountRequest.ts
models/Jettison200Response.ts
models/Jettison200ResponseData.ts
Expand Down Expand Up @@ -94,10 +95,12 @@ models/PurchaseShip201ResponseData.ts
models/PurchaseShipRequest.ts
models/RefuelShip200Response.ts
models/RefuelShip200ResponseData.ts
models/RefuelShipRequest.ts
models/Register201Response.ts
models/Register201ResponseData.ts
models/RegisterRequest.ts
models/RemoveMount201Response.ts
models/RemoveMount201ResponseData.ts
models/RemoveMountRequest.ts
models/ScannedShip.ts
models/ScannedShipEngine.ts
Expand All @@ -117,6 +120,7 @@ models/ShipEngine.ts
models/ShipFrame.ts
models/ShipFuel.ts
models/ShipFuelConsumed.ts
models/ShipModificationTransaction.ts
models/ShipModule.ts
models/ShipMount.ts
models/ShipNav.ts
Expand All @@ -125,9 +129,9 @@ models/ShipNavRoute.ts
models/ShipNavRouteWaypoint.ts
models/ShipNavStatus.ts
models/ShipReactor.ts
models/ShipRefine200Response.ts
models/ShipRefine200ResponseData.ts
models/ShipRefine200ResponseDataProducedInner.ts
models/ShipRefine201Response.ts
models/ShipRefine201ResponseData.ts
models/ShipRefine201ResponseDataProducedInner.ts
models/ShipRefineRequest.ts
models/ShipRegistration.ts
models/ShipRequirements.ts
Expand Down
100 changes: 98 additions & 2 deletions src/apis/AgentsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,117 @@

import * as runtime from '../runtime';
import type {
GetAgents200Response,
GetMyAgent200Response,
} from '../models';
import {
GetAgents200ResponseFromJSON,
GetAgents200ResponseToJSON,
GetMyAgent200ResponseFromJSON,
GetMyAgent200ResponseToJSON,
} from '../models';

export interface GetAgentRequest {
agentSymbol: string;
}

export interface GetAgentsRequest {
page?: number;
limit?: number;
}

/**
*
*/
export class AgentsApi extends runtime.BaseAPI {

/**
* Fetch agent details.
* Get Public Agent
*/
async getAgentRaw(requestParameters: GetAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetMyAgent200Response>> {
if (requestParameters.agentSymbol === null || requestParameters.agentSymbol === undefined) {
throw new runtime.RequiredError('agentSymbol','Required parameter requestParameters.agentSymbol was null or undefined when calling getAgent.');
}

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("AgentToken", []);

if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/agents/{agentSymbol}`.replace(`{${"agentSymbol"}}`, encodeURIComponent(String(requestParameters.agentSymbol))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => GetMyAgent200ResponseFromJSON(jsonValue));
}

/**
* Fetch agent details.
* Get Public Agent
*/
async getAgent(agentSymbol: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetMyAgent200Response> {
const response = await this.getAgentRaw({ agentSymbol: agentSymbol }, initOverrides);
return await response.value();
}

/**
* Fetch agents details.
* List Agents
*/
async getAgentsRaw(requestParameters: GetAgentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetAgents200Response>> {
const queryParameters: any = {};

if (requestParameters.page !== undefined) {
queryParameters['page'] = requestParameters.page;
}

if (requestParameters.limit !== undefined) {
queryParameters['limit'] = requestParameters.limit;
}

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("AgentToken", []);

if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/agents`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => GetAgents200ResponseFromJSON(jsonValue));
}

/**
* Fetch agents details.
* List Agents
*/
async getAgents(page?: number, limit?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetAgents200Response> {
const response = await this.getAgentsRaw({ page: page, limit: limit }, initOverrides);
return await response.value();
}

/**
* Fetch your agent\'s details.
* My Agent Details
* Get Agent
*/
async getMyAgentRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetMyAgent200Response>> {
const queryParameters: any = {};
Expand All @@ -56,7 +152,7 @@ export class AgentsApi extends runtime.BaseAPI {

/**
* Fetch your agent\'s details.
* My Agent Details
* Get Agent
*/
async getMyAgent(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetMyAgent200Response> {
const response = await this.getMyAgentRaw(initOverrides);
Expand Down
20 changes: 10 additions & 10 deletions src/apis/ContractsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface GetContractsRequest {
export class ContractsApi extends runtime.BaseAPI {

/**
* Accept a contract.
* 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.
* Accept Contract
*/
async acceptContractRaw(requestParameters: AcceptContractRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AcceptContract200Response>> {
Expand Down Expand Up @@ -96,7 +96,7 @@ export class ContractsApi extends runtime.BaseAPI {
}

/**
* Accept a contract.
* 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.
* Accept Contract
*/
async acceptContract(contractId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AcceptContract200Response> {
Expand All @@ -105,8 +105,8 @@ export class ContractsApi extends runtime.BaseAPI {
}

/**
* Deliver cargo on a given contract.
* Deliver Contract
* 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.
* Deliver Cargo to Contract
*/
async deliverContractRaw(requestParameters: DeliverContractOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DeliverContract200Response>> {
if (requestParameters.contractId === null || requestParameters.contractId === undefined) {
Expand Down Expand Up @@ -139,16 +139,16 @@ export class ContractsApi extends runtime.BaseAPI {
}

/**
* Deliver cargo on a given contract.
* Deliver Contract
* 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.
* Deliver Cargo to Contract
*/
async deliverContract(contractId: string, deliverContractRequest?: DeliverContractRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DeliverContract200Response> {
const response = await this.deliverContractRaw({ contractId: contractId, deliverContractRequest: deliverContractRequest }, initOverrides);
return await response.value();
}

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

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

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

/**
* List all of your contracts.
* Return a paginated list of all your contracts.
* List Contracts
*/
async getContracts(page?: number, limit?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetContracts200Response> {
Expand Down
16 changes: 12 additions & 4 deletions src/apis/DefaultApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,22 @@ export interface RegisterOperationRequest {
export class DefaultApi extends runtime.BaseAPI {

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

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("AgentToken", []);

if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/`,
method: 'GET',
Expand All @@ -57,7 +65,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

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

/**
* 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.
* 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.
* Register New Agent
*/
async registerRaw(requestParameters: RegisterOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Register201Response>> {
Expand All @@ -88,7 +96,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

/**
* 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.
* 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.
* Register New Agent
*/
async register(registerRequest?: RegisterRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Register201Response> {
Expand Down
4 changes: 2 additions & 2 deletions src/apis/FactionsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class FactionsApi extends runtime.BaseAPI {
}

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

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

0 comments on commit 9219694

Please sign in to comment.