Compare commits

...

75 Commits

Author SHA1 Message Date
a32f42975a 2.4.8 2022-12-09 16:11:29 +01:00
0148979d7d misc: Updated deps
Signed-off-by: Avior <f.bouillon@aptatio.com>
2022-12-09 16:11:24 +01:00
ea357c9080 fix: Version number not being correctly exported
Signed-off-by: Avior <f.bouillon@aptatio.com>
2022-12-09 16:08:10 +01:00
5e998d3658 bump: version 2.4.7
Signed-off-by: Avior <github@avior.me>
2022-09-26 19:51:44 +02:00
ed883c06eb fix: Angular not liking JSON imports (#204) 2022-09-26 19:52:27 +02:00
1ecaa048eb Create FUNDING.yml 2022-08-25 10:15:40 +02:00
39cd15ead3 refactor: Upgrade actions (#129) 2022-05-05 14:12:24 +02:00
ca5ae0aa57 refactor: Upgrade dependencies (#128)
* refactor: removed babel

Signed-off-by: Avior <github@avior.me>

* refactor: Upgrade deps

Signed-off-by: Avior <github@avior.me>

* refactor: Removed ts-node

Signed-off-by: Avior <github@avior.me>

* revert: refactor: removed babel

Signed-off-by: Avior <github@avior.me>

* build: Support for other nodejs versions

Signed-off-by: Avior <github@avior.me>
2022-05-05 11:45:42 +02:00
cffae6cc28 build: bump @typescript-eslint/eslint-plugin from 5.12.0 to 5.12.1 (#86)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-23 15:29:09 +01:00
5e03f38476 build: bump @typescript-eslint/eslint-plugin from 5.11.0 to 5.12.0 (#80)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-16 10:21:03 +01:00
05134f5b12 build: bump @babel/core from 7.17.2 to 7.17.4 (#81)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-16 10:06:53 +01:00
8a0dec867e build: bump @typescript-eslint/parser from 5.10.2 to 5.11.0 (#72)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-14 09:55:13 +01:00
75636a9195 build: bump @typescript-eslint/eslint-plugin from 5.10.2 to 5.11.0 (#73)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-14 09:53:13 +01:00
bd33dafe8a build: bump eslint from 8.8.0 to 8.9.0 (#77)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-14 09:51:11 +01:00
39fb14070d build: bump @babel/core from 7.17.0 to 7.17.2 (#76)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-14 09:48:48 +01:00
6ae3b09dc9 build: bump ts-node from 10.4.0 to 10.5.0 (#70)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-14 09:46:45 +01:00
8d13d1dba4 build: bump jest from 27.5.0 to 27.5.1 (#75)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-14 09:44:36 +01:00
840c8c3106 build: bump esbuild from 0.14.19 to 0.14.21 (#74)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-11 15:13:39 +01:00
ee4f1be353 build: bump @babel/preset-env from 7.16.8 to 7.16.11 (#52)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-07 12:05:57 +01:00
7e4c0eae42 build: bump jest from 27.4.7 to 27.5.0 (#68)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-07 10:41:40 +01:00
3d08ab4bfa build: bump esbuild from 0.14.18 to 0.14.19 (#69)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-07 10:16:32 +01:00
3441cc2c60 build: bump @babel/core from 7.16.12 to 7.17.0 (#66)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-03 10:38:38 +01:00
9b2e09d766 build: bump esbuild from 0.14.17 to 0.14.18 (#67)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-03 10:27:09 +01:00
3ebde59a84 build: bump @typescript-eslint/parser from 5.10.0 to 5.10.2 (#64)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-02 10:33:11 +01:00
e18cbabf70 build: bump @typescript-eslint/eslint-plugin from 5.10.0 to 5.10.2 (#63)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-02 10:30:35 +01:00
1c6c7dacc4 build: bump esbuild from 0.14.14 to 0.14.17 (#65)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-02 10:06:54 +01:00
445b3a5ea6 build: bump eslint from 8.7.0 to 8.8.0 (#61)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-31 11:47:54 +01:00
7148fc7522 build: bump typescript from 4.5.4 to 4.5.5 (#54)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-28 17:04:04 +01:00
cde8b24230 build: bump @babel/core from 7.16.7 to 7.16.12 (#55)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-28 16:31:19 +01:00
1d21ff650e build: bump esbuild from 0.14.12 to 0.14.14 (#58)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-28 16:22:44 +01:00
749fba9878 Bump version (2.4.6) 2022-01-28 16:16:38 +01:00
4895c5b857 Updated CHANGELOG for latest releases 2022-01-28 16:15:23 +01:00
eda53611b2 build: bump node-fetch from 2.6.6 to 2.6.7 (#59)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-28 16:08:08 +01:00
76ab92a7db build: bump esbuild from 0.14.11 to 0.14.12 (#53)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-24 00:05:16 +01:00
585d893557 build: bump @typescript-eslint/parser from 5.9.1 to 5.10.0 (#48)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-18 11:04:24 +01:00
157c27222e build: bump @typescript-eslint/eslint-plugin from 5.9.1 to 5.10.0 (#49)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-18 11:02:03 +01:00
026d4018f8 build: bump eslint from 8.6.0 to 8.7.0 (#47)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-17 09:59:56 +01:00
ccfae56ced build: bump @typescript-eslint/parser from 5.9.0 to 5.9.1 (#46)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-11 14:44:31 +01:00
87be749603 build: bump @babel/preset-env from 7.16.7 to 7.16.8 (#45)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-11 12:09:25 +01:00
f56e977900 build: bump @typescript-eslint/eslint-plugin from 5.9.0 to 5.9.1 (#44)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-11 11:58:17 +01:00
e5550e474e build: bump esbuild from 0.14.10 to 0.14.11 (#43)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-10 10:02:29 +01:00
a7c24353a2 build: bump jest from 27.4.6 to 27.4.7 (#42)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-06 14:19:46 +01:00
2e5fdd45e4 build: bump jest from 27.4.5 to 27.4.6 (#41)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-05 10:39:31 +01:00
2ab0df81c1 build: bump @typescript-eslint/eslint-plugin from 5.8.1 to 5.9.0 (#40)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-04 10:03:12 +01:00
5fbfa4d84a build: bump @typescript-eslint/parser from 5.8.1 to 5.9.0 (#39)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-04 09:58:42 +01:00
693160865c build: bump @babel/core from 7.16.5 to 7.16.7 (#38)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-04 09:50:57 +01:00
0e735f3a77 build: bump @babel/preset-env from 7.16.5 to 7.16.7 (#35)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-04 09:44:37 +01:00
b97dfb4420 build: bump @babel/preset-typescript from 7.16.5 to 7.16.7 (#34)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-03 14:29:04 +01:00
c18f933e40 build: bump @typescript-eslint/parser from 5.8.0 to 5.8.1 (#31)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-03 12:34:54 +01:00
fb60710e5e build: bump @typescript-eslint/eslint-plugin from 5.8.0 to 5.8.1 (#30)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-03 11:25:33 +01:00
edf994c241 build: bump eslint from 8.5.0 to 8.6.0 (#37)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-03 11:10:16 +01:00
eb905a866a build: bump actions/setup-node from 2.5.0 to 2.5.1 (#33)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-03 10:48:31 +01:00
5f41185d4f build: bump esbuild from 0.14.8 to 0.14.10 (#36)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-03 09:40:50 +01:00
183efdb51e build: bump esbuild from 0.14.7 to 0.14.8 (#29)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-23 14:21:47 +01:00
dbad45d71d build: bump esbuild from 0.14.6 to 0.14.7 (#28)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-22 13:16:34 +01:00
f733634499 build: bump @typescript-eslint/parser from 5.7.0 to 5.8.0 (#26)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.7.0 to 5.8.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.8.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-21 12:04:33 +01:00
9e636c407e build: bump @typescript-eslint/eslint-plugin from 5.7.0 to 5.8.0 (#27)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-21 09:55:21 +01:00
87531f14ff build: bump esbuild from 0.14.5 to 0.14.6 (#25)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-20 15:27:35 +01:00
52342f9dcf build: bump eslint from 8.4.1 to 8.5.0 (#24)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-20 15:12:55 +01:00
2eb68457f0 build: bump codecov/codecov-action from 1.0.13 to 2.1.0 (#17)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 1.0.13 to 2.1.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v1.0.13...v2.1.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-15 20:24:03 +00:00
14b4aa7138 build: bump actions/setup-node from 1 to 2.5.0 (#18)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 1 to 2.5.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v1...v2.5.0)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-15 18:35:16 +00:00
496c04fc4c Bump deps
Signed-off-by: Avior <github@avior.me>
2021-12-15 16:08:37 +01:00
3d8ef329f7 docs: Update multiple documents (#16) 2021-12-15 12:20:36 +01:00
21088c4a02 Bump version 2021-10-11 17:05:41 +02:00
4fdde0a962 Added new Endpoints (#15) 2021-10-11 16:55:42 +02:00
02a8174509 2.4.4 2021-08-12 21:59:29 +02:00
ac570459a3 Added new logo field to serie
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
2021-08-12 21:59:11 +02:00
093df107d2 Fixed Link 2021-07-19 15:07:41 +02:00
d166e0f5cf Fixed Changelogs
Signed-off-by: Florian BOUILLON <florian.bouillon@delta-wings.net>
2021-07-19 14:47:47 +02:00
ef102dc433 2.4.3 2021-07-19 14:46:12 +02:00
324be2a410 Updated docs
Signed-off-by: Florian BOUILLON <florian.bouillon@delta-wings.net>
2021-07-19 14:45:41 +02:00
ad4ad553a4 New try with ESM
Signed-off-by: Florian BOUILLON <florian.bouillon@delta-wings.net>
2021-07-19 14:44:58 +02:00
7c253c98d7 Moved to ESBuild
Signed-off-by: Florian BOUILLON <florian.bouillon@delta-wings.net>
2021-07-19 14:44:42 +02:00
e172465258 2.4.2 2021-07-11 17:48:56 +02:00
9940961e20 Downgraded to ES2015 to have better support browsers
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
2021-07-11 17:48:42 +02:00
23 changed files with 6283 additions and 6367 deletions

3
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,3 @@
# These are supported funding model platforms
github: [tcgdex]

32
.github/ISSUE_TEMPLATE/bug.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Bug
description: Use this template if you have found a bug in the SDK
title: "bug: "
labels: [bug]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this Form!
- type: textarea
id: happening
attributes:
label: What is Hapening
placeholder: "Ex: When using this function the SDK crash..."
validations:
required: true
- type: textarea
id: happen
attributes:
label: Please explain what should happen
description: If you selected Other or new Data Type please put it as the first line
placeholder: "Ex: The SDK should not crash"
validations:
required: true
- type: textarea
id: reproducre
attributes:
label: Please give us a way to reproduce
description: You can list a way or give us access to a minimal Github repo to reproduce it
placeholder: "Ex: https://github.com/tcgdex/javascript-sdk-error-idk"
validations:
required: true

16
.github/ISSUE_TEMPLATE/enhancement.yml vendored Normal file
View File

@ -0,0 +1,16 @@
name: Enhancement
description: Use this template if you have an Idea that will enhance the SDK
title: "enhancement: "
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this Form!
- type: textarea
id: explain
attributes:
label: Please explain in more details what idea you have
placeholder: "Ex: I would love to see this or this..."
validations:
required: true

5
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,5 @@
<!--
Thanks for your Pull Request, Please provide the related Issue using "Fix #0" or describe the change(s) you made.
The issue title must follow Conventional Commit (verified by Github Actions) conventionalcommits.org.
More informations at https://github.com/tcgdex/cards-database/blob/master/CONTRIBUTING.md
-->

22
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,22 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
versioning-strategy: lockfile-only
commit-message:
prefix: build
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: build

View File

@ -16,14 +16,14 @@ jobs:
strategy:
matrix:
# Follow current releases https://nodejs.org/en/about/releases/
node-version: [12.x, 14.x, 16.x]
node-version: [12.x, 14.x, 16.x, 17.x, 18.x]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
@ -38,7 +38,7 @@ jobs:
- name: Upload Coverage
if: matrix.node-version == '16.x'
uses: codecov/codecov-action@v1.0.13
uses: codecov/codecov-action@v3
with:
# Comma-separated list of files to upload
files: ./coverage/coverage-final.json

View File

@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup NodeJS
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '16.x'

View File

@ -8,12 +8,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup NodeJS
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies

2
.gitignore vendored
View File

@ -5,4 +5,4 @@ coverage
# Dist files
dist
src/version.json
src/version.js

View File

@ -7,6 +7,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## 2.4.6 - 2022-01-28
### Fixed
- Updated node-fetch for CVE-2022-0235
## 2.4.5 - 2021-10-11
### Added
- Added new endpoint
## 2.4.4 - 2021-08-12
### Added
- New logo field in serie
## 2.4.3 - 2021-07-19
### Added
- ESM exports are back
## 2.4.2 2021-07-11
### Fixed
- Downgraded to ES2015 to have better suport browsers
### Changed
- Moved browser export from `Webpack` to `esbuild`
## 2.4.1 - 2021-07-11
## Deprecated
@ -211,8 +245,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Constructor arg support for multiple langs
- TranslationUtil to go from the SDK value to a text value
[Unreleased]: https://github.com/tcgdex/javascript-sdk/compare/v2.3.1...HEAD
[Unreleased]: https://github.com/tcgdex/javascript-sdk/compare/v2.4.3...HEAD
[2.4.3]: https://github.com/tcgdex/javascript-sdk/releases/tag/v2.4.3
[2.4.2]: https://github.com/tcgdex/javascript-sdk/releases/tag/v2.4.2
[2.4.1]: https://github.com/tcgdex/javascript-sdk/releases/tag/v2.4.1
[2.4.0]: https://github.com/tcgdex/javascript-sdk/releases/tag/v2.4.0
[2.3.1]: https://github.com/tcgdex/javascript-sdk/releases/tag/v2.3.1
[2.3.0]: https://github.com/tcgdex/javascript-sdk/releases/tag/v2.3.0

128
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
the `contact@tcgdex.net` email or on Discord to `Avior#3872`.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

191
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,191 @@
<!-- omit in toc -->
# Contributing to TCGdex
First off, thanks for taking the time to contribute! ❤️
All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉
> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
>
> - Star the project
> - Tweet about it
> - Refer this project in your project's readme
> - Mention the project at local meetups and tell your friends/colleagues
<!-- omit in toc -->
## Table of Contents
- [Code of Conduct](#code-of-conduct)
- [I Have a Question](#i-have-a-question)
- [I Want To Contribute](#i-want-to-contribute)
- [Reporting Issues](#reporting-issues)
- [Suggesting Enhancements](#suggesting-enhancements)
- [Your First Code Contribution](#your-first-code-contribution)
- [Improving The Documentation](#improving-the-documentation)
- [Styleguides](#styleguides)
- [Coding Guidlines](#coding-guidelines)
- [Commit Messages](#commit-messages)
- [Join The Project Team](#join-the-project-team)
## Code of Conduct
This project and everyone participating in it is governed by the
[TCGdex Code of Conduct](https://github.com/tcgdex/javascript-sdk/blob/master/CODE_OF_CONDUCT.md).
By participating, you are expected to uphold this code. Please report unacceptable behavior to <contact@tcgdex.net>.
## I Have a Question
> If you want to ask a question, we assume that you have read the available Documentation at <https://www.tcgdex.dev>.
The best way to ask questions is to join our Discord server at <https://discord.gg/NehYTAhsZE>.
You can also ask them on the Github Repository, it is best to search for existing [Issues](https://github.com/tcgdex/javascript-sdk/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in a new issue. It is also advisable to search the internet for answers first.
If you then still feel the need to ask a question and need clarification, we recommend the following:
- Open an [Issue](https://github.com/tcgdex/javascript-sdk/issues/new).
- Provide as much context as you can about what you're running into.
- Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant.
We will then take care of the issue as soon as possible.
<!--
You might want to create a separate issue tag for questions and include it in this description. People should then tag their issues accordingly.
Depending on how large the project is, you may want to outsource the questioning, e.g. to Stack Overflow or Gitter. You may add additional contact and information possibilities:
- IRC
- Slack
- Gitter
- Stack Overflow tag
- Blog
- FAQ
- Roadmap
- E-Mail List
- Forum
-->
## I Want To Contribute
> ### Legal Notice <!-- omit in toc -->
>
> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license.
### Reporting Issues
<!-- omit in toc -->
#### Before Submitting an Issue Report
A good issue report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.
- Determine if your issue is not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](https://www.tcgdex.dev). If you are looking for support, you might want to check [this section](#i-have-a-question)).
- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already an issue report existing for your bug or error in the [bug tracker](https://github.com/tcgdex/javascript-sdk/issues).
- Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue.
- Collect information about the bug:
- Stack trace (Traceback)
- OS, Platform and Version (Windows, Linux, macOS, x86, ARM)
- Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant.
- Possibly your input and the output
- Can you reliably reproduce the issue? And can you also reproduce it with older versions?
<!-- omit in toc -->
#### How Do I Submit a Good Bug Report?
> You must never report security related issues, vulnerabilities or bugs to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to <security@tcgdex.net>.
<!-- You may add a PGP key to allow the messages to be sent encrypted as well. -->
We use GitHub issues to track bugs and errors. If you run into an issue with the project:
- Open an [Issue](https://github.com/tcgdex/javascript-sdk/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.)
- Explain the behavior you would expect and the actual behavior.
- Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case.
- Provide the information you collected in the previous section.
Once it's filed:
- The project team will label the issue accordingly.
- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced.
- If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#your-first-code-contribution).
<!-- You might want to create an issue template for bugs and errors that can be used as a guide and that defines the structure of the information to be included. If you do so, reference it here in the description. -->
### Suggesting Enhancements
This section guides you through submitting an enhancement suggestion for TCGdex, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions.
<!-- omit in toc -->
#### Before Submitting an Enhancement
- Make sure that you are using the latest version.
- Read the [documentation](https://www.tcgdex.dev) carefully and find out if the functionality is already covered, maybe by an individual configuration.
- Perform a [search](https://github.com/tcgdex/javascript-sdk/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library.
<!-- omit in toc -->
#### How Do I Submit a Good Enhancement Suggestion?
Enhancement suggestions are tracked as [GitHub issues](https://github.com/tcgdex/javascript-sdk/issues).
- Use a **clear and descriptive title** for the issue to identify the suggestion.
- Provide a **step-by-step description of the suggested enhancement** in as many details as possible.
- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you.
- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. <!-- this should only be included if the project has a GUI -->
- **Explain why this enhancement would be useful** to most TCGdex users. You may also want to point out the other projects that solved it better and which could serve as inspiration.
<!-- You might want to create an issue template for enhancement suggestions that can be used as a guide and that defines the structure of the information to be included. If you do so, reference it here in the description. -->
### Your First Code Contribution
_note: Follow the different styleguides listed below when contributing_
- Fork 🍴 the project. _see the `fork` button at the top right of the screen_
- make the changes you want in your repository.
- Create a Pull request here https://github.com/tcgdex/javascript-sdk/compare by selecting your repository patch with our `master` branch _If it's not finished put WIP: before_
- we don't like ❌, so if your pull request has its automated checks ending with the red cross, please double check your changes until it show the awesome 🟢, or ask for help !
- If your pull request is ready for review remove WIP: put it s ready for review and we will handle the rest !
### Improving The Documentation
The documentation is updated in the Documentation repository at <https://github.com/tcgdex/documentation>
## Styleguides
### Coding Guidelines
Install the plugin `.editorconfig` in your dev environment if it's not already done and thats it !
for those who don't want to install it the basic are these:
- Respect PSR12
### Commit Messages
We follow the [Conventional Commit specification](conventionalcommits.org) and are using the [Angular format](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit) with some changes.
In short, please name your Pull Requests/Commits following this format
```
<type>(<scope>): <short summary>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```
- `type` MUST be one of
- build: Changes affecting the CI at `.github/workflows` or `Dockerfile`
- ci: same as build
- docs: Changes affecting the differents Documents
- feat: a new feature being added
- fix: fixes
- pref: Performance related fixes
- refactor: Misc code changes
- test: same as `ci`
- the field `(<scope>)` is optional
- `short summary` MUST follow thoses rules
- Capitalize the first letter
- use the imperative, present tense: "Change" not "Changed" nor "Changes"
- `<footer>` and `<body>` are both optional
## Attribution
This guide is based on [Contribution Gen]((https://github.com/bttger/contributing-gen)) and was adapted by the TCGdex community !

205
README.md
View File

@ -1,72 +1,133 @@
<p align="center">
<a href="http://npmjs.com/@tcgdex/sdk">
<img src="https://img.shields.io/npm/v/@tcgdex/sdk?style=flat-square" alt="NOM Version">
</a>
<a href="http://npmjs.com/@tcgdex/sdk">
<img src="https://img.shields.io/npm/dw/@tcgdex/sdk?style=flat-square" alt="NPM Downloads">
</a>
<a href="https://app.codecov.io/gh/tcgdex/javascript-sdk/">
<img src="https://img.shields.io/codecov/c/github/tcgdex/javascript-sdk?style=flat-square&token=FR4BI94N4Q" alt="npm version">
</a>
<a href="https://github.com/tcgdex/javascript-sdk/blob/master/LICENSE.md">
<img src="https://img.shields.io/github/license/tcgdex/javascript-sdk?style=flat-square" alt="the TCGdex JAvascript SDK is released under the MIT license." />
</a>
<a href="https://github.com/tcgdex/javascript-sdk/blob/master/LICENSE.md">
<img src="https://img.shields.io/github/workflow/status/tcgdex/javascript-sdk/Build%20&%20Test?style=flat-square" alt="the TCGdex JAvascript SDK is released under the MIT license." />
</a>
<a href="https://discord.gg/NehYTAhsZE">
<img src="https://img.shields.io/discord/857231041261076491?color=%235865F2&label=Discord&style=flat-square" alt="Discord Link">
</a>
</p>
# TCGdex JavaScript/TypeScript SDK
Communicate with the Open Source TCGdex API in Javascript/Typescript using the SDK
Full API/SDK documentation in progress at https://www.tcgdex.net/docs
## Getting Started
Install the SDK using:
```bash
yarn add @tcgdex/sdk
# or
npm install @tcgdex/sdk
```
## Usage
_Note: a complete documentation is in progress_
```javascript
import TCGdex from '@tcgdex/sdk'
// initialize the SDK
const tcgdex = new TCGdex('en') // Lang code (Optionnal) (See interfaces.ts line 1 for supported languages)
// if you need to change the language
tcgdex.lang = 'fr'
// get a Card using its global ID
await tcgdex.fetch('cards', 'base1-1')
// fetch a Card using it's local id and set name/ID
await tcgdex.fetch('sets', 'Base Set', 1)
// fetch a Set's informations using the set's name/ID
await tcgdex.fetch('sets', 'Sword & Shield')
// Fetch a serie using the serie's name/ID
await tcgdex.fetch('series', 'Black & White')
// Fetch cards using other endpoints
/**
* categories => the the different cards categories
* hp => fetch the different cards possible HPs
* illustrators => fetch all the cards illustrators
* rarities => fetch the cards rarities
* retreats => fetch the cards using the retreat count
* types => fetch the cards using the Pokémon type(s)
**/
await tcgdex.fetch('categories')
```
<p align="center">
<a href="https://www.tcgdex.net">
<img src="https://www.tcgdex.net/assets/og.png" width="90%" alt="TCGdex Main Image">
</a>
</p>
<p align="center">
<a href="http://npmjs.com/@tcgdex/sdk">
<img src="https://img.shields.io/npm/v/@tcgdex/sdk?style=flat-square" alt="NOM Version">
</a>
<a href="http://npmjs.com/@tcgdex/sdk">
<img src="https://img.shields.io/npm/dm/@tcgdex/sdk?style=flat-square" alt="NPM Downloads">
</a>
<a href="https://app.codecov.io/gh/tcgdex/javascript-sdk/">
<img src="https://img.shields.io/codecov/c/github/tcgdex/javascript-sdk?style=flat-square&token=FR4BI94N4Q" alt="npm version">
</a>
<a href="https://github.com/tcgdex/javascript-sdk/stargazers">
<img src="https://img.shields.io/github/stars/tcgdex/javascript-sdk?style=flat-square" alt="Github stars">
</a>
<a href="https://github.com/tcgdex/javascript-sdk/actions/workflows/build.yml">
<img src="https://img.shields.io/github/workflow/status/tcgdex/javascript-sdk/Build%20&%20Test?style=flat-square" alt="the TCGdex JAvascript SDK is released under the MIT license." />
</a>
<a href="https://discord.gg/NehYTAhsZE">
<img src="https://img.shields.io/discord/857231041261076491?color=%235865F2&label=Discord&style=flat-square" alt="Discord Link">
</a>
</p>
# TCGdex JavaScript/TypeScript SDK
The Javascript/Typescript SDK provides a convenient access with the Open Source TCGdex API.
The SDK is available in ESM and CommonJS and should be automaticly chosen.
## Documentation
_The full API/SDK documentation in progress at [API Documentation - TCGdex](https://www.tcgdex.dev)_
### Getting Started
#### How To install
**In the browser**
To use the SDK in the browser, simply add the following script tag to your
HTML pages:
```html
<script src="https://cdn.jsdelivr.net/npm/@tcgdex/sdk@2/dist/tcgdex.browser.js"></script>
```
You cna also download the script from [JSDelivr](https://cdn.jsdelivr.net/npm/@tcgdex/sdk@2/dist/tcgdex.browser.js) by right clicking the link and selecting save link as.
**In Node.js**
Simply type the following into a terminal window:
```bash
npm install @tcgdex/sdk
```
#### Usage
_Note: a complete documentation is available at [TCGdex.dev](https://www.tcgdex.dev)_
**Example: Fetch a Card**
```typescript
// Import the SDK in Typescript
import TCGdex from '@tcgdex/sdk';
// Instantiate the SDK
// note: you can use one of the following lanugages
const tcgdex = new TCGdex('en');
// Card will be Furret from the Darkness Ablaze Set
const card = await tcgdex.fetch('cards', 'swsh3-136');
// You can also get the same result using
const card = await tcgdex.fetch('sets', 'Darkness Ablaze', 136);
```
**Other Examples**
```javascript
// fetch a Set's informations using the set's name or ID
await tcgdex.fetch('sets', 'Darkness Ablaze')
// Fetch a serie using the serie's name or ID
await tcgdex.fetch('series', 'Sword & Shield')
// Fetch cards possible pokemon cards HP
await tcgdex.fetch('hp');
// Fetch Cards with the specific number of HP
await tcgdex.fetch('hp', 110);
// Fetch cards possible illustrators
await tcgdex.fetch('illustrators');
// Fetch Cards with the specific illustrator
await tcgdex.fetch('illustrators', 'tetsuya koizumi');
```
**Other Endpoints**
_They work like the two (`hp` and `illustrators`) abose_
- categories: the the different cards categories
- energy-types: Fetch different types of energies
- hp: fetch the different cards possible HPs
- illustrators: fetch all the cards illustrators
- rarities: fetch the cards rarities
- retreats: fetch the cards using the retreat count
- stages: fetch differents cards stages
- suffixes: fetch differents cards suffixes
- trainer-types: fetch trainer cards types
- dex-ids: fetch pokemon Global Pokédex IDS
- types: fetch the cards using the Pokémon type(s)
## Contributing
See [CONTRIBUTING.md](https://github.com/tcgdex/javascript-sdk/blob/master/CONTRIBUTING.md)
TL::DR
- Fork
- Commit your changes
- Pull Request on this Repository
## License
This project is licensed under the IT License. A copy of the license is available at [LICENSE.md](https://github.com/tcgdex/javascript-sdk/blob/master/LICENSE.md)

11807
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,60 +1,61 @@
{
"name": "@tcgdex/sdk",
"version": "2.4.1",
"main": "./dist/cjs/tcgdex.node.js",
"types": "./dist/types/tcgdex.d.ts",
"description": "Communicate with the Open Source TCGdex API in Javascript/Typescript using the SDK",
"repository": "https://github.com/tcgdex/javascript-sdk.git",
"homepage": "https://github.com/tcgdex/javascript-sdk",
"author": "Aviortheking",
"keywords": [
"tcgdex",
"pokemon",
"trading",
"card",
"tcg",
"sdk",
"api",
"typescript",
"javascript",
"typing"
],
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.14.6",
"@babel/preset-env": "^7.14.7",
"@babel/preset-typescript": "^7.14.5",
"@dzeio/config": "^1.0.0",
"@types/node-fetch": "^2.5.10",
"@typescript-eslint/eslint-plugin": "^4.28.0",
"@typescript-eslint/parser": "^4.28.0",
"eslint": "^7.29.0",
"jest": "^27.0.5",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"typescript": "^4.1.3",
"webpack": "^5.40.0",
"webpack-nano": "^1.1.1"
},
"engines": {
"node": ">=12"
},
"dependencies": {
"isomorphic-unfetch": "^3.1.0",
"unfetch": "^4.2.0"
},
"scripts": {
"prebuild": "node scripts/export-version-number.js",
"build": "npm run prebuild && npm run build:cjs && npm run build:browser && npm run build:es2015",
"build:cjs": "tsc --project tsconfig.json",
"build:es2015": "tsc --project tsconfig.es2015.json",
"build:browser": "wp --config webpack.config.js",
"prepublishOnly": "npm run build",
"lint": "eslint",
"test": "jest --coverage"
},
"files": [
"dist"
],
"sideEffects": false
}
{
"name": "@tcgdex/sdk",
"version": "2.4.8",
"main": "./dist/cjs/tcgdex.node.js",
"module": "./dist/modules/tcgdex.node.js",
"types": "./dist/types/tcgdex.d.ts",
"description": "Communicate with the Open Source TCGdex API in Javascript/Typescript using the SDK",
"repository": "https://github.com/tcgdex/javascript-sdk.git",
"homepage": "https://github.com/tcgdex/javascript-sdk",
"author": "Aviortheking",
"keywords": [
"tcgdex",
"pokemon",
"trading",
"card",
"tcg",
"sdk",
"api",
"typescript",
"javascript",
"typing"
],
"license": "MIT",
"devDependencies": {
"@babel/core": "^7",
"@babel/preset-env": "^7",
"@babel/preset-typescript": "^7",
"@dzeio/config": "^1",
"@types/node-fetch": "^2",
"@typescript-eslint/eslint-plugin": "^5",
"@typescript-eslint/parser": "^5",
"esbuild": "^0.16.3",
"eslint": "^8",
"jest": "^29",
"typescript": "^4"
},
"engines": {
"node": ">=12"
},
"dependencies": {
"isomorphic-unfetch": "^3",
"unfetch": "^4"
},
"scripts": {
"prebuild": "node scripts/export-version-number.js",
"build": "npm run build:cjs && npm run build:browser && npm run build:es2015",
"build:cjs": "tsc --project tsconfig.json",
"build:es2015": "tsc --project tsconfig.es2015.json",
"build:browser": "esbuild ./src/tcgdex.browser.ts --bundle --minify --sourcemap --target=es2016,chrome90,firefox78,safari14,ios13,edge90 --outfile=dist/tcgdex.browser.js",
"prepublishOnly": "npm run build",
"lint": "eslint",
"test": "jest --coverage"
},
"files": [
"dist"
],
"sideEffects": false,
"jest": {
"testTimeout": 30000
}
}

View File

@ -1,4 +1,4 @@
const { version } = require('../package.json')
const fs = require('fs')
fs.writeFileSync('./src/version.json', JSON.stringify({version}))
fs.writeFileSync('./src/version.js', `export const version = '${version}'`)

View File

@ -1,5 +1,5 @@
import TCGdex from './tcgdex'
import { version } from './version.json'
import { version } from './version'
export default class Request {

View File

@ -8,6 +8,7 @@ export type Languages<T = string> = Partial<Record<SupportedLanguages, T>>
export interface SerieResume {
id: string
name: string
logo?: string
}
export interface Serie extends SerieResume {

View File

@ -3,4 +3,4 @@ import unfetch from 'unfetch'
TCGdex.fetch = window.fetch ?? unfetch as any
module.exports = TCGdex
(global ?? window).TCGdex = TCGdex

View File

@ -1,8 +1,8 @@
import RequestWrapper from './Request'
import { Serie, Set, Card, CardResume, SerieList, SetList, SupportedLanguages, StringEndpoint } from './interfaces'
type Endpoint = 'cards' | 'categories' | 'hp' | 'illustrators' | 'rarities' | 'retreats' | 'series' | 'sets' | 'types'
type Endpoint = 'cards' | 'categories' | 'dex-ids' | 'energy-types' | 'hp' | 'illustrators' | 'rarities' | 'regulation-marks' | 'retreats' | 'series' | 'sets' | 'stages' | 'suffixes' | 'trainer-types' | 'types' | 'variants'
const ENDPOINTS: Array<Endpoint> = ['cards', 'categories', 'hp', 'illustrators', 'rarities', 'retreats', 'series', 'sets', 'types']
const ENDPOINTS: Array<Endpoint> = ['cards', 'categories', 'dex-ids', 'energy-types', 'hp', 'illustrators', 'rarities', 'regulation-marks', 'retreats', 'series', 'sets', 'stages', 'suffixes', 'trainer-types', 'types', 'variants']
const BASE_URL = 'https://api.tcgdex.net/v2'
export default class TCGdex {
@ -127,19 +127,19 @@ export default class TCGdex {
/**
* Fetch cards depending on a specific filter
* @param endpoint_0 {'categories' | 'hp' | 'illustrators' | 'rarities' | 'retreats' | 'types'}
* Possible value 'categories' | 'hp' | 'illustrators' | 'rarities' | 'retreats' | 'types'
* @param endpoint_0 {'categories' | 'dex-ids' | 'energy-types' | 'hp' | 'illustrators' | 'rarities' | 'regulation-marks' | 'retreats' | 'stages' | 'suffixes' | 'trainer-types' | 'types' | 'variants'}
* Possible value 'categories' | 'dex-ids' | 'energy-types' | 'hp' | 'illustrators' | 'rarities' | 'regulation-marks' | 'retreats' | 'stages' | 'suffixes' | 'trainer-types' | 'types' | 'variants'
* @param endpoint_1 {string} the value set while fetching the index
*/
public async fetch(...endpoint: ['categories' | 'hp' | 'illustrators' | 'rarities' | 'retreats' | 'types', string]): Promise<StringEndpoint | undefined>
public async fetch(...endpoint: ['categories' | 'dex-ids' | 'energy-types' | 'hp' | 'illustrators' | 'rarities' | 'regulation-marks' | 'retreats' | 'stages' | 'suffixes' | 'trainer-types' | 'types' | 'variants', string]): Promise<StringEndpoint | undefined>
/**
* Fetch cards depending on a specific filter
* @param endpoint_0 {'hp' | 'retreats' | 'categories' | 'illustrators' | 'rarities' | 'types'}
* Possible value 'hp' | 'retreats' | 'categories' | 'illustrators' | 'rarities' | 'types'
* @param endpoint_0 {'categories' | 'dex-ids' | 'energy-types' | 'hp' | 'illustrators' | 'rarities' | 'regulation-marks' | 'retreats' | 'stages' | 'suffixes' | 'trainer-types' | 'types' | 'variants'}
* Possible value 'categories' | 'dex-ids' | 'energy-types' | 'hp' | 'illustrators' | 'rarities' | 'regulation-marks' | 'retreats' | 'stages' | 'suffixes' | 'trainer-types' | 'types' | 'variants'
* @param endpoint_1 {string} Fetch the possible values to use depending on the endpoint
*/
public async fetch(endpoint: 'hp' | 'retreats' | 'categories' | 'illustrators' | 'rarities' | 'types'): Promise<Array<string> | undefined>
public async fetch(endpoint: 'categories' | 'dex-ids' | 'energy-types' | 'hp' | 'illustrators' | 'rarities' | 'regulation-marks' | 'retreats' | 'stages' | 'suffixes' | 'trainer-types' | 'types' | 'variants'): Promise<Array<string> | undefined>
/**
* Fetch The differents endpoints depending on the first argument

View File

@ -2,7 +2,7 @@
"extends": "./tsconfig.json",
"include": ["./src/tcgdex.node.ts"],
"compilerOptions": {
"target": "ES2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"target": "ES2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "ES2015", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"declaration": false, /* Generates corresponding '.d.ts' file. */
"declarationDir": null,

View File

@ -3,6 +3,8 @@
"include": ["./src/tcgdex.node.ts"],
"compilerOptions": {
"target": "ES2015",
"declaration": true,
"declarationDir": "./dist/types",

View File

@ -1,34 +0,0 @@
const path = require('path')
module.exports = {
mode: 'production',
entry: './src/tcgdex.browser.ts',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'tcgdex.browser.js',
libraryTarget: 'umd',
library: 'TCGdex',
umdNamedDefine: true
},
resolve: {
extensions: ['.ts']
},
optimization: {
minimize: true
},
module: {
rules: [{
test: /\.ts$/,
loader: 'ts-loader',
exclude: /node_modules/,
options: {
compilerOptions: {
sourceMap: false,
declaration: false,
declarationDir: null,
target: 'ES2016'
}
}
}]
}
}