82 lines
2.6 KiB
Markdown
82 lines
2.6 KiB
Markdown
## restClient@0.0.1
|
|
|
|
This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
|
|
|
|
Environment
|
|
* Node.js
|
|
* Webpack
|
|
* Browserify
|
|
|
|
Language level
|
|
* ES5 - you must have a Promises/A+ library installed
|
|
* ES6
|
|
|
|
Module system
|
|
* CommonJS
|
|
* ES6 module system
|
|
|
|
It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via `package.json`. ([Reference](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html))
|
|
|
|
### Building
|
|
|
|
To build and compile the typescript sources to javascript use:
|
|
```
|
|
npm install
|
|
npm run build
|
|
```
|
|
|
|
### Publishing
|
|
|
|
First build the package then run `npm publish`
|
|
|
|
### Consuming
|
|
|
|
navigate to the folder of your consuming project and run one of the following commands.
|
|
|
|
_published:_
|
|
|
|
```
|
|
npm install restClient@0.0.1 --save
|
|
```
|
|
|
|
_unPublished (not recommended):_
|
|
|
|
```
|
|
npm install PATH_TO_GENERATED_PACKAGE --save
|
|
```
|
|
|
|
### Documentation for API Endpoints
|
|
|
|
All URIs are relative to *http://localhost*
|
|
|
|
Class | Method | HTTP request | Description
|
|
------------ | ------------- | ------------- | -------------
|
|
*CardService* | [**apiCardsIdNewPut**](docs/CardService.md#apicardsidnewput) | **PUT** /api/cards/{id}/new | Test
|
|
*CardService* | [**getCardById**](docs/CardService.md#getcardbyid) | **GET** /api/cards/{id} | Get a singular Card by its ID
|
|
*CardService* | [**getCardImageById**](docs/CardService.md#getcardimagebyid) | **GET** /api/cards/{id}/image | Get the image of a Card by its ID
|
|
*CardService* | [**getCards**](docs/CardService.md#getcards) | **GET** /api/cards | Get a page of Cards with optional name query parameter
|
|
*DeckService* | [**addCardToDeck**](docs/DeckService.md#addcardtodeck) | **POST** /api/decks/{deckName}/{cardId} | Add a Card by its ID to a Deck by its name
|
|
*DeckService* | [**createDeck**](docs/DeckService.md#createdeck) | **POST** /api/decks | Create a Deck with a given name
|
|
*DeckService* | [**getDeckByName**](docs/DeckService.md#getdeckbyname) | **GET** /api/decks/{name} | Get a singular Deck by its name
|
|
*DeckService* | [**getDecks**](docs/DeckService.md#getdecks) | **GET** /api/decks | Get a page of Decks with optional name query parameter
|
|
|
|
|
|
### Documentation For Models
|
|
|
|
- [Card](docs/Card.md)
|
|
- [CardPrint](docs/CardPrint.md)
|
|
- [CardType](docs/CardType.md)
|
|
- [Deck](docs/Deck.md)
|
|
- [NewCard](docs/NewCard.md)
|
|
- [PageDeck](docs/PageDeck.md)
|
|
- [Region](docs/Region.md)
|
|
- [RegionalSet](docs/RegionalSet.md)
|
|
- [SetPrefix](docs/SetPrefix.md)
|
|
|
|
|
|
<a id="documentation-for-authorization"></a>
|
|
## Documentation For Authorization
|
|
|
|
Endpoints do not require authorization.
|
|
|