Skip to content

Commit

Permalink
chore(release): 0.4.0 [skip ci]
Browse files Browse the repository at this point in the history
# [0.4.0](v0.3.0...v0.4.0) (2025-01-19)

### Bug Fixes

* Add missing error class and type exports ([6d828ca](6d828ca))
* Update copyright year in LICENSE file ([3ce85d1](3ce85d1))

### Features

* **PlaylistManager:** Support `playlists.update` endpoint ([8d67df9](8d67df9))
  • Loading branch information
semantic-release-bot committed Jan 19, 2025
1 parent 4351cb7 commit e2d0893
Show file tree
Hide file tree
Showing 31 changed files with 727 additions and 20 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# [0.4.0](https://github.com/suzuki3jp/youtubes.js/compare/v0.3.0...v0.4.0) (2025-01-19)


### Bug Fixes

* Add missing error class and type exports ([6d828ca](https://github.com/suzuki3jp/youtubes.js/commit/6d828ca5734bae7ff1947045924c596b54ba5e11))
* Update copyright year in LICENSE file ([3ce85d1](https://github.com/suzuki3jp/youtubes.js/commit/3ce85d12af4ea99ec5cd9b9e7b86d379c6d5e3de))


### Features

* **PlaylistManager:** Support `playlists.update` endpoint ([8d67df9](https://github.com/suzuki3jp/youtubes.js/commit/8d67df97253760e6bfec9b99e6766fe22cfbd994))

# [0.3.0](https://github.com/suzuki3jp/youtubes.js/compare/v0.2.0...v0.3.0) (2025-01-19)


Expand Down
47 changes: 47 additions & 0 deletions docs/api/youtubes.js.likelybugerror._constructor_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [youtubes.js](./youtubes.js.md) &gt; [LikelyBugError](./youtubes.js.likelybugerror.md) &gt; [(constructor)](./youtubes.js.likelybugerror._constructor_.md)

## LikelyBugError.(constructor)

Constructs a new instance of the `LikelyBugError` class

**Signature:**

```typescript
constructor(message: string);
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

message


</td><td>

string


</td><td>


</td></tr>
</tbody></table>
157 changes: 157 additions & 0 deletions docs/api/youtubes.js.likelybugerror.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [youtubes.js](./youtubes.js.md) &gt; [LikelyBugError](./youtubes.js.likelybugerror.md)

## LikelyBugError class

Represents an error that is likely a bug in the library.

If you encounter this error, please report the issue on \[GitHub Issue\](https://github.com/suzuki3jp/youtubes.js/issues/new).

**Signature:**

```typescript
export declare class LikelyBugError implements BaseError
```
**Implements:** BaseError
## Constructors
<table><thead><tr><th>
Constructor
</th><th>
Modifiers
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
[(constructor)(message)](./youtubes.js.likelybugerror._constructor_.md)
</td><td>
</td><td>
Constructs a new instance of the `LikelyBugError` class
</td></tr>
</tbody></table>
## Properties
<table><thead><tr><th>
Property
</th><th>
Modifiers
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
[message](./youtubes.js.likelybugerror.message.md)
</td><td>
</td><td>
string
</td><td>
</td></tr>
<tr><td>
[type](./youtubes.js.likelybugerror.type.md)
</td><td>
</td><td>
string
</td><td>
</td></tr>
</tbody></table>
## Methods
<table><thead><tr><th>
Method
</th><th>
Modifiers
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
[throw()](./youtubes.js.likelybugerror.throw.md)
</td><td>
</td><td>
Throws the error.
</td></tr>
<tr><td>
[toError()](./youtubes.js.likelybugerror.toerror.md)
</td><td>
</td><td>
Converts the error to an `Error` object.
</td></tr>
</tbody></table>
11 changes: 11 additions & 0 deletions docs/api/youtubes.js.likelybugerror.message.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [youtubes.js](./youtubes.js.md) &gt; [LikelyBugError](./youtubes.js.likelybugerror.md) &gt; [message](./youtubes.js.likelybugerror.message.md)

## LikelyBugError.message property

**Signature:**

```typescript
message: string;
```
17 changes: 17 additions & 0 deletions docs/api/youtubes.js.likelybugerror.throw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [youtubes.js](./youtubes.js.md) &gt; [LikelyBugError](./youtubes.js.likelybugerror.md) &gt; [throw](./youtubes.js.likelybugerror.throw.md)

## LikelyBugError.throw() method

Throws the error.

**Signature:**

```typescript
throw(): never;
```
**Returns:**
never
18 changes: 18 additions & 0 deletions docs/api/youtubes.js.likelybugerror.toerror.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [youtubes.js](./youtubes.js.md) &gt; [LikelyBugError](./youtubes.js.likelybugerror.md) &gt; [toError](./youtubes.js.likelybugerror.toerror.md)

## LikelyBugError.toError() method

Converts the error to an `Error` object.

**Signature:**

```typescript
toError(): Error;
```
**Returns:**

Error


11 changes: 11 additions & 0 deletions docs/api/youtubes.js.likelybugerror.type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [youtubes.js](./youtubes.js.md) &gt; [LikelyBugError](./youtubes.js.likelybugerror.md) &gt; [type](./youtubes.js.likelybugerror.type.md)

## LikelyBugError.type property

**Signature:**

```typescript
type: string;
```
35 changes: 35 additions & 0 deletions docs/api/youtubes.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ Description
The main class for interacting with the YouTube Data API.


</td></tr>
<tr><td>

[LikelyBugError](./youtubes.js.likelybugerror.md)


</td><td>

Represents an error that is likely a bug in the library.

If you encounter this error, please report the issue on \[GitHub Issue\](https://github.com/suzuki3jp/youtubes.js/issues/new).


</td></tr>
<tr><td>

Expand Down Expand Up @@ -88,6 +101,19 @@ Presents the thumbnails of the video or the playlist.
\[YouTube Data API Reference\](https://developers.google.com/youtube/v3/docs/thumbnails)


</td></tr>
<tr><td>

[YouTubeApiError](./youtubes.js.youtubeapierror.md)


</td><td>

Represents an error from the YouTube API.

This error is thrown when the YouTube API returns an error response.


</td></tr>
</tbody></table>

Expand Down Expand Up @@ -192,5 +218,14 @@ Description
</td><td>


</td></tr>
<tr><td>

[YouTubesJsErrors](./youtubes.js.youtubesjserrors.md)


</td><td>


</td></tr>
</tbody></table>
7 changes: 4 additions & 3 deletions docs/api/youtubes.js.pagination.all.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ all(): Promise<Result<T[], YouTubesJsErrors>>;
```
**Returns:**

Promise&lt;Result&lt;T\[\], YouTubesJsErrors&gt;&gt;
Promise&lt;Result&lt;T\[\], [YouTubesJsErrors](./youtubes.js.youtubesjserrors.md)<!-- -->&gt;&gt;

All pages data in an array. If several items are in a page, this method will return a 2D array. Use `flat()` to convert it to a 1D array.

Expand All @@ -28,7 +28,8 @@ const oauth = new StaticOAuthProvider({
});
const client = new ApiClient({ oauth });

const playlists = await client.playlists.getMine();
const allPlaylists = (await playlists.all()).flat();
// THIS IS UNSAFE ERROR HANDLING. See the safe error handling in the README.md Introduction.
const playlists = (await client.playlists.getMine()).throw();
const allPlaylists = (await playlists.all()).throw().flat();
```

8 changes: 5 additions & 3 deletions docs/api/youtubes.js.pagination.next.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ next(): Promise<Result<Pagination<T>, YouTubesJsErrors> | null>;
```
**Returns:**

Promise&lt;Result&lt;[Pagination](./youtubes.js.pagination.md)<!-- -->&lt;T&gt;, YouTubesJsErrors&gt; \| null&gt;
Promise&lt;Result&lt;[Pagination](./youtubes.js.pagination.md)<!-- -->&lt;T&gt;, [YouTubesJsErrors](./youtubes.js.youtubesjserrors.md)<!-- -->&gt; \| null&gt;

The next page. If there is no next page, returns `null`<!-- -->.

Expand All @@ -28,9 +28,11 @@ const oauth = new StaticOAuthProvider({
});
const client = new ApiClient({ oauth });

const playlists = await client.playlists.getMine();

// THIS IS UNSAFE ERROR HANDLING. See the safe error handling in the README.md Introduction.
const playlists = (await client.playlists.getMine()).throw();
console.log(playlists.data); // The first page of playlists
const nextPage = await playlists.next();
const nextPage = (await playlists.next()).throw();
console.log(nextPage?.data); // The second page of playlists or null if there is no next page
```

Loading

0 comments on commit e2d0893

Please sign in to comment.