Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add /lists/* & /series/* APIs #57

Merged
merged 4 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- main

env:
PNPM_VERSION: 8.10.3
PNPM_VERSION: 8.10.4

jobs:
lint:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- main

env:
PNPM_VERSION: 8.10.3
PNPM_VERSION: 8.10.4

jobs:
lint:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup pnpm
uses: pnpm/action-setup@v2.4.0
with:
version: 8.10.3
version: 8.10.4

- name: Setup Node
uses: actions/setup-node@v4.0.0
Expand Down
232 changes: 232 additions & 0 deletions docs/api/thetvdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,103 @@ await client.getEpisodesByPage();
await client.getEpisodesByPage('11890');
```

## getLists

Returns a list of lists records

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

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

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

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

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

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

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

## getListById

Returns a single list record

| params | type | Required | Description |
| ------ | -------- | :------: | --------------------- |
| id | `string` | Yes | The `id` of the list. |

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

- <Badge type="tip" text="GET" /> `/lists/:id`

### Single record <Badge type="tip" text="example" />

```js
await client.getListById('1');
```

## getListByIdExtended

Returns a single list extended record

| params | type | Required | Description |
| ------ | -------- | :------: | --------------------- |
| id | `string` | Yes | The `id` of the list. |

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

- <Badge type="tip" text="GET" /> `/lists/:id/extended`

### Single record <Badge type="tip" text="example" />

```js
await client.getListByIdExtended('1');
```

## getListByLanguage

Returns a single list with translation record

| params | type | Required | Description |
| -------- | -------- | :------: | --------------------------- |
| id | `string` | Yes | The `id` of the list. |
| language | `string` | Yes | The `language` of the list. |

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

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

### Single record <Badge type="tip" text="example" />

```js
await client.getListByLanguage('17', 'spa');
```

## getListBySlug

Returns a single list record by slug

| params | type | Required | Description |
| ------ | -------- | :------: | ----------------------- |
| slug | `string` | Yes | The `slug` of the list. |

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

- <Badge type="tip" text="GET" /> `/lists/slug/:slug`

### Single record <Badge type="tip" text="example" />

```js
await client.getListBySlug('1001');
```

## getMovie

Returns a movie base or extended record
Expand Down Expand Up @@ -782,3 +879,138 @@ await client.getSeriesByPage();
```js
await client.getSeriesByPage('7');
```

## getSerieArtworks

Returns a serie record with artworks

| params | type | Required | Description |
| -------- | -------- | :------: | ---------------------------- |
| id | `string` | Yes | The `id` of the serie. |
| language | `string` | Yes | The `language` of the serie. |
| type | `string` | Yes | The type of artwork. |

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

- <Badge type="tip" text="GET" /> `/series/:id/artworks`

### Single record <Badge type="tip" text="example" />

```js
await client.getSerieArtworks('78878', 'jpn', '3');
```

## getSerieBySlug

Returns a single serie record by slug

| params | type | Required | Description |
| ------ | -------- | :------: | ------------------------ |
| slug | `string` | Yes | The `slug` of the serie. |

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

- <Badge type="tip" text="GET" /> `/series/slug/:slug`

### Single record <Badge type="tip" text="example" />

```js
await client.getSerieBySlug('flcl');
```

## getSerieByLanguage

Returns a single serie translation record

| params | type | Required | Description |
| -------- | -------- | :------: | ---------------------------- |
| id | `string` | Yes | The `id` of the serie. |
| language | `string` | Yes | The `language` of the serie. |

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

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

### Single record <Badge type="tip" text="example" />

```js
await client.getSerieByLanguage('78878', 'eng');
```

## getSerieEpisodes

Returns a serie episodes from the specified season type.

| params | type | Required | Description |
| --------------------- | -------- | :------: | --------------------------------------------------------- |
| options | `object` | Yes | An object containing the parameters for the query. |
| options.id | `string` | Yes | The serie `id`. |
| options.type | `string` | Yes | The serie `type`. |
| options.airDate | `string` | Optional | The `airDate` of the episode (yyyy-mm-dd). |
| options.episodeNumber | `string` | Optional | Restrict results to a specific episode (requires season). |
| options.page | `string` | Optional | Restrict results to a specific page. |
| options.season | `string` | Optional | Restrict results to a specific season. |

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

- <Badge type="tip" text="GET" /> `/series/:id/episodes/:season-type`

### Single record <Badge type="tip" text="example" />

```js
await client.getSerieEpisodes({ id: '75978', type: 'default', airDate: '2006-05-21' });
```

## getSerieEpisodesWithLanguage

Returns a serie record with episodes from the specified season type and language.

| params | type | Required | Description |
| ---------------- | -------- | :------: | -------------------------------------------------- |
| options | `object` | Yes | An object containing the parameters for the query. |
| options.id | `string` | Yes | The serie `id`. |
| options.type | `string` | Yes | The serie `type`. |
| options.language | `string` | Yes | The serie `language`. |
| options.page | `string` | Optional | Restrict results to a specific page. |

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

- <Badge type="tip" text="GET" /> `/series/:id/episodes/:season-type/:language`

### Single record <Badge type="tip" text="example" />

```js
await client.getSerieEpisodesWithLanguage({ id: '78878', type: 'official', language: 'eng' });
```

## getSerieNextAired

Returns a single serie record including the nextAired field.

| params | type | Required | Description |
| ------ | -------- | :------: | ---------------------- |
| id | `string` | Yes | The `id` of the serie. |

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

- <Badge type="tip" text="GET" /> `/series/:id/nextAired`

### Single record <Badge type="tip" text="example" />

```js
await client.getSerieNextAired('78878');
```

## getSerieStatus

Returns a list of series status and does not require any parameters.

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

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

### Single record <Badge type="tip" text="example" />

```js
await client.getSerieStatus();
```
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"@swc/jest": "^0.2.29",
"@types/jest": "^29.5.8",
"@types/node": "^20.9.0",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"dotenv": "^16.3.1",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
Expand All @@ -55,7 +55,7 @@
"eslint-plugin-promise": "^6.1.1",
"jest": "^29.7.0",
"msw": "^2.0.6",
"prettier": "^3.0.3",
"prettier": "^3.1.0",
"tsx": "^4.1.1",
"typescript": "^5.2.2",
"vitepress": "1.0.0-rc.25"
Expand All @@ -71,5 +71,5 @@
"bugs": {
"url": "https://github.com/falsepopsky/thetvdb/issues"
},
"packageManager": "pnpm@8.10.3"
"packageManager": "pnpm@8.10.4"
}
Loading