ani-client 1.8.1 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -711,8 +711,10 @@ query ($id: Int!) {
|
|
|
711
711
|
var QUERY_MEDIA_SEARCH = `
|
|
712
712
|
query (
|
|
713
713
|
$search: String,
|
|
714
|
+
$countryOfOrigin: CountryCode,
|
|
714
715
|
$type: MediaType,
|
|
715
716
|
$format: MediaFormat,
|
|
717
|
+
$format_in: [MediaFormat],
|
|
716
718
|
$status: MediaStatus,
|
|
717
719
|
$season: MediaSeason,
|
|
718
720
|
$seasonYear: Int,
|
|
@@ -731,8 +733,10 @@ query (
|
|
|
731
733
|
pageInfo { total perPage currentPage lastPage hasNextPage }
|
|
732
734
|
media(
|
|
733
735
|
search: $search,
|
|
736
|
+
countryOfOrigin: $countryOfOrigin,
|
|
734
737
|
type: $type,
|
|
735
738
|
format: $format,
|
|
739
|
+
format_in: $format_in,
|
|
736
740
|
status: $status,
|
|
737
741
|
season: $season,
|
|
738
742
|
seasonYear: $seasonYear,
|
|
@@ -1598,12 +1602,24 @@ async function getMediaByMalId(client, malId, type) {
|
|
|
1598
1602
|
return data.Media;
|
|
1599
1603
|
}
|
|
1600
1604
|
async function searchMedia(client, options = {}) {
|
|
1601
|
-
const {
|
|
1605
|
+
const {
|
|
1606
|
+
query: search,
|
|
1607
|
+
page = 1,
|
|
1608
|
+
perPage = 20,
|
|
1609
|
+
genres,
|
|
1610
|
+
tags,
|
|
1611
|
+
genresExclude,
|
|
1612
|
+
tagsExclude,
|
|
1613
|
+
format,
|
|
1614
|
+
...filters
|
|
1615
|
+
} = options;
|
|
1602
1616
|
return client.pagedRequest(
|
|
1603
1617
|
QUERY_MEDIA_SEARCH,
|
|
1604
1618
|
{
|
|
1605
1619
|
search,
|
|
1606
1620
|
...filters,
|
|
1621
|
+
format: Array.isArray(format) ? void 0 : format,
|
|
1622
|
+
format_in: Array.isArray(format) ? format : void 0,
|
|
1607
1623
|
genre_in: genres,
|
|
1608
1624
|
tag_in: tags,
|
|
1609
1625
|
genre_not_in: genresExclude,
|
|
@@ -1853,7 +1869,7 @@ function mapFavorites(fav) {
|
|
|
1853
1869
|
|
|
1854
1870
|
// src/client/index.ts
|
|
1855
1871
|
var DEFAULT_API_URL = "https://graphql.anilist.co";
|
|
1856
|
-
var LIB_VERSION = "1.
|
|
1872
|
+
var LIB_VERSION = "1.9.0" ;
|
|
1857
1873
|
var AniListClient = class {
|
|
1858
1874
|
apiUrl;
|
|
1859
1875
|
headers;
|