Skip to content

Commit

Permalink
Merge pull request #53 from falsepopsky/dev
Browse files Browse the repository at this point in the history
feat: support `/seasons/*` endpoints
  • Loading branch information
falsepopsky authored Nov 6, 2023
2 parents f6dbc39 + 0262586 commit cd5940b
Show file tree
Hide file tree
Showing 10 changed files with 396 additions and 202 deletions.
5 changes: 5 additions & 0 deletions .changeset/odd-planets-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@untidy/thetvdb': minor
---

feat: support `/seasons` endpoint
5 changes: 5 additions & 0 deletions .changeset/red-buckets-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@untidy/thetvdb': minor
---

feat: support `/seasons/types` and `/seasons/:id/translations/:language` endpoints
2 changes: 1 addition & 1 deletion docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default defineConfig({
nav: [
{ text: 'Guide', link: '/guide/getting-started' },
{
text: '0.4.0',
text: '0.5.0',
items: [
{
text: 'Changelog',
Expand Down
57 changes: 57 additions & 0 deletions docs/api/thetvdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,63 @@ await client.getSeason({ id: '6365', extended: true });
await client.getSeason({ id: '6365', extended: true, meta: true });
```

## getSeasonByLanguage

Returns a translated season record

| params | type | Required | Description |
| -------- | -------- | :------: | ---------------------- |
| id | `string` | Yes | The season `id`. |
| language | `string` | Yes | The season `language`. |

### Supports the following endpoints <Badge type="warning" text="endpoint" />

- <Badge type="tip" text="GET" /> `/seasons/:id/translations/:language`

### Get a translated season record <Badge type="tip" text="example" />

```js
await client.getSeasonByLanguage('6365', 'rus');
```

## getSeasonTypes

This method returns a list of season types records and does not require any parameters.

### Supports the following endpoints <Badge type="warning" text="endpoint" />

- <Badge type="tip" text="GET" /> `/seasons/types`

### List of season types records <Badge type="tip" text="example" />

```js
await client.getSeasonTypes();
```

## getSeasonsByPage

Returns a list of seasons records

| params | type | Required | Description |
| ------ | -------- | :------: | -------------------------------- |
| page | `string` | Optional | Get seasons for a specific page. |

### Supports the following endpoints <Badge type="warning" text="endpoint" />

- <Badge type="tip" text="GET" /> `/seasons`

### Get seasons <Badge type="tip" text="example" />

```js
await client.getSeasonsByPage();
```

### Get seasons from a specific page <Badge type="tip" text="example" />

```js
await client.getSeasonsByPage('7');
```

## getSerie

Returns a serie base or extended record
Expand Down
21 changes: 11 additions & 10 deletions docs/guide/supported-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,22 @@ List of endpoints from [TheTVDB API V4](https://thetvdb.github.io/v4-api/).
| `/people/types` | :interrobang: |
| `/search` | :white_check_mark: |
| `/search/remoteid/{remoteId}` | :interrobang: |
| `/seasons` | :interrobang: |
| `/seasons` | :white_check_mark: |
| `/seasons/{id}` | :white_check_mark: |
| `/seasons/{id}/extended` | :white_check_mark: |
| `/seasons/types` | :interrobang: |
| `/seasons/{id}/translations/{language}` | :interrobang: |
| `/series` | :interrobang: |
| `/seasons/types` | :white_check_mark: |
| `/seasons/{id}/translations/{language}` | :white_check_mark: |
| `/series` | :soon: |
| `/series/{id}` | :white_check_mark: |
| `/series/{id}/artworks` | :interrobang: |
| `/series/{id}/nextAired` | :interrobang: |
| `/series/{id}/artworks` | :soon: |
| `/series/{id}/nextAired` | :soon: |
| `/series/{id}/extended` | :white_check_mark: |
| `/series/{id}/episodes/{season-type}` | :interrobang: |
| `/series/{id}/episodes/{season-type}/{lang}` | :interrobang: |
| `/series/{id}/episodes/{season-type}` | :soon: |
| `/series/{id}/episodes/{season-type}/{lang}` | :soon: |
| `/series/filter` | :white_check_mark: |
| `/series/slug/{slug}` | :interrobang: |
| `/series/{id}/translations/{language}` | :interrobang: |
| `/series/slug/{slug}` | :soon: |
| `/series/{id}/translations/{language}` | :soon: |
| `/series/statuses` | :soon: |
| `/sources/types` | :interrobang: |
| `/updates` | :white_check_mark: |
| `/user` | :no_entry_sign: |
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
},
"devDependencies": {
"@changesets/cli": "^2.26.2",
"@swc/core": "^1.3.95",
"@swc/core": "^1.3.96",
"@swc/jest": "^0.2.29",
"@types/jest": "^29.5.7",
"@types/node": "^20.8.10",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"dotenv": "^16.3.1",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
Expand All @@ -54,11 +54,11 @@
"eslint-plugin-n": "^16.2.0",
"eslint-plugin-promise": "^6.1.1",
"jest": "^29.7.0",
"msw": "^2.0.2",
"msw": "^2.0.3",
"prettier": "^3.0.3",
"tsx": "^3.14.0",
"typescript": "^5.2.2",
"vitepress": "1.0.0-rc.24"
"vitepress": "1.0.0-rc.25"
},
"engines": {
"node": "^18.16.1 || ^20.0.0",
Expand Down
Loading

0 comments on commit cd5940b

Please sign in to comment.