Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e061d81e19 | |||
| 0cbb20fdf2 | |||
| 6a08d3a61a | |||
| 73328a1df2 | |||
| 25b4c2f5d1 | |||
| 5f2de997ea | |||
| befb72bde6 | |||
| 6cd9eab51b | |||
| c4967fb899 | |||
| 7ff5d7863d | |||
| f93dbe2fb6 | |||
| 9b95435d9e | |||
| b554a5f5d8 | |||
| a0b055f6e7 | |||
| ee12437d1a | |||
| 380d2e7c97 | |||
| 5b5d076e52 | |||
| 5d45d75720 |
31
README.md
31
README.md
@ -3,7 +3,7 @@
|
||||
This is the TypeScript SDK for the [Pokemon TCG API](https://pokemontcg.io).
|
||||
|
||||
# V2 Announcement
|
||||
Version 1 of this SDK is officially depricated. Version 2 stable release this SDK is scheduled to be released on **Friday, April 3rd, 20201**. Version 1 will continue to receive support until then. **See the [migration guide](MIGRATING.md) for steps to update your app to use the latest supported version of the SDK**
|
||||
Version 1 of this SDK is officially depricated. Version 2 stable release this SDK is scheduled to be released on **Friday, September 17th, 20201**. Version 1 will continue to receive support until then. **See the [migration guide](MIGRATING.md) for steps to update your app to use the latest supported version of the SDK**
|
||||
|
||||
## Installation
|
||||
|
||||
@ -49,6 +49,7 @@ To use the SDK with an API key, create an account at https://dev.pokemontcg.io t
|
||||
legalities: ILegality;
|
||||
images: ICardImage;
|
||||
tcgplayer?: ITCGPlayer;
|
||||
cardmarket?: ICardmarket;
|
||||
```
|
||||
|
||||
### IAbility
|
||||
@ -147,17 +148,19 @@ PokemonTCG.Card.all()
|
||||
```
|
||||
|
||||
## Contributing
|
||||
* Fork it (click the Fork button at the top of the page)
|
||||
* Create your feature branch (git checkout -b my-new-feature)
|
||||
* Make some changes and fix some bugs!
|
||||
* Run the tests `npm run-script test`
|
||||
* Test your changes in a project of yours:
|
||||
* Create a link with [npm](https://docs.npmjs.com/cli/link.html) or [yarn](https://yarnpkg.com/lang/en/docs/cli/link/) (depending on what tool you installed this SDK with)
|
||||
* In your project that **uses** the SDK, install the linked package with `yarn/npm link pokemon-tcg-sdk-typescript`
|
||||
* Verify the SDK behaves as expected, and your changes took effect
|
||||
* Commit your changes (git commit -am 'Add some feature')
|
||||
* Push to the branch (git push origin my-new-feature)
|
||||
* Create a new Pull Request
|
||||
* Open an issue
|
||||
* Describe what the SDK is missing and what changes you'd like to see implemented
|
||||
* **Ask clarifying questions**
|
||||
* Fork it (click the Fork button at the top of the page)
|
||||
* Create your feature branch (git checkout -b my-new-feature)
|
||||
* Make some changes and fix some bugs!
|
||||
* Run the tests `npm run-script test`
|
||||
* Test your changes in a project of yours:
|
||||
* Create a link with [npm](https://docs.npmjs.com/cli/link.html) or [yarn](https://yarnpkg.com/lang/en/docs/cli/link/) (depending on what tool you installed this SDK with)
|
||||
* In your project that **uses** the SDK, install the linked package with `yarn/npm link pokemon-tcg-sdk-typescript`
|
||||
* Verify the SDK behaves as expected, and your changes took effect
|
||||
* Commit your changes (git commit -am 'Add some feature')
|
||||
* Push to the branch (git push origin my-new-feature)
|
||||
* Create a new Pull Request to `master`
|
||||
|
||||
|
||||
## TODO
|
||||
* Add more testing?
|
||||
|
||||
10
package.json
10
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pokemon-tcg-sdk-typescript",
|
||||
"version": "1.3.1",
|
||||
"version": "1.3.4",
|
||||
"description": "Typescript SDK for the PokemonTCG API (https://pokemontcg.io)",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
@ -11,22 +11,24 @@
|
||||
"SDK"
|
||||
],
|
||||
"scripts": {
|
||||
"prepare": "npm run build",
|
||||
"test": "mocha --reporter spec --require ts-node/register 'coverage/**/*.test.ts'",
|
||||
"build": "tsc"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PokemonTCG/pokemon-tcg-sdk-typescript"
|
||||
"url": "https://gitea.sebar.dev/gitea_admin/pokemon-tcg-sdk-typescript.git"
|
||||
},
|
||||
"contributors": [
|
||||
"Bradyn Glines (https://github.com/glinesbdev)",
|
||||
"CptSpaceToaster (https://github.com/CptSpaceToaster)",
|
||||
"Monbrey (https://github.com/Monbrey)",
|
||||
"Jonathan Meyer (https://github.com/jonathan-meyer)"
|
||||
"Jonathan Meyer (https://github.com/jonathan-meyer)",
|
||||
"Tee Diang (https://github.com/acupoftee"
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"axios": "^0.19.0"
|
||||
"axios": "^1.7.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/chai": "^4.1.1",
|
||||
|
||||
@ -3,6 +3,7 @@ import { IAncientTrait } from "../interfaces/ancientTrait";
|
||||
import { IAttack } from "../interfaces/attack";
|
||||
import { ICard } from "../interfaces/card";
|
||||
import { ICardImage } from "../interfaces/image";
|
||||
import { ICardmarket } from "../interfaces/cardmarket";
|
||||
import { ILegality } from "../interfaces/legality";
|
||||
import { IQuery } from "../interfaces/query";
|
||||
import { IResistance } from "../interfaces/resistance";
|
||||
@ -35,8 +36,10 @@ export class Card implements ICard {
|
||||
flavorText?: string;
|
||||
nationalPokedexNumbers?: number[];
|
||||
legalities: ILegality;
|
||||
regulationMark?: string;
|
||||
images: ICardImage;
|
||||
tcgplayer?: ITCGPlayer;
|
||||
cardmarket?: ICardmarket;
|
||||
|
||||
resource(): string {
|
||||
return "cards";
|
||||
|
||||
@ -4,6 +4,7 @@ import { IAttack } from "../interfaces/attack";
|
||||
import { IResistance } from "../interfaces/resistance";
|
||||
import { IWeakness } from "../interfaces/weakness";
|
||||
import { ICardImage } from "./image";
|
||||
import { ICardmarket } from "./cardmarket";
|
||||
import { ILegality } from "./legality";
|
||||
import { ISet } from "./set";
|
||||
import { ITCGPlayer } from "./tcgplayer";
|
||||
@ -15,7 +16,7 @@ export interface ICard {
|
||||
subtypes: string[];
|
||||
hp?: string;
|
||||
types?: string[];
|
||||
evolesFrom?: string;
|
||||
evolvesFrom?: string;
|
||||
evolvesTo?: string[];
|
||||
rules?: string[];
|
||||
ancientTrait?: IAncientTrait;
|
||||
@ -32,6 +33,8 @@ export interface ICard {
|
||||
flavorText?: string;
|
||||
nationalPokedexNumbers?: number[];
|
||||
legalities: ILegality;
|
||||
regulationMark?: string;
|
||||
images: ICardImage;
|
||||
tcgplayer?: ITCGPlayer;
|
||||
cardmarket?: ICardmarket;
|
||||
}
|
||||
|
||||
21
src/interfaces/cardmarket.ts
Normal file
21
src/interfaces/cardmarket.ts
Normal file
@ -0,0 +1,21 @@
|
||||
export interface ICardmarket {
|
||||
url: string;
|
||||
updatedAt: string;
|
||||
prices: {
|
||||
averageSellPrice: number | null
|
||||
lowPrice: number | null
|
||||
trendPrice: number | null
|
||||
germanProLow: number | null
|
||||
suggestedPrice: number | null
|
||||
reverseHoloSell: number | null
|
||||
reverseHoloLow: number | null
|
||||
reverseHoloTrend: number | null
|
||||
lowPriceExPlus: number | null
|
||||
avg1: number | null
|
||||
avg7: number | null
|
||||
avg30: number | null
|
||||
reverseHoloAvg1: number | null
|
||||
reverseHoloAvg7: number | null
|
||||
reverseHoloAvg30: number | null
|
||||
}
|
||||
}
|
||||
@ -5,6 +5,8 @@ export interface ITCGPlayer {
|
||||
normal: IPrice | undefined;
|
||||
holofoil: IPrice | undefined;
|
||||
reverseHolofoil: IPrice | undefined;
|
||||
'1stEditionNormal': IPrice | undefined;
|
||||
'1stEditionHolofoil': IPrice | undefined;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@ export * from './classes/meta';
|
||||
export * from './interfaces/ability';
|
||||
export * from './interfaces/attack';
|
||||
export * from './interfaces/card';
|
||||
export * from './interfaces/set';
|
||||
export * from './interfaces/query';
|
||||
export * from './interfaces/resistance';
|
||||
export * from './interfaces/weakness';
|
||||
|
||||
Reference in New Issue
Block a user