diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b1f33e..7d5963e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [0.2.0](https://github.com/suzuki3jp/youtubes.js/compare/v0.1.2...v0.2.0) (2025-01-18) + + +### Features + +* **ci:** Add API documentation generation to release workflow ([85dd586](https://github.com/suzuki3jp/youtubes.js/commit/85dd586c2ddcd30f3270f16bf5473327b8fc5ffe)) + ## [0.1.2](https://github.com/suzuki3jp/youtubes.js/compare/v0.1.1...v0.1.2) (2025-01-18) diff --git a/docs/api/index.md b/docs/api/index.md new file mode 100644 index 0000000..e4dbdcf --- /dev/null +++ b/docs/api/index.md @@ -0,0 +1,29 @@ + + +[Home](./index.md) + +## API Reference + +## Packages + +
+ +Package + + + | + +Description + + + |
---|---|
+ +[youtubes.js](./youtubes.js.md) + + + | + + + |
+ +Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +{ oauth, logLevel } + + + | + +[ApiClientOptions](./youtubes.js.apiclientoptions.md) + + + | + + + |
+ +Constructor + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[(constructor)({ oauth, logLevel })](./youtubes.js.apiclient._constructor_.md) + + + | + + + | + +Constructs a new instance of the `ApiClient` class + + + |
+ +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[playlists](./youtubes.js.apiclient.playlists.md) + + + | + + + | + +[PlaylistManager](./youtubes.js.playlistmanager.md) + + + | + +The manager for playlists. Provides methods for fetching and manipulating playlists. + + + |
+ +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[logLevel?](./youtubes.js.apiclientoptions.loglevel.md) + + + | + + + | + +[LogLevel](./youtubes.js.loglevel.md) + + + | + +_(Optional)_ The log level for the client. + + + |
+ +[oauth](./youtubes.js.apiclientoptions.oauth.md) + + + | + + + | + +[OAuthProviders](./youtubes.js.oauthproviders.md) + + + | + +The OAuth providers to use. + + + |
+ +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[defaultLanguage?](./youtubes.js.createplaylistoptions.defaultlanguage.md) + + + | + + + | + +string + + + | + +_(Optional)_ The language of the playlist's default metadata. + + + |
+ +[description?](./youtubes.js.createplaylistoptions.description.md) + + + | + + + | + +string + + + | + +_(Optional)_ The description of the playlist. + + + |
+ +[localizations?](./youtubes.js.createplaylistoptions.localizations.md) + + + | + + + | + +Record<string, { title: string; description: string; }> + + + | + +_(Optional)_ The localized metadata for the playlist. + + + |
+ +[privacy?](./youtubes.js.createplaylistoptions.privacy.md) + + + | + + + | + +[Privacy](./youtubes.js.privacy.md) + + + | + +_(Optional)_ The privacy status of the playlist. + + + |
+ +[title](./youtubes.js.createplaylistoptions.title.md) + + + | + + + | + +string + + + | + +The title of the playlist. + + + |
+ +Class + + + | + +Description + + + |
---|---|
+ +[ApiClient](./youtubes.js.apiclient.md) + + + | + +The main class for interacting with the YouTube Data API. + + + |
+ +[Pagination](./youtubes.js.pagination.md) + + + | + +Provides utility methods for pagination. + + + |
+ +[Playlist](./youtubes.js.playlist.md) + + + | + +Represents a YouTube playlist resource. + +\[YouTube Data API Reference\](https://developers.google.com/youtube/v3/docs/playlists\#resource) + + + |
+ +[PlaylistManager](./youtubes.js.playlistmanager.md) + + + | + +Manager for playlist endpoints. Provides methods for `/youtube/v3/playlists`. + +\[YouTube Data API Reference\](https://developers.google.com/youtube/v3/docs/playlists) + + + |
+ +[StaticOAuthProvider](./youtubes.js.staticoauthprovider.md) + + + | + +An OAuth provider that doesn't refresh the token + + + |
+ +[Thumbnails](./youtubes.js.thumbnails.md) + + + | + +Presents the thumbnails of the video or the playlist. + +\[YouTube Data API Reference\](https://developers.google.com/youtube/v3/docs/thumbnails) + + + |
+ +Interface + + + | + +Description + + + |
---|---|
+ +[ApiClientOptions](./youtubes.js.apiclientoptions.md) + + + | + + + |
+ +[CreatePlaylistOptions](./youtubes.js.createplaylistoptions.md) + + + | + + + |
+ +[PaginationOptions](./youtubes.js.paginationoptions.md) + + + | + + + |
+ +[StaticCredentials](./youtubes.js.staticcredentials.md) + + + | + +The credentials for a `StaticOAuthProvider` + + + |
+ +[Thumbnail](./youtubes.js.thumbnail.md) + + + | + + + |
+ +Type Alias + + + | + +Description + + + |
---|---|
+ +[LogLevel](./youtubes.js.loglevel.md) + + + | + + + |
+ +[OAuthProviders](./youtubes.js.oauthproviders.md) + + + | + + + |
+ +[Privacy](./youtubes.js.privacy.md) + + + | + + + |
+ +Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +{ data, logger, prevToken, nextToken, resultsPerPage, totalResults, getWithToken, } + + + | + +[PaginationOptions](./youtubes.js.paginationoptions.md)<T> + + + | + + + |
+ +Constructor + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[(constructor)({ data, logger, prevToken, nextToken, resultsPerPage, totalResults, getWithToken, })](./youtubes.js.pagination._constructor_.md) + + + | + + + | + +Constructs a new instance of the `Pagination` class + + + |
+ +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[data](./youtubes.js.pagination.data.md) + + + | + + + | + +T + + + | + +The data of the current page. + + + |
+ +[resultsPerPage](./youtubes.js.pagination.resultsperpage.md) + + + | + + + | + +number + + + | + +The number of results included in the API response. + + + |
+ +[totalResults](./youtubes.js.pagination.totalresults.md) + + + | + + + | + +number + + + | + +The total number of results in the result set. \*\*NOTE\*\*: This number may be larger than the number of actual retrievable results. The YouTube Data API may not return some playlists (for example, the "Liked videos" playlist). However, the totalResults count may include them. + + + |
+ +Method + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[all()](./youtubes.js.pagination.all.md) + + + | + + + | + +Fetches all pages data. - \*\*NOTE\*\*: This method may consume unnecessary quotas, so be careful when using it in actual applications. - We strongly recommend fetching the next page based on user actions (e.g., scrolling). + + + |
+ +[next()](./youtubes.js.pagination.next.md) + + + | + + + | + +Fetches the next page. - \*\*NOTE\*\*: This method will use the same quotas as the original request. - Normally, GET requests use a quota of 1 unit, while other methods use 50 units. - However, some heavy methods use more than 50 units. - See more details on the \[YouTube Data API reference\](https://developers.google.com/youtube/v3/determine\_quota\_cost) + + + |
+ +[prev()](./youtubes.js.pagination.prev.md) + + + | + + + | + +Fetches the previous page. - \*\*NOTE\*\*: This method will use the same quotas as the original request. - Normally, GET requests use a quota of 1 unit, while other methods use 50 units. - However, some heavy methods use more than 50 units. - See more details on the \[YouTube Data API reference\](https://developers.google.com/youtube/v3/determine\_quota\_cost) + + + |
+ +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[data](./youtubes.js.paginationoptions.data.md) + + + | + + + | + +T + + + | + + + |
+ +[getWithToken](./youtubes.js.paginationoptions.getwithtoken.md) + + + | + + + | + +(token: string) => Promise<[Pagination](./youtubes.js.pagination.md)<T>> + + + | + + + |
+ +[logger](./youtubes.js.paginationoptions.logger.md) + + + | + + + | + +Logger + + + | + + + |
+ +[nextToken?](./youtubes.js.paginationoptions.nexttoken.md) + + + | + + + | + +string \| null + + + | + +_(Optional)_ + + + |
+ +[prevToken?](./youtubes.js.paginationoptions.prevtoken.md) + + + | + + + | + +string \| null + + + | + +_(Optional)_ + + + |
+ +[resultsPerPage?](./youtubes.js.paginationoptions.resultsperpage.md) + + + | + + + | + +number \| null + + + | + +_(Optional)_ + + + |
+ +[totalResults?](./youtubes.js.paginationoptions.totalresults.md) + + + | + + + | + +number \| null + + + | + +_(Optional)_ + + + |
+ +Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +{ id, title, description, thumbnails, privacy, count, publishedAt, channelId, channelName, } + + + | + +PlaylistData + + + | + + + |
+ +Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +data + + + | + +youtube\_v3.Schema$Playlist + + + | + + + |
+ +logger + + + | + +Logger + + + | + + + |
+ +Constructor + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[(constructor)({ id, title, description, thumbnails, privacy, count, publishedAt, channelId, channelName, })](./youtubes.js.playlist._constructor_.md) + + + | + + + | + +Constructs a new instance of the `Playlist` class + + + |
+ +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[channelId](./youtubes.js.playlist.channelid.md) + + + | + + + | + +string + + + | + +The channel id that the playlist belongs to. + + + |
+ +[channelName](./youtubes.js.playlist.channelname.md) + + + | + + + | + +string + + + | + +The channel name that the playlist belongs to. + + + |
+ +[count](./youtubes.js.playlist.count.md) + + + | + + + | + +number + + + | + +The number of videos in the playlist. + + + |
+ +[description](./youtubes.js.playlist.description.md) + + + | + + + | + +string + + + | + +The description of the playlist. + + + |
+ +[id](./youtubes.js.playlist.id.md) + + + | + + + | + +string + + + | + +The ID that YouTube uses to uniquely identify the playlist. + + + |
+ +[privacy](./youtubes.js.playlist.privacy.md) + + + | + + + | + +[Privacy](./youtubes.js.privacy.md) + + + | + +The privacy status of the playlist. + + + |
+ +[publishedAt](./youtubes.js.playlist.publishedat.md) + + + | + + + | + +Date + + + | + +The date and time that the playlist was created. + + + |
+ +[thumbnails](./youtubes.js.playlist.thumbnails.md) + + + | + + + | + +[Thumbnails](./youtubes.js.thumbnails.md) + + + | + +The thumbnails of the playlist. + + + |
+ +[title](./youtubes.js.playlist.title.md) + + + | + + + | + +string + + + | + +The title of the playlist. + + + |
+ +Method + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[from(data, logger)](./youtubes.js.playlist.from.md) + + + | + +`static` + + + | + + + |
+ +Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +{ oauth, logger } + + + | + +PlaylistManagerOptions + + + | + + + |
+ +Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +options + + + | + +[CreatePlaylistOptions](./youtubes.js.createplaylistoptions.md) + + + | + +Options for creating a playlist. + + + |
+ +Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +playlistId + + + | + +string + + + | + +The ID of the playlist. + + + |
+ +Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +id + + + | + +string + + + | + +The ID of the channel. + + + |
+ +pageToken + + + | + +string + + + | + +_(Optional)_ The token for pagination. + + + |
+ +Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +ids + + + | + +string\[\] + + + | + +The IDs of the playlist. + + + |
+ +pageToken + + + | + +string + + + | + +_(Optional)_ The token for pagination. + + + |
+ +Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +pageToken + + + | + +string + + + | + +_(Optional)_ The token for pagination. + + + |
+ +Constructor + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[(constructor)({ oauth, logger })](./youtubes.js.playlistmanager._constructor_.md) + + + | + + + | + +Constructs a new instance of the `PlaylistManager` class + + + |
+ +Method + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[create(options)](./youtubes.js.playlistmanager.create.md) + + + | + + + | + +Creates a playlist. - This operation uses 50 quota units. - There is a limit of approximately 10 playlists per day for creation. - For more details, see the issue: https://issuetracker.google.com/issues/255216949 + +\[YouTube Data API Reference\](https://developers.google.com/youtube/v3/docs/playlists/insert) + + + |
+ +[deleteById(playlistId)](./youtubes.js.playlistmanager.deletebyid.md) + + + | + + + | + +Deletes a playlist by its ID. - This operation uses 50 quota units. + +\[YouTube Data API Reference\](https://developers.google.com/youtube/v3/docs/playlists/delete) + + + |
+ +[getByChannelId(id, pageToken)](./youtubes.js.playlistmanager.getbychannelid.md) + + + | + + + | + +Fetches the playlists of a channel by its ID. - This operation uses 1 quota unit. - Retrieves all playlists when given an authenticated user's channel ID. Otherwise, only public playlists are accessible. + +\[YouTube Data API Reference\](https://developers.google.com/youtube/v3/docs/playlists/list) + + + |
+ +[getByIds(ids, pageToken)](./youtubes.js.playlistmanager.getbyids.md) + + + | + + + | + +Fetches a playlist by its ID. - This operation uses 1 quota unit. + +\[YouTube Data API Reference\](https://developers.google.com/youtube/v3/docs/playlists/list) + + + |
+ +[getMine(pageToken)](./youtubes.js.playlistmanager.getmine.md) + + + | + + + | + +Fetches the playlists owned by the authenticated user. - This operation uses 1 quota unit. + +\[YouTube Data API Reference\](https://developers.google.com/youtube/v3/docs/playlists/list) + + + |
+ +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[accessToken](./youtubes.js.staticcredentials.accesstoken.md) + + + | + + + | + +string + + + | + + + |
+ +Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +credentials + + + | + +[StaticCredentials](./youtubes.js.staticcredentials.md) + + + | + + + |
+ +Constructor + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[(constructor)(credentials)](./youtubes.js.staticoauthprovider._constructor_.md) + + + | + + + | + +Constructs a new instance of the `StaticOAuthProvider` class + + + |
+ +Method + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[getNativeOauth()](./youtubes.js.staticoauthprovider.getnativeoauth.md) + + + | + + + | + + + |
+ +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[height](./youtubes.js.thumbnail.height.md) + + + | + + + | + +number + + + | + +The height of the thumbnail image. + + + |
+ +[url](./youtubes.js.thumbnail.url.md) + + + | + + + | + +string + + + | + +The URL of the thumbnail image. + + + |
+ +[width](./youtubes.js.thumbnail.width.md) + + + | + + + | + +number + + + | + +The width of the thumbnail image. + + + |
+ +Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +data + + + | + +ThumbnailsData + + + | + + + |
+ +Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +data + + + | + +youtube\_v3.Schema$ThumbnailDetails + + + | + +The raw data from the YouTube API. + + + |
+ +logger + + + | + +Logger + + + | + + + |
+ +Constructor + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[(constructor)(data)](./youtubes.js.thumbnails._constructor_.md) + + + | + + + | + +Constructs a new instance of the `Thumbnails` class + + + |
+ +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[default?](./youtubes.js.thumbnails.default.md) + + + | + + + | + +[Thumbnail](./youtubes.js.thumbnail.md) + + + | + +_(Optional)_ + + + |
+ +[high?](./youtubes.js.thumbnails.high.md) + + + | + + + | + +[Thumbnail](./youtubes.js.thumbnail.md) + + + | + +_(Optional)_ + + + |
+ +[maxres?](./youtubes.js.thumbnails.maxres.md) + + + | + + + | + +[Thumbnail](./youtubes.js.thumbnail.md) + + + | + +_(Optional)_ + + + |
+ +[medium?](./youtubes.js.thumbnails.medium.md) + + + | + + + | + +[Thumbnail](./youtubes.js.thumbnail.md) + + + | + +_(Optional)_ + + + |
+ +[standard?](./youtubes.js.thumbnails.standard.md) + + + | + + + | + +[Thumbnail](./youtubes.js.thumbnail.md) + + + | + +_(Optional)_ + + + |
+ +Method + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[from(data, logger)](./youtubes.js.thumbnails.from.md) + + + | + +`static` + + + | + +Generates a `Thumbnails` instance from the YouTube API raw data. + + + |
+ +[getHighestResolution()](./youtubes.js.thumbnails.gethighestresolution.md) + + + | + + + | + +Returns the highest resolution thumbnail. + + + |
+ +[getLowestResolution()](./youtubes.js.thumbnails.getlowestresolution.md) + + + | + + + | + +Returns the lowest resolution thumbnail. + + + |