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.d.mts
CHANGED
|
@@ -700,8 +700,9 @@ interface Media {
|
|
|
700
700
|
}
|
|
701
701
|
interface SearchMediaOptions {
|
|
702
702
|
query?: string;
|
|
703
|
+
countryOfOrigin?: string;
|
|
703
704
|
type?: MediaType;
|
|
704
|
-
format?: MediaFormat;
|
|
705
|
+
format?: MediaFormat | MediaFormat[];
|
|
705
706
|
status?: MediaStatus;
|
|
706
707
|
season?: MediaSeason;
|
|
707
708
|
seasonYear?: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -700,8 +700,9 @@ interface Media {
|
|
|
700
700
|
}
|
|
701
701
|
interface SearchMediaOptions {
|
|
702
702
|
query?: string;
|
|
703
|
+
countryOfOrigin?: string;
|
|
703
704
|
type?: MediaType;
|
|
704
|
-
format?: MediaFormat;
|
|
705
|
+
format?: MediaFormat | MediaFormat[];
|
|
705
706
|
status?: MediaStatus;
|
|
706
707
|
season?: MediaSeason;
|
|
707
708
|
seasonYear?: number;
|
package/dist/index.js
CHANGED
|
@@ -713,8 +713,10 @@ query ($id: Int!) {
|
|
|
713
713
|
var QUERY_MEDIA_SEARCH = `
|
|
714
714
|
query (
|
|
715
715
|
$search: String,
|
|
716
|
+
$countryOfOrigin: CountryCode,
|
|
716
717
|
$type: MediaType,
|
|
717
718
|
$format: MediaFormat,
|
|
719
|
+
$format_in: [MediaFormat],
|
|
718
720
|
$status: MediaStatus,
|
|
719
721
|
$season: MediaSeason,
|
|
720
722
|
$seasonYear: Int,
|
|
@@ -733,8 +735,10 @@ query (
|
|
|
733
735
|
pageInfo { total perPage currentPage lastPage hasNextPage }
|
|
734
736
|
media(
|
|
735
737
|
search: $search,
|
|
738
|
+
countryOfOrigin: $countryOfOrigin,
|
|
736
739
|
type: $type,
|
|
737
740
|
format: $format,
|
|
741
|
+
format_in: $format_in,
|
|
738
742
|
status: $status,
|
|
739
743
|
season: $season,
|
|
740
744
|
seasonYear: $seasonYear,
|
|
@@ -1600,12 +1604,24 @@ async function getMediaByMalId(client, malId, type) {
|
|
|
1600
1604
|
return data.Media;
|
|
1601
1605
|
}
|
|
1602
1606
|
async function searchMedia(client, options = {}) {
|
|
1603
|
-
const {
|
|
1607
|
+
const {
|
|
1608
|
+
query: search,
|
|
1609
|
+
page = 1,
|
|
1610
|
+
perPage = 20,
|
|
1611
|
+
genres,
|
|
1612
|
+
tags,
|
|
1613
|
+
genresExclude,
|
|
1614
|
+
tagsExclude,
|
|
1615
|
+
format,
|
|
1616
|
+
...filters
|
|
1617
|
+
} = options;
|
|
1604
1618
|
return client.pagedRequest(
|
|
1605
1619
|
QUERY_MEDIA_SEARCH,
|
|
1606
1620
|
{
|
|
1607
1621
|
search,
|
|
1608
1622
|
...filters,
|
|
1623
|
+
format: Array.isArray(format) ? void 0 : format,
|
|
1624
|
+
format_in: Array.isArray(format) ? format : void 0,
|
|
1609
1625
|
genre_in: genres,
|
|
1610
1626
|
tag_in: tags,
|
|
1611
1627
|
genre_not_in: genresExclude,
|
|
@@ -1855,7 +1871,7 @@ function mapFavorites(fav) {
|
|
|
1855
1871
|
|
|
1856
1872
|
// src/client/index.ts
|
|
1857
1873
|
var DEFAULT_API_URL = "https://graphql.anilist.co";
|
|
1858
|
-
var LIB_VERSION = "1.
|
|
1874
|
+
var LIB_VERSION = "1.9.0" ;
|
|
1859
1875
|
var AniListClient = class {
|
|
1860
1876
|
apiUrl;
|
|
1861
1877
|
headers;
|