Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/stevedylandev/space-trader-sdk

ZAP
https://github.com/stevedylandev/space-trader-sdk

Last synced: 11 days ago
JSON representation

ZAP

Awesome Lists containing this project

README

        

# space_traders_api

SpaceTradersApi - JavaScript client for space_traders_api
SpaceTraders is an open-universe game and learning platform that offers a set of HTTP endpoints to control a fleet of ships and explore a multiplayer universe. The API is documented using [OpenAPI](https://github.com/SpaceTradersAPI/api-docs). You can send your first request right here in your browser to check the status of the game server. ```json http { \"method\": \"GET\", \"url\": \"https://api.spacetraders.io/v2\", } ``` Unlike a traditional game, SpaceTraders does not have a first-party client or app to play the game. Instead, you can use the API to build your own client, write a script to automate your ships, or try an app built by the community. We have a [Discord channel](https://discord.com/invite/jh6zurdWk5) where you can share your projects, ask questions, and get help from other players.
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: 2.0.0
- Package version: 2.0.0
- Build package: io.swagger.codegen.v3.generators.javascript.JavaScriptClientCodegen

## Installation

### For [Node.js](https://nodejs.org/)

#### npm

To publish the library as a [npm](https://www.npmjs.com/),
please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).

Then install it via:

```shell
npm install space_traders_api --save
```

#### git
#
If the library is hosted at a git repository, e.g.
https://github.com/GIT_USER_ID/GIT_REPO_ID
then install it via:

```shell
npm install GIT_USER_ID/GIT_REPO_ID --save
```

### For browser

The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
the above steps with Node.js and installing browserify with `npm install -g browserify`,
perform the following (assuming *main.js* is your entry file):

```shell
browserify main.js > bundle.js
```

Then include *bundle.js* in the HTML pages.

### Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error:
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
the following section to your webpack config:

```javascript
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
```

## Getting Started

Please follow the [installation](#installation) instruction and execute the following JS code:

```javascript
var SpaceTradersApi = require('space_traders_api');
var defaultClient = SpaceTradersApi.ApiClient.instance;

var api = new SpaceTradersApi.AgentsApi()
var agentSymbol = "agentSymbol_example"; // {String} The agent symbol

var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getAgent(agentSymbol, callback);
```

## Documentation for API Endpoints

All URIs are relative to *https://api.spacetraders.io/v2*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*SpaceTradersApi.AgentsApi* | [**getAgent**](docs/AgentsApi.md#getAgent) | **GET** /agents/{agentSymbol} | Get Public Agent
*SpaceTradersApi.AgentsApi* | [**getAgents**](docs/AgentsApi.md#getAgents) | **GET** /agents | List Agents
*SpaceTradersApi.AgentsApi* | [**getMyAgent**](docs/AgentsApi.md#getMyAgent) | **GET** /my/agent | Get Agent
*SpaceTradersApi.ContractsApi* | [**acceptContract**](docs/ContractsApi.md#acceptContract) | **POST** /my/contracts/{contractId}/accept | Accept Contract
*SpaceTradersApi.ContractsApi* | [**deliverContract**](docs/ContractsApi.md#deliverContract) | **POST** /my/contracts/{contractId}/deliver | Deliver Cargo to Contract
*SpaceTradersApi.ContractsApi* | [**fulfillContract**](docs/ContractsApi.md#fulfillContract) | **POST** /my/contracts/{contractId}/fulfill | Fulfill Contract
*SpaceTradersApi.ContractsApi* | [**getContract**](docs/ContractsApi.md#getContract) | **GET** /my/contracts/{contractId} | Get Contract
*SpaceTradersApi.ContractsApi* | [**getContracts**](docs/ContractsApi.md#getContracts) | **GET** /my/contracts | List Contracts
*SpaceTradersApi.DefaultApi* | [**getStatus**](docs/DefaultApi.md#getStatus) | **GET** / | Get Status
*SpaceTradersApi.DefaultApi* | [**register**](docs/DefaultApi.md#register) | **POST** /register | Register New Agent
*SpaceTradersApi.FactionsApi* | [**getFaction**](docs/FactionsApi.md#getFaction) | **GET** /factions/{factionSymbol} | Get Faction
*SpaceTradersApi.FactionsApi* | [**getFactions**](docs/FactionsApi.md#getFactions) | **GET** /factions | List Factions
*SpaceTradersApi.FleetApi* | [**createChart**](docs/FleetApi.md#createChart) | **POST** /my/ships/{shipSymbol}/chart | Create Chart
*SpaceTradersApi.FleetApi* | [**createShipShipScan**](docs/FleetApi.md#createShipShipScan) | **POST** /my/ships/{shipSymbol}/scan/ships | Scan Ships
*SpaceTradersApi.FleetApi* | [**createShipSystemScan**](docs/FleetApi.md#createShipSystemScan) | **POST** /my/ships/{shipSymbol}/scan/systems | Scan Systems
*SpaceTradersApi.FleetApi* | [**createShipWaypointScan**](docs/FleetApi.md#createShipWaypointScan) | **POST** /my/ships/{shipSymbol}/scan/waypoints | Scan Waypoints
*SpaceTradersApi.FleetApi* | [**createSurvey**](docs/FleetApi.md#createSurvey) | **POST** /my/ships/{shipSymbol}/survey | Create Survey
*SpaceTradersApi.FleetApi* | [**dockShip**](docs/FleetApi.md#dockShip) | **POST** /my/ships/{shipSymbol}/dock | Dock Ship
*SpaceTradersApi.FleetApi* | [**extractResources**](docs/FleetApi.md#extractResources) | **POST** /my/ships/{shipSymbol}/extract | Extract Resources
*SpaceTradersApi.FleetApi* | [**extractResourcesWithSurvey**](docs/FleetApi.md#extractResourcesWithSurvey) | **POST** /my/ships/{shipSymbol}/extract/survey | Extract Resources with Survey
*SpaceTradersApi.FleetApi* | [**getMounts**](docs/FleetApi.md#getMounts) | **GET** /my/ships/{shipSymbol}/mounts | Get Mounts
*SpaceTradersApi.FleetApi* | [**getMyShip**](docs/FleetApi.md#getMyShip) | **GET** /my/ships/{shipSymbol} | Get Ship
*SpaceTradersApi.FleetApi* | [**getMyShipCargo**](docs/FleetApi.md#getMyShipCargo) | **GET** /my/ships/{shipSymbol}/cargo | Get Ship Cargo
*SpaceTradersApi.FleetApi* | [**getMyShips**](docs/FleetApi.md#getMyShips) | **GET** /my/ships | List Ships
*SpaceTradersApi.FleetApi* | [**getShipCooldown**](docs/FleetApi.md#getShipCooldown) | **GET** /my/ships/{shipSymbol}/cooldown | Get Ship Cooldown
*SpaceTradersApi.FleetApi* | [**getShipNav**](docs/FleetApi.md#getShipNav) | **GET** /my/ships/{shipSymbol}/nav | Get Ship Nav
*SpaceTradersApi.FleetApi* | [**installMount**](docs/FleetApi.md#installMount) | **POST** /my/ships/{shipSymbol}/mounts/install | Install Mount
*SpaceTradersApi.FleetApi* | [**jettison**](docs/FleetApi.md#jettison) | **POST** /my/ships/{shipSymbol}/jettison | Jettison Cargo
*SpaceTradersApi.FleetApi* | [**jumpShip**](docs/FleetApi.md#jumpShip) | **POST** /my/ships/{shipSymbol}/jump | Jump Ship
*SpaceTradersApi.FleetApi* | [**navigateShip**](docs/FleetApi.md#navigateShip) | **POST** /my/ships/{shipSymbol}/navigate | Navigate Ship
*SpaceTradersApi.FleetApi* | [**negotiateContract**](docs/FleetApi.md#negotiateContract) | **POST** /my/ships/{shipSymbol}/negotiate/contract | Negotiate Contract
*SpaceTradersApi.FleetApi* | [**orbitShip**](docs/FleetApi.md#orbitShip) | **POST** /my/ships/{shipSymbol}/orbit | Orbit Ship
*SpaceTradersApi.FleetApi* | [**patchShipNav**](docs/FleetApi.md#patchShipNav) | **PATCH** /my/ships/{shipSymbol}/nav | Patch Ship Nav
*SpaceTradersApi.FleetApi* | [**purchaseCargo**](docs/FleetApi.md#purchaseCargo) | **POST** /my/ships/{shipSymbol}/purchase | Purchase Cargo
*SpaceTradersApi.FleetApi* | [**purchaseShip**](docs/FleetApi.md#purchaseShip) | **POST** /my/ships | Purchase Ship
*SpaceTradersApi.FleetApi* | [**refuelShip**](docs/FleetApi.md#refuelShip) | **POST** /my/ships/{shipSymbol}/refuel | Refuel Ship
*SpaceTradersApi.FleetApi* | [**removeMount**](docs/FleetApi.md#removeMount) | **POST** /my/ships/{shipSymbol}/mounts/remove | Remove Mount
*SpaceTradersApi.FleetApi* | [**sellCargo**](docs/FleetApi.md#sellCargo) | **POST** /my/ships/{shipSymbol}/sell | Sell Cargo
*SpaceTradersApi.FleetApi* | [**shipRefine**](docs/FleetApi.md#shipRefine) | **POST** /my/ships/{shipSymbol}/refine | Ship Refine
*SpaceTradersApi.FleetApi* | [**transferCargo**](docs/FleetApi.md#transferCargo) | **POST** /my/ships/{shipSymbol}/transfer | Transfer Cargo
*SpaceTradersApi.FleetApi* | [**warpShip**](docs/FleetApi.md#warpShip) | **POST** /my/ships/{shipSymbol}/warp | Warp Ship
*SpaceTradersApi.SystemsApi* | [**getJumpGate**](docs/SystemsApi.md#getJumpGate) | **GET** /systems/{systemSymbol}/waypoints/{waypointSymbol}/jump-gate | Get Jump Gate
*SpaceTradersApi.SystemsApi* | [**getMarket**](docs/SystemsApi.md#getMarket) | **GET** /systems/{systemSymbol}/waypoints/{waypointSymbol}/market | Get Market
*SpaceTradersApi.SystemsApi* | [**getShipyard**](docs/SystemsApi.md#getShipyard) | **GET** /systems/{systemSymbol}/waypoints/{waypointSymbol}/shipyard | Get Shipyard
*SpaceTradersApi.SystemsApi* | [**getSystem**](docs/SystemsApi.md#getSystem) | **GET** /systems/{systemSymbol} | Get System
*SpaceTradersApi.SystemsApi* | [**getSystemWaypoints**](docs/SystemsApi.md#getSystemWaypoints) | **GET** /systems/{systemSymbol}/waypoints | List Waypoints in System
*SpaceTradersApi.SystemsApi* | [**getSystems**](docs/SystemsApi.md#getSystems) | **GET** /systems | List Systems
*SpaceTradersApi.SystemsApi* | [**getWaypoint**](docs/SystemsApi.md#getWaypoint) | **GET** /systems/{systemSymbol}/waypoints/{waypointSymbol} | Get Waypoint

## Documentation for Models

## Documentation for Authorization

### AgentToken