@tutkli/jikan-ts 0.6.0 → 0.6.2
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/README.md +2 -2
- package/dist/index.d.ts +47 -47
- package/dist/index.js +1 -23
- package/package.json +17 -21
- package/CHANGELOG.md +0 -132
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
- 📄 Configurable Logging
|
|
19
19
|
- 📦 ESM with tree shaking support
|
|
20
20
|
|
|
21
|
-
#### 📖 Check out the [documentation page](https://tutkli.github.io/jikan-ts/)!
|
|
21
|
+
#### 📖 Check out the [documentation page](https://tutkli.github.io/jikan-ts-docs/)!
|
|
22
22
|
|
|
23
23
|
## Installation
|
|
24
24
|
|
|
@@ -106,7 +106,7 @@ See also: [tslog Settings](https://tslog.js.org/#/?id=settings).
|
|
|
106
106
|
|
|
107
107
|
## Documentation
|
|
108
108
|
|
|
109
|
-
Check out the [documentation page](https://tutkli.github.io/jikan-ts/)!
|
|
109
|
+
Check out the [documentation page](https://tutkli.github.io/jikan-ts-docs/)!
|
|
110
110
|
|
|
111
111
|
## Leave you feedback
|
|
112
112
|
|
package/dist/index.d.ts
CHANGED
|
@@ -13,16 +13,17 @@ export declare const DEFAULT_CACHE_OPTIONS: {
|
|
|
13
13
|
headerInterpreter: import("axios-cache-interceptor").HeadersInterpreter;
|
|
14
14
|
debug: undefined;
|
|
15
15
|
};
|
|
16
|
+
export declare const getCacheOptions: (cacheOptions: CacheOptions | undefined) => CacheOptions;
|
|
16
17
|
export interface LoggerOptions {
|
|
17
18
|
enabled: boolean;
|
|
18
|
-
settings
|
|
19
|
+
settings: ISettingsParam<ILogObj>;
|
|
19
20
|
}
|
|
20
21
|
export declare const DEFAULT_LOGGER_SETTINGS: ISettingsParam<ILogObj>;
|
|
21
22
|
export declare const createLogger: (options?: ISettingsParam<ILogObj>) => Logger<ILogObj>;
|
|
22
|
-
export declare const handleRequest: (requestConfig: CacheRequestConfig, logger: Logger<ILogObj>
|
|
23
|
-
export declare const handleRequestError: (error: AxiosError, logger: Logger<ILogObj>
|
|
24
|
-
export declare const handleResponse: (response: CacheAxiosResponse, logger: Logger<ILogObj>
|
|
25
|
-
export declare const handleResponseError: (error: AxiosError, logger: Logger<ILogObj>
|
|
23
|
+
export declare const handleRequest: (requestConfig: CacheRequestConfig, logger: Logger<ILogObj>) => CacheRequestConfig;
|
|
24
|
+
export declare const handleRequestError: (error: AxiosError, logger: Logger<ILogObj>) => Promise<AxiosError>;
|
|
25
|
+
export declare const handleResponse: (response: CacheAxiosResponse, logger: Logger<ILogObj>) => CacheAxiosResponse;
|
|
26
|
+
export declare const handleResponseError: (error: AxiosError, logger: Logger<ILogObj>) => Promise<AxiosError>;
|
|
26
27
|
/**
|
|
27
28
|
* **Client Args**
|
|
28
29
|
* Used to pass optional configuration for logging and cache to the clients.
|
|
@@ -33,26 +34,25 @@ export interface ClientArgs {
|
|
|
33
34
|
* Options for the client logger.
|
|
34
35
|
* @see https://tslog.js.org/#/?id=settings
|
|
35
36
|
*/
|
|
36
|
-
loggerOptions
|
|
37
|
+
loggerOptions: Partial<LoggerOptions>;
|
|
37
38
|
/**
|
|
38
39
|
* **Axios Cache Options**
|
|
39
40
|
* Options for cache.
|
|
40
41
|
* @see https://axios-cache-interceptor.js.org/#/pages/configuration
|
|
41
42
|
*/
|
|
42
|
-
cacheOptions
|
|
43
|
+
cacheOptions: Partial<CacheOptions>;
|
|
43
44
|
/**
|
|
44
45
|
* **Base URL**
|
|
45
46
|
* Location of the JikanAPI. Leave empty to use the official JikanAPI instance.
|
|
46
47
|
*/
|
|
47
|
-
baseURL
|
|
48
|
+
baseURL: string;
|
|
48
49
|
}
|
|
49
50
|
/**
|
|
50
51
|
* **Base Client** This client is responsible for creating an Axios Instance and the cache and logging configurations
|
|
51
52
|
*/
|
|
52
53
|
export declare abstract class BaseClient {
|
|
53
54
|
api: AxiosCacheInstance;
|
|
54
|
-
|
|
55
|
-
protected constructor(clientOptions?: ClientArgs);
|
|
55
|
+
protected constructor(clientOptions?: Partial<ClientArgs>);
|
|
56
56
|
private addHttpInterceptors;
|
|
57
57
|
}
|
|
58
58
|
export interface JikanResource {
|
|
@@ -319,7 +319,7 @@ export declare enum MangaType {
|
|
|
319
319
|
lightnovel = "Lightnovel",
|
|
320
320
|
oneshot = "Oneshot",
|
|
321
321
|
doujin = "Doujin",
|
|
322
|
-
|
|
322
|
+
manhwa = "Manhwa",
|
|
323
323
|
manhua = "Manhua"
|
|
324
324
|
}
|
|
325
325
|
export declare enum MangaStatus {
|
|
@@ -373,20 +373,20 @@ export declare enum MangaSearchOrder {
|
|
|
373
373
|
volumes = "volumes"
|
|
374
374
|
}
|
|
375
375
|
export interface JikanSearchParams {
|
|
376
|
-
q
|
|
377
|
-
page
|
|
378
|
-
limit
|
|
379
|
-
score
|
|
380
|
-
min_score
|
|
381
|
-
max_score
|
|
382
|
-
sfw
|
|
383
|
-
genres
|
|
384
|
-
genres_exclude
|
|
385
|
-
sort
|
|
386
|
-
letter
|
|
387
|
-
producers
|
|
388
|
-
start_date
|
|
389
|
-
end_date
|
|
376
|
+
q: string;
|
|
377
|
+
page: number;
|
|
378
|
+
limit: number;
|
|
379
|
+
score: number;
|
|
380
|
+
min_score: number;
|
|
381
|
+
max_score: number;
|
|
382
|
+
sfw: boolean;
|
|
383
|
+
genres: string;
|
|
384
|
+
genres_exclude: string;
|
|
385
|
+
sort: SortOptions | string;
|
|
386
|
+
letter: string;
|
|
387
|
+
producers: string;
|
|
388
|
+
start_date: string;
|
|
389
|
+
end_date: string;
|
|
390
390
|
}
|
|
391
391
|
/**
|
|
392
392
|
* QueryParams used in **getMangaSearch** call
|
|
@@ -394,10 +394,10 @@ export interface JikanSearchParams {
|
|
|
394
394
|
* See also: [Jikan API Documentation](https://docs.api.jikan.moe/#tag/manga/operation/getMangaSearch)
|
|
395
395
|
*/
|
|
396
396
|
export interface MangaSearchParams extends JikanSearchParams {
|
|
397
|
-
type
|
|
398
|
-
status
|
|
399
|
-
order_by
|
|
400
|
-
magazines
|
|
397
|
+
type: MangaType | string;
|
|
398
|
+
status: MangaStatus | string;
|
|
399
|
+
order_by: MangaSearchOrder | SearchOrder | string;
|
|
400
|
+
magazines: string;
|
|
401
401
|
}
|
|
402
402
|
/**
|
|
403
403
|
* QueryParams used in **getAnimeSearch** call
|
|
@@ -405,10 +405,10 @@ export interface MangaSearchParams extends JikanSearchParams {
|
|
|
405
405
|
* See also: [Jikan API Documentation](https://docs.api.jikan.moe/#tag/anime/operation/getAnimeSearch)
|
|
406
406
|
*/
|
|
407
407
|
export interface AnimeSearchParams extends JikanSearchParams {
|
|
408
|
-
type
|
|
409
|
-
status
|
|
410
|
-
rating
|
|
411
|
-
order_by
|
|
408
|
+
type: AnimeType | string;
|
|
409
|
+
status: AnimeStatus | string;
|
|
410
|
+
rating: AnimeRating | string;
|
|
411
|
+
order_by: AnimeSearchOrder | SearchOrder | string;
|
|
412
412
|
}
|
|
413
413
|
export declare enum TopAnimeFilter {
|
|
414
414
|
airing = "airing",
|
|
@@ -423,8 +423,8 @@ export declare enum TopMangaFilter {
|
|
|
423
423
|
favorite = "favorite"
|
|
424
424
|
}
|
|
425
425
|
export interface JikanTopParams {
|
|
426
|
-
page
|
|
427
|
-
limit
|
|
426
|
+
page: number;
|
|
427
|
+
limit: number;
|
|
428
428
|
}
|
|
429
429
|
/**
|
|
430
430
|
* QueryParams used in **getTopAnime** call
|
|
@@ -432,8 +432,8 @@ export interface JikanTopParams {
|
|
|
432
432
|
* See also: [Jikan API Documentation](https://docs.api.jikan.moe/#tag/top/operation/getTopAnime)
|
|
433
433
|
*/
|
|
434
434
|
export interface AnimeTopParams extends JikanTopParams {
|
|
435
|
-
type
|
|
436
|
-
filter
|
|
435
|
+
type: AnimeType;
|
|
436
|
+
filter: TopAnimeFilter;
|
|
437
437
|
}
|
|
438
438
|
/**
|
|
439
439
|
* QueryParams used in **getTopManga** call
|
|
@@ -441,7 +441,7 @@ export interface AnimeTopParams extends JikanTopParams {
|
|
|
441
441
|
* See also: [Jikan API Documentation](https://docs.api.jikan.moe/#tag/top/operation/getTopManga)
|
|
442
442
|
*/
|
|
443
443
|
export interface MangaTopParams extends JikanTopParams {
|
|
444
|
-
type
|
|
444
|
+
type: MangaType;
|
|
445
445
|
filter: TopMangaFilter;
|
|
446
446
|
}
|
|
447
447
|
/**
|
|
@@ -467,13 +467,13 @@ export declare class AnimeClient extends BaseClient {
|
|
|
467
467
|
/**
|
|
468
468
|
* @argument clientOptions Options for the client.
|
|
469
469
|
*/
|
|
470
|
-
constructor(clientOptions?: ClientArgs);
|
|
470
|
+
constructor(clientOptions?: Partial<ClientArgs>);
|
|
471
471
|
/**
|
|
472
472
|
* Get all the Animes within the given filter. Returns all the Animes if no filters are given.
|
|
473
473
|
* @param searchParams Filter parameters
|
|
474
474
|
* @returns JikanResponse with Anime array data
|
|
475
475
|
*/
|
|
476
|
-
getAnimeSearch(searchParams?: AnimeSearchParams): Promise<JikanResponse<Anime[]>>;
|
|
476
|
+
getAnimeSearch(searchParams?: Partial<AnimeSearchParams>): Promise<JikanResponse<Anime[]>>;
|
|
477
477
|
/**
|
|
478
478
|
* Get a complete Anime resource data
|
|
479
479
|
* @param mal_id The Anime ID
|
|
@@ -560,13 +560,13 @@ export declare class MangaClient extends BaseClient {
|
|
|
560
560
|
/**
|
|
561
561
|
* @argument clientOptions Options for the client.
|
|
562
562
|
*/
|
|
563
|
-
constructor(clientOptions?: ClientArgs);
|
|
563
|
+
constructor(clientOptions?: Partial<ClientArgs>);
|
|
564
564
|
/**
|
|
565
565
|
* Get all the filtered Mangas. Returns all the Mangas if no filters are given.
|
|
566
566
|
* @param searchParams Filter parameters
|
|
567
567
|
* @returns JikanResponse with Manga array data
|
|
568
568
|
*/
|
|
569
|
-
getMangaSearch(searchParams?: MangaSearchParams): Promise<JikanResponse<Manga[]>>;
|
|
569
|
+
getMangaSearch(searchParams?: Partial<MangaSearchParams>): Promise<JikanResponse<Manga[]>>;
|
|
570
570
|
/**
|
|
571
571
|
* Get a Manga with full information by its ID
|
|
572
572
|
* @param mal_id The Manga ID
|
|
@@ -617,19 +617,19 @@ export declare class TopClient extends BaseClient {
|
|
|
617
617
|
/**
|
|
618
618
|
* @argument clientOptions Options for the client.
|
|
619
619
|
*/
|
|
620
|
-
constructor(clientOptions?: ClientArgs);
|
|
620
|
+
constructor(clientOptions?: Partial<ClientArgs>);
|
|
621
621
|
/**
|
|
622
622
|
* Get the top Animes
|
|
623
623
|
* @param searchParams Filter parameters
|
|
624
624
|
* @returns JikanResponse with Anime array data
|
|
625
625
|
*/
|
|
626
|
-
getTopAnime(searchParams?: AnimeTopParams): Promise<JikanResponse<Anime[]>>;
|
|
626
|
+
getTopAnime(searchParams?: Partial<AnimeTopParams>): Promise<JikanResponse<Anime[]>>;
|
|
627
627
|
/**
|
|
628
628
|
* Get the top Mangas
|
|
629
629
|
* @param searchParams Filter parameters
|
|
630
630
|
* @returns JikanResponse with Manga array data
|
|
631
631
|
*/
|
|
632
|
-
getTopManga(searchParams?: MangaTopParams): Promise<JikanResponse<Manga[]>>;
|
|
632
|
+
getTopManga(searchParams?: Partial<MangaTopParams>): Promise<JikanResponse<Manga[]>>;
|
|
633
633
|
}
|
|
634
634
|
/**
|
|
635
635
|
* **Jikan Client**
|
|
@@ -641,11 +641,11 @@ export declare class TopClient extends BaseClient {
|
|
|
641
641
|
*
|
|
642
642
|
* See also: [JikanAPI Documentation](https://docs.api.jikan.moe/)
|
|
643
643
|
*/
|
|
644
|
-
export declare class JikanClient
|
|
644
|
+
export declare class JikanClient {
|
|
645
645
|
anime: AnimeClient;
|
|
646
646
|
manga: MangaClient;
|
|
647
647
|
top: TopClient;
|
|
648
|
-
constructor(clientOptions?: ClientArgs);
|
|
648
|
+
constructor(clientOptions?: Partial<ClientArgs>);
|
|
649
649
|
}
|
|
650
650
|
export declare enum BaseURL {
|
|
651
651
|
REST = "https://api.jikan.moe/v4"
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1 @@
|
|
|
1
|
-
|
|
2
|
-
`),function(o){if(s=o.indexOf(":"),i=Pe.trim(o.substr(0,s)).toLowerCase(),n=Pe.trim(o.substr(s+1)),i){if(r[i]&&Bn.indexOf(i)>=0)return;i==="set-cookie"?r[i]=(r[i]?r[i]:[]).concat([n]):r[i]=r[i]?r[i]+", "+n:n}}),r}});var Vt=m((bs,Ut)=>{"use strict";var Ft=g();Ut.exports=Ft.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),i;function n(s){var a=s;return e&&(r.setAttribute("href",a),a=r.href),r.setAttribute("href",a),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return i=n(window.location.href),function(a){var o=Ft.isString(a)?n(a):a;return o.protocol===i.protocol&&o.host===i.host}}():function(){return function(){return!0}}()});var W=m((xs,Wt)=>{"use strict";var Oe=N(),Dn=g();function $t(t){Oe.call(this,t??"canceled",Oe.ERR_CANCELED),this.name="CanceledError"}Dn.inherits($t,Oe,{__CANCEL__:!0});Wt.exports=$t});var zt=m((As,Ht)=>{"use strict";Ht.exports=function(e){var r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return r&&r[1]||""}});var Je=m((Rs,Kt)=>{"use strict";var H=g(),Fn=Lt(),Un=It(),Vn=Ee(),$n=ke(),Wn=Dt(),Hn=Vt(),zn=ve(),k=N(),Kn=W(),Gn=zt();Kt.exports=function(e){return new Promise(function(i,n){var s=e.data,a=e.headers,o=e.responseType,u;function p(){e.cancelToken&&e.cancelToken.unsubscribe(u),e.signal&&e.signal.removeEventListener("abort",u)}H.isFormData(s)&&H.isStandardBrowserEnv()&&delete a["Content-Type"];var c=new XMLHttpRequest;if(e.auth){var l=e.auth.username||"",f=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.Authorization="Basic "+btoa(l+":"+f)}var d=$n(e.baseURL,e.url);c.open(e.method.toUpperCase(),Vn(d,e.params,e.paramsSerializer),!0),c.timeout=e.timeout;function P(){if(c){var R="getAllResponseHeaders"in c?Wn(c.getAllResponseHeaders()):null,T=!o||o==="text"||o==="json"?c.responseText:c.response,J={data:T,status:c.status,statusText:c.statusText,headers:R,config:e,request:c};Fn(function(fe){i(fe),p()},function(fe){n(fe),p()},J),c=null}}if("onloadend"in c?c.onloadend=P:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(P)},c.onabort=function(){c&&(n(new k("Request aborted",k.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new k("Network Error",k.ERR_NETWORK,e,c,c)),c=null},c.ontimeout=function(){var T=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",J=e.transitional||zn;e.timeoutErrorMessage&&(T=e.timeoutErrorMessage),n(new k(T,J.clarifyTimeoutError?k.ETIMEDOUT:k.ECONNABORTED,e,c)),c=null},H.isStandardBrowserEnv()){var $=(e.withCredentials||Hn(d))&&e.xsrfCookieName?Un.read(e.xsrfCookieName):void 0;$&&(a[e.xsrfHeaderName]=$)}"setRequestHeader"in c&&H.forEach(a,function(T,J){typeof s>"u"&&J.toLowerCase()==="content-type"?delete a[J]:c.setRequestHeader(J,T)}),H.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&o!=="json"&&(c.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&c.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(u=function(R){c&&(n(!R||R&&R.type?new Kn:R),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(u),e.signal&&(e.signal.aborted?u():e.signal.addEventListener("abort",u))),s||(s=null);var E=Gn(d);if(E&&["http","https","file"].indexOf(E)===-1){n(new k("Unsupported protocol "+E+":",k.ERR_BAD_REQUEST,e));return}c.send(s)})}});var Xt=m((ws,Gt)=>{Gt.exports=null});var te=m((Es,er)=>{"use strict";var y=g(),Yt=Et(),Zt=N(),Xn=ve(),Yn=Se(),Zn={"Content-Type":"application/x-www-form-urlencoded"};function Qt(t,e){!y.isUndefined(t)&&y.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function Qn(){var t;return typeof XMLHttpRequest<"u"?t=Je():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(t=Je()),t}function ei(t,e,r){if(y.isString(t))try{return(e||JSON.parse)(t),y.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(r||JSON.stringify)(t)}var ee={transitional:Xn,adapter:Qn(),transformRequest:[function(e,r){if(Yt(r,"Accept"),Yt(r,"Content-Type"),y.isFormData(e)||y.isArrayBuffer(e)||y.isBuffer(e)||y.isStream(e)||y.isFile(e)||y.isBlob(e))return e;if(y.isArrayBufferView(e))return e.buffer;if(y.isURLSearchParams(e))return Qt(r,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var i=y.isObject(e),n=r&&r["Content-Type"],s;if((s=y.isFileList(e))||i&&n==="multipart/form-data"){var a=this.env&&this.env.FormData;return Yn(s?{"files[]":e}:e,a&&new a)}else if(i||n==="application/json")return Qt(r,"application/json"),ei(e);return e}],transformResponse:[function(e){var r=this.transitional||ee.transitional,i=r&&r.silentJSONParsing,n=r&&r.forcedJSONParsing,s=!i&&this.responseType==="json";if(s||n&&y.isString(e)&&e.length)try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?Zt.from(a,Zt.ERR_BAD_RESPONSE,this,null,this.response):a}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Xt()},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};y.forEach(["delete","get","head"],function(e){ee.headers[e]={}});y.forEach(["post","put","patch"],function(e){ee.headers[e]=y.merge(Zn)});er.exports=ee});var rr=m((vs,tr)=>{"use strict";var ti=g(),ri=te();tr.exports=function(e,r,i){var n=this||ri;return ti.forEach(i,function(a){e=a.call(n,e,r)}),e}});var Le=m((Ss,nr)=>{"use strict";nr.exports=function(e){return!!(e&&e.__CANCEL__)}});var ar=m((Cs,sr)=>{"use strict";var ir=g(),Ne=rr(),ni=Le(),ii=te(),si=W();function Ie(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new si}sr.exports=function(e){Ie(e),e.headers=e.headers||{},e.data=Ne.call(e,e.data,e.headers,e.transformRequest),e.headers=ir.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),ir.forEach(["delete","get","head","post","put","patch","common"],function(n){delete e.headers[n]});var r=e.adapter||ii.adapter;return r(e).then(function(n){return Ie(e),n.data=Ne.call(e,n.data,n.headers,e.transformResponse),n},function(n){return ni(n)||(Ie(e),n&&n.response&&(n.response.data=Ne.call(e,n.response.data,n.response.headers,e.transformResponse))),Promise.reject(n)})}});var Te=m((ks,or)=>{"use strict";var A=g();or.exports=function(e,r){r=r||{};var i={};function n(c,l){return A.isPlainObject(c)&&A.isPlainObject(l)?A.merge(c,l):A.isPlainObject(l)?A.merge({},l):A.isArray(l)?l.slice():l}function s(c){if(A.isUndefined(r[c])){if(!A.isUndefined(e[c]))return n(void 0,e[c])}else return n(e[c],r[c])}function a(c){if(!A.isUndefined(r[c]))return n(void 0,r[c])}function o(c){if(A.isUndefined(r[c])){if(!A.isUndefined(e[c]))return n(void 0,e[c])}else return n(void 0,r[c])}function u(c){if(c in r)return n(e[c],r[c]);if(c in e)return n(void 0,e[c])}var p={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:u};return A.forEach(Object.keys(e).concat(Object.keys(r)),function(l){var f=p[l]||s,d=f(l);A.isUndefined(d)&&f!==u||(i[l]=d)}),i}});var je=m((Ps,ur)=>{ur.exports={version:"0.27.2"}});var lr=m((Os,pr)=>{"use strict";var ai=je().version,O=N(),qe={};["object","boolean","number","function","string","symbol"].forEach(function(t,e){qe[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}});var cr={};qe.transitional=function(e,r,i){function n(s,a){return"[Axios v"+ai+"] Transitional option '"+s+"'"+a+(i?". "+i:"")}return function(s,a,o){if(e===!1)throw new O(n(a," has been removed"+(r?" in "+r:"")),O.ERR_DEPRECATED);return r&&!cr[a]&&(cr[a]=!0,console.warn(n(a," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(s,a,o):!0}};function oi(t,e,r){if(typeof t!="object")throw new O("options must be an object",O.ERR_BAD_OPTION_VALUE);for(var i=Object.keys(t),n=i.length;n-- >0;){var s=i[n],a=e[s];if(a){var o=t[s],u=o===void 0||a(o,s,t);if(u!==!0)throw new O("option "+s+" must be "+u,O.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new O("Unknown option "+s,O.ERR_BAD_OPTION)}}pr.exports={assertOptions:oi,validators:qe}});var yr=m((Js,gr)=>{"use strict";var dr=g(),ui=Ee(),fr=Rt(),mr=ar(),re=Te(),ci=ke(),hr=lr(),D=hr.validators;function F(t){this.defaults=t,this.interceptors={request:new fr,response:new fr}}F.prototype.request=function(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=re(this.defaults,r),r.method?r.method=r.method.toLowerCase():this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var i=r.transitional;i!==void 0&&hr.assertOptions(i,{silentJSONParsing:D.transitional(D.boolean),forcedJSONParsing:D.transitional(D.boolean),clarifyTimeoutError:D.transitional(D.boolean)},!1);var n=[],s=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(r)===!1||(s=s&&d.synchronous,n.unshift(d.fulfilled,d.rejected))});var a=[];this.interceptors.response.forEach(function(d){a.push(d.fulfilled,d.rejected)});var o;if(!s){var u=[mr,void 0];for(Array.prototype.unshift.apply(u,n),u=u.concat(a),o=Promise.resolve(r);u.length;)o=o.then(u.shift(),u.shift());return o}for(var p=r;n.length;){var c=n.shift(),l=n.shift();try{p=c(p)}catch(f){l(f);break}}try{o=mr(p)}catch(f){return Promise.reject(f)}for(;a.length;)o=o.then(a.shift(),a.shift());return o};F.prototype.getUri=function(e){e=re(this.defaults,e);var r=ci(e.baseURL,e.url);return ui(r,e.params,e.paramsSerializer)};dr.forEach(["delete","get","head","options"],function(e){F.prototype[e]=function(r,i){return this.request(re(i||{},{method:e,url:r,data:(i||{}).data}))}});dr.forEach(["post","put","patch"],function(e){function r(i){return function(s,a,o){return this.request(re(o||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}F.prototype[e]=r(),F.prototype[e+"Form"]=r(!0)});gr.exports=F});var xr=m((Ls,br)=>{"use strict";var pi=W();function U(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(n){e=n});var r=this;this.promise.then(function(i){if(r._listeners){var n,s=r._listeners.length;for(n=0;n<s;n++)r._listeners[n](i);r._listeners=null}}),this.promise.then=function(i){var n,s=new Promise(function(a){r.subscribe(a),n=a}).then(i);return s.cancel=function(){r.unsubscribe(n)},s},t(function(n){r.reason||(r.reason=new pi(n),e(r.reason))})}U.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};U.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]};U.prototype.unsubscribe=function(e){if(this._listeners){var r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}};U.source=function(){var e,r=new U(function(n){e=n});return{token:r,cancel:e}};br.exports=U});var Rr=m((Ns,Ar)=>{"use strict";Ar.exports=function(e){return function(i){return e.apply(null,i)}}});var Er=m((Is,wr)=>{"use strict";var li=g();wr.exports=function(e){return li.isObject(e)&&e.isAxiosError===!0}});var Cr=m((Ts,Me)=>{"use strict";var vr=g(),fi=ge(),ne=yr(),mi=Te(),di=te();function Sr(t){var e=new ne(t),r=fi(ne.prototype.request,e);return vr.extend(r,ne.prototype,e),vr.extend(r,e),r.create=function(n){return Sr(mi(t,n))},r}var x=Sr(di);x.Axios=ne;x.CanceledError=W();x.CancelToken=xr();x.isCancel=Le();x.VERSION=je().version;x.toFormData=Se();x.AxiosError=N();x.Cancel=x.CanceledError;x.all=function(e){return Promise.all(e)};x.spread=Rr();x.isAxiosError=Er();Me.exports=x;Me.exports.default=x});var Pr=m((js,kr)=>{kr.exports=Cr()});var rn=Symbol("cache-parser");function j(t){return(typeof t=="string"||typeof t=="number")&&(t=Number(t))>=0&&t<1/0}function v(t){return t===!0||typeof t=="number"||typeof t=="string"&&t!=="false"}var q=Number;function He(t){var e=Object.defineProperty({},rn,{enumerable:!1,value:1});if(!t||typeof t!="string")return e;var r=function(p){var c={},l=p.toLowerCase().replace(/\s+/g,"").split(",");for(var f in l){var d,P=l[f].split("=",2);c[P[0]]=(d=P[1])==null||d}return c}(t),i=r["max-age"],n=r["max-stale"],s=r["min-fresh"],a=r["s-maxage"],o=r["stale-if-error"],u=r["stale-while-revalidate"];return v(r.immutable)&&(e.immutable=!0),j(i)&&(e.maxAge=q(i)),j(n)&&(e.maxStale=q(n)),j(s)&&(e.minFresh=q(s)),v(r["must-revalidate"])&&(e.mustRevalidate=!0),v(r["must-understand"])&&(e.mustUnderstand=!0),v(r["no-cache"])&&(e.noCache=!0),v(r["no-store"])&&(e.noStore=!0),v(r["no-transform"])&&(e.noTransform=!0),v(r["only-if-cached"])&&(e.onlyIfCached=!0),v(r.private)&&(e.private=!0),v(r["proxy-revalidate"])&&(e.proxyRevalidate=!0),v(r.public)&&(e.public=!0),j(a)&&(e.sMaxAge=q(a)),j(o)&&(e.staleIfError=q(o)),j(u)&&(e.staleWhileRevalidate=q(u)),e}var sn=Symbol();function ze(){var t,e,r=new Promise(function(i,n){t=i,e=n});return r.resolve=t,r.reject=e,r[sn]=1,r}function Ke(t){var e=typeof t;if(t&&e==="object"&&!(t instanceof Date||t instanceof RegExp)){for(var r=Array.isArray(t)?[]:{},i=Object.keys(t).sort(function(a,o){return a>o?1:-1}),n=i.length;n--;){var s=i[n];r[s]=Ke(t[s])}return String(t.constructor)+JSON.stringify(r,i)}return e+String(t)}function Ge(t){t=Ke(t);for(var e=5381,r=0;r<t.length;)e=33*e^t.charCodeAt(r++);return e}var M={d:(t,e)=>{for(var r in e)M.o(e,r)&&!M.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},h={};M.d(h,{h4:()=>b,UN:()=>ut,uu:()=>ot,Kd:()=>he,ZF:()=>fn,nv:()=>me,p:()=>tt,E7:()=>Ze,NQ:()=>Ye,xK:()=>ct,G6:()=>rt,LN:()=>st,Bw:()=>de,Ad:()=>Qe,$k:()=>at,v8:()=>ln,Jk:()=>nt,tI:()=>it,iS:()=>et});var un=(t=>{var e={};return M.d(e,t),e})({parse:()=>He}),b=Object.freeze({IfModifiedSince:"if-modified-since",LastModified:"last-modified",IfNoneMatch:"if-none-match",CacheControl:"cache-control",ETag:"etag",Expires:"expires",Age:"age",XAxiosCacheEtag:"x-axios-cache-etag",XAxiosCacheLastModified:"x-axios-cache-last-modified",XAxiosCacheStaleIfError:"x-axios-cache-stale-if-error"}),Ye=t=>{if(!t)return"not enough headers";let e=t[b.CacheControl];if(e){let{noCache:i,noStore:n,mustRevalidate:s,maxAge:a,immutable:o}=(0,un.parse)(String(e));if(i||n)return"dont cache";if(o)return 31536e6;if(s)return 0;if(a!==void 0){let u=t[b.Age];return u?1e3*(a-Number(u)):1e3*a}}let r=t[b.Expires];if(r){let i=Date.parse(String(r))-Date.now();return i>=0?i:"dont cache"}return"not enough headers"},cn=(t=>{var e={};return M.d(e,t),e})({deferred:()=>ze});function Ze(t){return t?e=>t(e)||e===304:e=>e>=200&&e<300||e===304}function Qe(t="get",e=[]){return t=t.toLowerCase(),e.some(r=>r===t)}function et(t,e){var r;e.headers||(e.headers={});let{etag:i,modifiedSince:n}=e.cache;if(i){let s=i===!0?(r=t.data)===null||r===void 0?void 0:r.headers[b.ETag]:i;s&&(e.headers[b.IfNoneMatch]=s)}n&&(e.headers[b.IfModifiedSince]=n===!0?t.data.headers[b.LastModified]||new Date(t.createdAt).toUTCString():n.toUTCString())}function tt(t,e){return t.status===304&&e?(t.cached=!0,t.data=e.data,t.status=e.status,t.statusText=e.statusText,t.headers=Object.assign(Object.assign({},e.headers),t.headers),e):{data:t.data,status:t.status,statusText:t.statusText,headers:t.headers}}function rt(t){let e=async r=>{var i;let n=r.id=t.generateKey(r);if(r.cache===!1||(r.cache=Object.assign(Object.assign({},t.defaults.cache),r.cache),!Qe(r.method,r.cache.methods)))return r;let s=await t.storage.get(n,r),a=r.cache.override;e:if(s.state==="empty"||s.state==="stale"||a){if(t.waiting[n]&&!a&&(s=await t.storage.get(n,r),s.state!=="empty"))break e;return t.waiting[n]=(0,cn.deferred)(),(i=t.waiting[n])===null||i===void 0||i.catch(()=>{}),await t.storage.set(n,{state:"loading",previous:a?s.data?"stale":"empty":s.state,data:s.data,createdAt:a&&!s.createdAt?Date.now():s.createdAt},r),s.state==="stale"&&et(s,r),r.validateStatus=Ze(r.validateStatus),r}let o;if(s.state==="loading"){let u=t.waiting[n];if(!u)return await t.storage.remove(n,r),r;try{o=await u}catch{return r}}else o=s.data;return r.adapter=()=>Promise.resolve({config:r,data:o.data,headers:o.headers,status:o.status,statusText:o.statusText,cached:!0,id:n}),r};return{onFulfilled:e,apply:()=>t.interceptors.request.use(e)}}async function nt(t,e){var r;if(typeof e=="function")return e(t);let{statusCheck:i,responseMatch:n,containsHeaders:s}=e;if(i&&!await i(t.status)||n&&!await n(t))return!1;if(s){for(let[a,o]of Object.entries(s))if(!await o((r=t.headers[a.toLowerCase()])!==null&&r!==void 0?r:t.headers[a]))return!1}return!0}async function it(t,e,r){if(typeof r=="function")return r(e);for(let[i,n]of Object.entries(r)){if(n==="delete"){await t.remove(i,e.config);continue}let s=await t.get(i,e.config);if(s.state==="loading")continue;let a=await n(s,e);a!=="delete"?a!=="ignore"&&await t.set(i,a,e.config):await t.remove(i,e.config)}}function st(t){let e=async(n,s)=>{var a;await t.storage.remove(n,s),(a=t.waiting[n])===null||a===void 0||a.reject(),delete t.waiting[n]},r=async n=>{var s,a,o;let u=n.id=(s=(o=n.config).id)!==null&&s!==void 0?s:o.id=t.generateKey(n.config);if((a=n.cached)!==null&&a!==void 0||(n.cached=!1),n.cached)return n;let p=n.config.cache;if(!p)return Object.assign(Object.assign({},n),{cached:!1});let c=n.config,l=await t.storage.get(u,c);if(p?.update&&await it(t.storage,n,p.update),l.state!=="loading")return n;if(!l.data&&!await nt(n,p.cachePredicate))return await e(u,c),n;for(let E of Object.keys(n.headers))E.startsWith("x-axios-cache")&&delete n.headers[E];p.etag&&p.etag!==!0&&(n.headers[b.XAxiosCacheEtag]=p.etag),p.modifiedSince&&(n.headers[b.XAxiosCacheLastModified]=p.modifiedSince===!0?"use-cache-timestamp":p.modifiedSince.toUTCString());let f=p.ttl||-1;if(p?.interpretHeader){let E=t.headerInterpreter(n.headers);if(E==="dont cache")return await e(u,c),n;f=E==="not enough headers"?f:E}let d=tt(n,l.data);typeof f=="function"&&(f=await f(n)),p.staleIfError&&(n.headers[b.XAxiosCacheStaleIfError]=String(f));let P={state:"cached",ttl:f,createdAt:Date.now(),data:d},$=t.waiting[u];return $&&($.resolve(P.data),delete t.waiting[u]),await t.storage.set(u,P,c),n},i=async n=>{var s;let a=n.config;if(!a?.cache||!a.id)throw n;let o=await t.storage.get(a.id,a),u=a.cache;if(o.state!=="loading"||o.previous!=="stale")throw await e(a.id,a),n;if(u?.staleIfError){let p=typeof u.staleIfError=="function"?await u.staleIfError(n.response,o,n):u.staleIfError;if(p===!0||typeof p=="number"&&o.createdAt+p>Date.now())return(s=t.waiting[a.id])===null||s===void 0||s.resolve(o.data),delete t.waiting[a.id],await t.storage.set(a.id,{state:"stale",createdAt:Date.now(),data:o.data},a),{cached:!0,config:a,id:a.id,data:o.data.data,headers:o.data.headers,status:o.data.status,statusText:o.data.statusText}}throw n};return{onFulfilled:r,onRejected:i,apply:()=>t.interceptors.response.use(r,i)}}var at=t=>!!t&&!!t["is-storage"];function me(t){let e=t.data.headers;return b.ETag in e||b.LastModified in e||b.XAxiosCacheEtag in e||b.XAxiosCacheStaleIfError in e||b.XAxiosCacheLastModified in e}function de(t){return t.createdAt+t.ttl<=Date.now()}function he({set:t,find:e,remove:r}){return{"is-storage":1,set:t,remove:r,get:async(i,n)=>{let s=await e(i,n);if(!s)return{state:"empty"};if(s.state!=="cached"||!de(s))return s;if(me(s)){let a={state:"stale",createdAt:s.createdAt,data:s.data};return await t(i,a,n),a}return await r(i,n),{state:"empty"}}}}function ot(t=!1){let e=he({set:(r,i)=>{e.data[r]=i},remove:r=>{delete e.data[r]},find:r=>{let i=e.data[r];return t&&i!==void 0?typeof structuredClone=="function"?structuredClone(i):JSON.parse(JSON.stringify(i)):i}});return e.data=Object.create(null),e}var pn=(t=>{var e={};return M.d(e,t),e})({hash:()=>Ge}),Xe=/^\/|\/$/g;function ut(t){return e=>{if(e.id)return e.id;let r=t(e);return typeof r=="string"||typeof r=="number"?`${r}`:`${(0,pn.hash)(r)}`}}var ct=ut(({baseURL:t="",url:e="",method:r="get",params:i,data:n})=>(t&&(t=t.replace(Xe,"")),e&&(e=e.replace(Xe,"")),r&&(r=r.toLowerCase()),{url:t+(t&&e?"/":"")+e,params:i,method:r,data:n}));function ln(t,e={}){var r,i,n,s,a;let o=t;if(o.storage=e.storage||ot(),!at(o.storage))throw new Error("Use buildStorage() function");return o.waiting=e.waiting||{},o.generateKey=e.generateKey||ct,o.headerInterpreter=e.headerInterpreter||Ye,o.requestInterceptor=e.requestInterceptor||rt(o),o.responseInterceptor=e.responseInterceptor||st(o),o.debug=e.debug,o.defaults.cache={update:e.update||{},ttl:(r=e.ttl)!==null&&r!==void 0?r:3e5,methods:e.methods||["get"],cachePredicate:e.cachePredicate||{statusCheck:u=>u>=200&&u<400},etag:(i=e.etag)===null||i===void 0||i,modifiedSince:(n=e.modifiedSince)!==null&&n!==void 0?n:e.etag===!1,interpretHeader:(s=e.interpretHeader)===null||s===void 0||s,staleIfError:(a=e.staleIfError)===null||a===void 0||a,override:!1},o.requestInterceptor.apply(),o.responseInterceptor.apply(),o}function fn(t,e=""){return he({find:r=>{let i=t.getItem(e+r);return i?JSON.parse(i):void 0},remove:r=>{t.removeItem(e+r)},set:(r,i)=>{let n=()=>t.setItem(e+r,JSON.stringify(i));try{return n()}catch{let a=Object.entries(t).filter(o=>o[0].startsWith(e)).map(o=>[o[0],JSON.parse(o[1])]);for(let o of a)o[1].state==="cached"&&de(o[1])&&!me(o[1])&&t.removeItem(o[0]);try{return n()}catch{let u=a.sort((p,c)=>(p[1].createdAt||0)-(c[1].createdAt||0));for(let p of u){t.removeItem(p[0]);try{return n()}catch{}}}t.removeItem(e+r)}}})}var Ui=h.h4,Vi=h.UN,pt=h.uu,$i=h.Kd,Wi=h.ZF,Hi=h.nv,zi=h.p,Ki=h.E7,lt=h.NQ,ft=h.xK,Gi=h.G6,Xi=h.LN,Yi=h.Bw,Zi=h.Ad,Qi=h.$k,mt=h.v8,es=h.Jk,ts=h.tI,rs=h.iS;var Hr=tn(Pr(),1);var Or=(e=>(e.REST="https://api.jikan.moe/v4",e))(Or||{});var Jr=(f=>(f.AnimeSearch="/anime",f.AnimeFullById="/anime/{id}/full",f.AnimeById="/anime/{id}",f.AnimeCharacters="/anime/{id}/characters",f.AnimeStaff="/anime/{id}/staff",f.AnimeEpisodes="/anime/{id}/episodes",f.AnimeEpisodeById="/anime/{id}/episodes/{episode}",f.AnimeVideos="/anime/{id}/videos",f.AnimeVideosEpisodes="/anime/{id}/videos/episodes",f.AnimePictures="/anime/{id}/pictures",f.AnimeStatistics="/anime/{id}/statistics",f.AnimeRecommendations="/anime/{id}/recommendations",f))(Jr||{}),Lr=(o=>(o.MangaSearch="/manga",o.MangaFullById="/manga/{id}/full",o.MangaById="/manga/{id}",o.MangaCharacters="/manga/{id}/characters",o.MangaPictures="/manga/{id}/pictures",o.MangaStatistics="/manga/{id}/statistics",o.MangaRecommendations="/manga/{id}/recommendations",o))(Lr||{}),Nr=(r=>(r.TopAnime="/top/anime",r.TopManga="/top/manga",r))(Nr||{});var z={storage:pt(),generateKey:ft,headerInterpreter:lt,debug:void 0};var K={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]};function G(t,e,r,i=!1){let n=String(e),s=(o,u)=>`\x1B[${u[0]}m${o}\x1B[${u[1]}m`,a=(o,u)=>u!=null&&typeof u=="string"?s(o,K[u]):u!=null&&Array.isArray(u)?u.reduce((p,c)=>a(p,c),o):u!=null&&u[o.trim()]!=null?a(o,u[o.trim()]):u!=null&&u["*"]!=null?a(o,u["*"]):o;return n.replace(/{{(.+?)}}/g,(o,u)=>{let p=r[u]!=null?r[u]:i?"":o;return t.stylePrettyLogs?a(p,t?.prettyLogStyles?.[u])+s("",K.reset):p})}function S(t,e){let r={seen:[],stylize:gi};return e!=null&&Ei(r,e),V(r.showHidden)&&(r.showHidden=!1),V(r.depth)&&(r.depth=2),V(r.colors)&&(r.colors=!0),V(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=yi),ie(r,t,r.depth)}S.colors=K;S.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function hi(t){return typeof t=="boolean"}function V(t){return t==null}function gi(t){return t}function yi(t,e){let r=S.styles[e];return r!=null&&S?.colors?.[r]?.[0]!=null&&S?.colors?.[r]?.[1]!=null?"\x1B["+S.colors[r][0]+"m"+t+"\x1B["+S.colors[r][1]+"m":t}function _e(t){return typeof t=="function"}function Tr(t){return typeof t=="string"}function bi(t){return typeof t=="number"}function jr(t){return t===null}function qr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Be(t){return se(t)&&Ve(t)==="[object RegExp]"}function se(t){return typeof t=="object"&&t!==null}function De(t){return se(t)&&(Ve(t)==="[object Error]"||t instanceof Error)}function Ir(t){return se(t)&&Ve(t)==="[object Date]"}function Ve(t){return Object.prototype.toString.call(t)}function xi(t){let e={};return t.forEach(r=>{e[r]=!0}),e}function Ai(t,e,r,i,n){let s=[];for(let a=0,o=e.length;a<o;++a)qr(e,String(a))?s.push(Ue(t,e,r,i,String(a),!0)):s.push("");return n.forEach(a=>{a.match(/^\d+$/)||s.push(Ue(t,e,r,i,a,!0))}),s}function Fe(t){return"["+Error.prototype.toString.call(t)+"]"}function ie(t,e,r=0){if(t.customInspect&&e!=null&&_e(e)&&e?.inspect!==S&&!(e?.constructor&&e?.constructor.prototype===e)){let c=e?.inspect(r,t);return Tr(c)||(c=ie(t,c,r)),c}let i=Ri(t,e);if(i)return i;let n=Object.keys(e),s=xi(n);try{t.showHidden&&Object.getOwnPropertyNames&&(n=Object.getOwnPropertyNames(e))}catch{}if(De(e)&&(n.indexOf("message")>=0||n.indexOf("description")>=0))return Fe(e);if(n.length===0){if(_e(e)){let c=e.name?": "+e.name:"";return t.stylize("[Function"+c+"]","special")}if(Be(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Ir(e))return t.stylize(Date.prototype.toString.call(e),"date");if(De(e))return Fe(e)}let a="",o=!1,u=[`{
|
|
3
|
-
`,`
|
|
4
|
-
}`];if(Array.isArray(e)&&(o=!0,u=[`[
|
|
5
|
-
`,`
|
|
6
|
-
]`]),_e(e)&&(a=" [Function"+(e.name?": "+e.name:"")+"]"),Be(e)&&(a=" "+RegExp.prototype.toString.call(e)),Ir(e)&&(a=" "+Date.prototype.toUTCString.call(e)),De(e)&&(a=" "+Fe(e)),n.length===0&&(!o||e.length==0))return u[0]+a+u[1];if(r<0)return Be(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);let p;return o?p=Ai(t,e,r,s,n):p=n.map(c=>Ue(t,e,r,s,c,o)),t.seen.pop(),wi(p,a,u)}function Ue(t,e,r,i,n,s){let a,o,u;u={value:void 0};try{u.value=e[n]}catch{}try{Object.getOwnPropertyDescriptor&&(u=Object.getOwnPropertyDescriptor(e,n)||u)}catch{}if(u.get?u.set?o=t.stylize("[Getter/Setter]","special"):o=t.stylize("[Getter]","special"):u.set&&(o=t.stylize("[Setter]","special")),qr(i,n)||(a="["+n+"]"),o||(t.seen.indexOf(u.value)<0?(jr(r)?o=ie(t,u.value,void 0):o=ie(t,u.value,r-1),o.indexOf(`
|
|
7
|
-
`)>-1&&(s?o=o.split(`
|
|
8
|
-
`).map(p=>" "+p).join(`
|
|
9
|
-
`).substr(2):o=`
|
|
10
|
-
`+o.split(`
|
|
11
|
-
`).map(p=>" "+p).join(`
|
|
12
|
-
`))):o=t.stylize("[Circular]","special")),V(a)){if(s&&n.match(/^\d+$/))return o;a=JSON.stringify(""+n),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,"\\'").replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+o}function Ri(t,e){if(V(e))return t.stylize("undefined","undefined");if(Tr(e)){let r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,"\\'")+"'";return t.stylize(r,"string")}if(bi(e))return t.stylize(""+e,"number");if(hi(e))return t.stylize(""+e,"boolean");if(jr(e))return t.stylize("null","null")}function wi(t,e,r){return r[0]+(e===""?"":e+`
|
|
13
|
-
`)+" "+t.join(`,
|
|
14
|
-
`)+" "+r[1]}function Ei(t,e){if(!e||!se(e))return t;let r=Object.keys(e),i=r.length;for(;i--;)t[r[i]]=e[r[i]];return t}var vi={runtime:"Browser",browser:window?.navigator.userAgent};function Mr(t,e,r,i){return{...vi,name:i,date:new Date,logLevelId:t,logLevelName:e,path:Si(r)}}function Si(t){try{throw new Error("getStackTrace")}catch(e){let r=window.location.origin,i=e;if(i?.stack){let n=i?.stack?.split(`
|
|
15
|
-
`)?.filter(f=>!f.includes("Error: "))?.[t]?.replace(/^\s+at\s+/gm,"");n?.slice(-1)===")"&&(n=n?.match(/\(([^)]+)\)/)?.[1]);let s=n?.includes(":")?n?.replace("global code@","")?.replace("file://","")?.replace(r,"")?.replace(/^\s+at\s+/gm,"")?.split(":"):void 0,a=s?.pop(),o=s?.pop(),u=s?.pop()?.split("?")?.[0],p=u?.split("/").pop(),c=`${r}${u}:${o}`,l=n?.split(" (");return{fullFilePath:n,fileName:p,fileColumn:a,fileLine:o,filePath:u,filePathWithLine:c,method:l?.[0]}}return{fullFilePath:void 0,fileName:void 0,fileColumn:void 0,fileLine:void 0,filePath:void 0,filePathWithLine:void 0,method:void 0}}}function $e(t){let e=window.location.origin;return t?.stack?.split(`
|
|
16
|
-
`)?.filter(r=>!r.includes("Error: "))?.reduce((r,i)=>{i?.slice(-1)===")"&&(i=i.match(/\(([^)]+)\)/)?.[1]??""),i=i.replace(/^\s+at\s+/gm,"");let n=i.split(" ("),s=i?.slice(-1)===")"?i?.match(/\(([^)]+)\)/)?.[1]:i,a=s?.includes(":")?s?.replace("global code@","")?.replace("file://","")?.replace(e,"")?.replace(/^\s+at\s+/gm,"")?.split(":"):void 0,o=a?.pop(),u=a?.pop(),p=a?.pop()?.split("?")[0],c=p?.split("/")?.pop()?.split("?")[0],l=`${e}${p}:${u}`;return p!=null&&p.length>0&&r.push({fullFilePath:s,fileName:c,fileColumn:o,fileLine:u,filePath:p,filePathWithLine:l,method:n?.[1]!=null?n?.[0]:void 0}),r},[])}function ae(t){return t instanceof Error}function _r(t,e,r){return[t,...e].reduce((i,n)=>(ae(n)?i.errors.push(Ci(n,r)):i.args.push(n),i),{args:[],errors:[]})}function Ci(t,e){let r=$e(t).map(n=>G(e,e.prettyErrorStackTemplate,{...n},!0)),i={errorName:` ${t.name} `,errorMessage:t.message,errorStack:r.join(`
|
|
17
|
-
`)};return G(e,e.prettyErrorTemplate,i)}function Br(t,e,r,i){let n=(r.length>0&&e.length>0?`
|
|
18
|
-
`:"")+r.join(`
|
|
19
|
-
`);i.prettyInspectOptions.colors=i.stylePrettyLogs,e=e.map(s=>typeof s=="object"?S(s,i.prettyInspectOptions):s),console.log(t+e.join(" ")+n)}function Dr(t){console.log(e(t));function e(r){let i=new Set;return JSON.stringify(r,(n,s)=>{if(typeof s=="object"&&s!==null){if(i.has(s))return"[Circular]";i.add(s)}return s})}}function I(t,e=2,r=0){return t!=null&&isNaN(t)?"":(t=t!=null?t+r:t,e===2?t==null?"--":t<10?"0"+t:t.toString():t==null?"---":t<10?"00"+t:t<100?"0"+t:t.toString())}var oe=class{constructor(e,r,i=4){this.logObj=r,this.stackDepthLevel=i;let n=![typeof window,typeof document].includes("undefined"),s=Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";this.runtime=n?"browser":s?"nodejs":"unknown";let a=n?((window?.chrome||window.Intl&&Intl?.v8BreakIterator)&&"CSS"in window)!=null:!1,o=n?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1;this.stackDepthLevel=o?4:this.stackDepthLevel,this.settings={type:e?.type??"pretty",name:e?.name,parentNames:e?.parentNames,minLevel:e?.minLevel??0,argumentsArrayName:e?.argumentsArrayName,prettyLogTemplate:e?.prettyLogTemplate??"{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}} {{logLevelName}} [{{filePathWithLine}}{{nameWithDelimiterPrefix}}] ",prettyErrorTemplate:e?.prettyErrorTemplate??`
|
|
20
|
-
{{errorName}} {{errorMessage}}
|
|
21
|
-
error stack:
|
|
22
|
-
{{errorStack}}`,prettyErrorStackTemplate:e?.prettyErrorStackTemplate??` \u2022 {{fileName}} {{method}}
|
|
23
|
-
{{filePathWithLine}}`,prettyErrorParentNamesSeparator:e?.prettyErrorParentNamesSeparator??":",prettyErrorLoggerNameDelimiter:e?.prettyErrorLoggerNameDelimiter??" ",stylePrettyLogs:e?.stylePrettyLogs??!0,prettyLogStyles:e?.prettyLogStyles??{logLevelName:{"*":["bold","black","bgWhiteBright","dim"],SILLY:["bold","white"],TRACE:["bold","whiteBright"],DEBUG:["bold","green"],INFO:["bold","blue"],WARN:["bold","yellow"],ERROR:["bold","red"],FATAL:["bold","redBright"]},dateIsoStr:"white",filePathWithLine:"white",name:["white","bold"],nameWithDelimiterPrefix:["white","bold"],nameWithDelimiterSuffix:["white","bold"],errorName:["bold","bgRedBright","whiteBright"],fileName:["yellow"]},prettyInspectOptions:e?.prettyInspectOptions??{colors:!0,compact:!1,depth:1/0},metaProperty:e?.metaProperty??"_meta",maskPlaceholder:e?.maskPlaceholder??"[***]",maskValuesOfKeys:e?.maskValuesOfKeys??["password"],maskValuesOfKeysCaseInsensitive:e?.maskValuesOfKeysCaseInsensitive??!1,maskValuesRegEx:e?.maskValuesRegEx,prefix:[...e?.prefix??[]],attachedTransports:[...e?.attachedTransports??[]],overwrite:{mask:e?.overwrite?.mask,toLogObj:e?.overwrite?.toLogObj,addMeta:e?.overwrite?.addMeta,formatMeta:e?.overwrite?.formatMeta,formatLogObj:e?.overwrite?.formatLogObj,transportFormatted:e?.overwrite?.transportFormatted,transportJSON:e?.overwrite?.transportJSON}},this.settings.stylePrettyLogs=this.settings.stylePrettyLogs&&n&&!a?!1:this.settings.stylePrettyLogs}log(e,r,...i){if(e<this.settings.minLevel)return;let n=[...this.settings.prefix,...i],s=this.settings.overwrite?.mask!=null?this.settings.overwrite?.mask(n):this.settings.maskValuesOfKeys!=null&&this.settings.maskValuesOfKeys.length>0?this._mask(n):n,a=this.logObj!=null?this._recursiveCloneAndExecuteFunctions(this.logObj):void 0,o=this.settings.overwrite?.toLogObj!=null?this.settings.overwrite?.toLogObj(s,a):this._toLogObj(s,a),u=this.settings.overwrite?.addMeta!=null?this.settings.overwrite?.addMeta(o,e,r):this._addMetaToLogObj(o,e,r),p,c;return this.settings.overwrite?.formatMeta!=null&&(p=this.settings.overwrite?.formatMeta(u?.[this.settings.metaProperty])),this.settings.overwrite?.formatLogObj!=null&&(c=this.settings.overwrite?.formatLogObj(s,this.settings)),this.settings.type==="pretty"&&(p=this._prettyFormatLogObjMeta(u?.[this.settings.metaProperty]),c=_r(a,s,this.settings)),p!=null&&c!=null?this.settings.overwrite?.transportFormatted!=null?this.settings.overwrite?.transportFormatted(p,c.args,c.errors,this.settings):Br(p,c.args,c.errors,this.settings):this.settings.overwrite?.transportJSON!=null?this.settings.overwrite?.transportJSON(u):this.settings.type!=="hidden"&&Dr(u),this.settings.attachedTransports!=null&&this.settings.attachedTransports.length>0&&this.settings.attachedTransports.forEach(l=>{l(u)}),u}attachTransport(e){this.settings.attachedTransports.push(e)}getSubLogger(e,r){let i={...this.settings,...e,parentNames:this.settings?.parentNames!=null&&this.settings?.name!=null?[...this.settings.parentNames,this.settings.name]:this.settings?.name!=null?[this.settings.name]:void 0,prefix:[...this.settings.prefix,...e?.prefix??[]]};return new this.constructor(i,r??this.logObj,this.stackDepthLevel)}_mask(e){let r=this.settings.maskValuesOfKeysCaseInsensitive!==!0?this.settings.maskValuesOfKeys:this.settings.maskValuesOfKeys.map(i=>i.toLowerCase());return e?.map(i=>this._recursiveCloneAndMaskValuesOfKeys(i,r))}_recursiveCloneAndMaskValuesOfKeys(e,r,i=[]){return i.includes(e)?{...e}:(typeof e=="object"&&i.push(e),ae(e)||void 0?e:Array.isArray(e)?e.map(n=>this._recursiveCloneAndMaskValuesOfKeys(n,r,i)):e instanceof Date?new Date(e.getTime()):e!=null&&typeof e=="object"?Object.getOwnPropertyNames(e).reduce((n,s)=>(n[s]=r.includes(this.settings?.maskValuesOfKeysCaseInsensitive!==!0?s:s.toLowerCase())?this.settings.maskPlaceholder:this._recursiveCloneAndMaskValuesOfKeys(e[s],r,i),n),Object.create(Object.getPrototypeOf(e))):(n=>(this.settings?.maskValuesRegEx?.forEach(s=>{n=n?.replace(s,this.settings.maskPlaceholder)}),n))(e))}_recursiveCloneAndExecuteFunctions(e,r=[]){return r.includes(e)?{...e}:(typeof e=="object"&&r.push(e),Array.isArray(e)?e.map(i=>this._recursiveCloneAndExecuteFunctions(i,r)):e instanceof Date?new Date(e.getTime()):e&&typeof e=="object"?Object.getOwnPropertyNames(e).reduce((i,n)=>(Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n)),i[n]=typeof e[n]=="function"?e[n]():this._recursiveCloneAndExecuteFunctions(e[n],r),i),Object.create(Object.getPrototypeOf(e))):e)}_toLogObj(e,r={}){return e=e?.map(i=>ae(i)?this._toErrorObject(i):i),this.settings.argumentsArrayName==null?e.length===1&&!Array.isArray(e[0])&&(e[0],void 0)!==!0&&!(e[0]instanceof Date)?r=typeof e[0]=="object"?{...e[0],...r}:{0:e[0],...r}:r={...r,...e}:r={...r,[this.settings.argumentsArrayName]:e},r}_toErrorObject(e){return{nativeError:e,name:e.name??"Error",message:e.message,stack:$e(e)}}_addMetaToLogObj(e,r,i){return{...e,[this.settings.metaProperty]:Mr(r,i,this.stackDepthLevel,this.settings.name,this.settings.parentNames)}}_prettyFormatLogObjMeta(e){if(e==null)return"";let r=this.settings.prettyLogTemplate,i={};r.includes("{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}")?r=r.replace("{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}","{{dateIsoStr}}"):(i.yyyy=e?.date?.getFullYear()??"----",i.mm=I(e?.date?.getMonth(),2,1),i.dd=I(e?.date?.getDate(),2),i.hh=I(e?.date?.getHours(),2),i.MM=I(e?.date?.getMinutes(),2),i.ss=I(e?.date?.getSeconds(),2),i.ms=I(e?.date?.getMilliseconds(),3)),i.rawIsoStr=e?.date?.toISOString(),i.dateIsoStr=e?.date?.toISOString().replace("T"," ").replace("Z",""),i.logLevelName=e?.logLevelName,i.filePathWithLine=e?.path?.filePathWithLine,i.fullFilePath=e?.path?.fullFilePath;let n=this.settings.parentNames?.join(this.settings.prettyErrorParentNamesSeparator);return n=n!=null&&e?.name!=null?n+this.settings.prettyErrorParentNamesSeparator:void 0,i.name=e?.name!=null||n!=null?(n??"")+e?.name:"",i.nameWithDelimiterPrefix=i.name.length>0?this.settings.prettyErrorLoggerNameDelimiter+i.name:"",i.nameWithDelimiterSuffix=i.name.length>0?i.name+this.settings.prettyErrorLoggerNameDelimiter:"",G(this.settings,r,i)}};var ue=class extends oe{constructor(e,r){super(e,r,5)}log(e,r,...i){return super.log(e,r,...i)}silly(...e){return super.log(0,"SILLY",...e)}trace(...e){return super.log(1,"TRACE",...e)}debug(...e){return super.log(2,"DEBUG",...e)}info(...e){return super.log(3,"INFO",...e)}warn(...e){return super.log(4,"WARN",...e)}error(...e){return super.log(5,"ERROR",...e)}fatal(...e){return super.log(6,"FATAL",...e)}getSubLogger(e,r){return super.getSubLogger(e,r)}};var ki={prettyLogTemplate:"{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}} {{logLevelName}} [{{name}}] ",name:"Jikan-ts Logger"},Fr=(t=ki)=>new ue(t),Ur=(t,e)=>(e!==void 0&&e.info(`[Request Config] ${t.method?.toUpperCase()||""} | ${t.url||""}`),t),Vr=(t,e)=>{throw e!==void 0&&e.error(`[Request Error] CODE ${t.code||"UNKNOWN"} | ${t.message}`),t},$r=(t,e)=>(e!==void 0&&(e.info(),console.log(t.data)),t),Wr=(t,e)=>{throw e!==void 0&&e.error(`[ Response Error ] CODE ${t.code||"UNKNOWN"} | ${t.message}`),t};var C=class{api;logger;constructor(e){this.api=mt(Hr.default.create({baseURL:e?.baseURL??"https://api.jikan.moe/v4",headers:{"Content-Type":"application/json"}}),{storage:e?.cacheOptions?.storage??z.storage,generateKey:e?.cacheOptions?.generateKey??z.generateKey,headerInterpreter:e?.cacheOptions?.headerInterpreter??z.headerInterpreter,debug:e?.cacheOptions?.debug??z.debug}),e?.loggerOptions?.enabled&&(this.logger=Fr(e.loggerOptions.settings)),this.addHttpInterceptors()}addHttpInterceptors(){this.api.interceptors.request.use(e=>Ur(e,this.logger),e=>Vr(e,this.logger)),this.api.interceptors.response.use(e=>$r(e,this.logger),e=>Wr(e,this.logger))}};var ce=class extends C{constructor(e){super(e)}async getAnimeSearch(e){return new Promise((r,i)=>{let n=`${"/anime"}`;this.api.get(n,{params:e}).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimeFullById(e){return new Promise((r,i)=>{let n=`${"/anime/{id}/full".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimeById(e){return new Promise((r,i)=>{let n=`${"/anime/{id}".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimeCharacters(e){return new Promise((r,i)=>{let n=`${"/anime/{id}/characters".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimeStaff(e){return new Promise((r,i)=>{let n=`${"/anime/{id}/staff".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimeEpisodes(e){return new Promise((r,i)=>{let n=`${"/anime/{id}/episodes".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimeEpisodeById(e,r){return new Promise((i,n)=>{let s=`${"/anime/{id}/episodes/{episode}".replace("{id}",String(e)).replace("{episode}",String(r))}`;this.api.get(s).then(a=>i(a.data)).catch(a=>n(a))})}async getAnimeVideos(e){return new Promise((r,i)=>{let n=`${"/anime/{id}/videos".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimeEpisodeVideos(e){return new Promise((r,i)=>{let n=`${"/anime/{id}/videos/episodes".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimePictures(e){return new Promise((r,i)=>{let n=`${"/anime/{id}/pictures".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimeStatistics(e){return new Promise((r,i)=>{let n=`${"/anime/{id}/statistics".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimeRecommendations(e){return new Promise((r,i)=>{let n=`${"/anime/{id}/recommendations".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}};var pe=class extends C{constructor(e){super(e)}async getMangaSearch(e){return new Promise((r,i)=>{let n=`${"/manga"}`;this.api.get(n,{params:e}).then(s=>r(s.data)).catch(s=>i(s))})}async getMangaFullById(e){return new Promise((r,i)=>{let n=`${"/manga/{id}/full".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getMangaById(e){return new Promise((r,i)=>{let n=`${"/manga/{id}".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getMangaCharacters(e){return new Promise((r,i)=>{let n=`${"/manga/{id}/characters".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getMangaPictures(e){return new Promise((r,i)=>{let n=`${"/manga/{id}/pictures".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getMangaStatistics(e){return new Promise((r,i)=>{let n=`${"/manga/{id}/statistics".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getMangaRecommendations(e){return new Promise((r,i)=>{let n=`${"/manga/{id}/recommendations".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}};var le=class extends C{constructor(e){super(e)}async getTopAnime(e){return new Promise((r,i)=>{let n=`${"/top/anime"}`;this.api.get(n,{params:e}).then(s=>r(s.data)).catch(s=>i(s))})}async getTopManga(e){return new Promise((r,i)=>{let n=`${"/top/manga"}`;this.api.get(n,{params:e}).then(s=>r(s.data)).catch(s=>i(s))})}};var zr=class extends C{anime;manga;top;constructor(e){super(e),this.anime=new ce(e),this.manga=new pe(e),this.top=new le(e)}};var Pi=(a=>(a.tv="TV",a.movie="Movie",a.ova="Ova",a.special="Special",a.ona="Ona",a.music="Music",a))(Pi||{}),Oi=(i=>(i.finished="Finished Airing",i.airing="Currently Airing",i.complete="Complete",i))(Oi||{}),Ji=(a=>(a.g="g",a.pg="pg",a.pg13="pg13",a.r17="r17",a.r="r",a.rx="rx",a))(Ji||{}),Li=(n=>(n.spring="spring",n.summer="summer",n.fall="fall",n.winter="winter",n))(Li||{});var Ni=(r=>(r.main="Main",r.supporting="Supporting",r))(Ni||{});var Ii=(o=>(o.manga="Manga",o.novel="Novel",o.lightnovel="Lightnovel",o.oneshot="Oneshot",o.doujin="Doujin",o.manwha="Manwha",o.manhua="Manhua",o))(Ii||{}),Ti=(s=>(s.publishing="Publishing",s.complete="Complete",s.hiatus="Hiatus",s.discontinued="Discontinued",s.upcoming="Upcoming",s))(Ti||{});var ji=(r=>(r.asc="asc",r.desc="desc",r))(ji||{}),qi=(c=>(c.mal_id="mal_id",c.title="title",c.start_date="start_date",c.end_date="end_date",c.score="score",c.scored_by="scored_by",c.rank="rank",c.popularity="popularity",c.members="members",c.favorites="favorites",c))(qi||{}),Mi=(i=>(i.type="type",i.rating="rating",i.episodes="episodes",i))(Mi||{}),_i=(r=>(r.chapters="chapters",r.volumes="volumes",r))(_i||{});var Bi=(n=>(n.airing="airing",n.upcoming="upcoming",n.bypopularity="bypopularity",n.favorite="favorite",n))(Bi||{}),Di=(n=>(n.publishing="publishing",n.upcoming="upcoming",n.bypopularity="bypopularity",n.favorite="favorite",n))(Di||{});export{ce as AnimeClient,Jr as AnimeEndpoints,Ji as AnimeRating,Mi as AnimeSearchOrder,Li as AnimeSeason,Oi as AnimeStatus,Pi as AnimeType,C as BaseClient,Or as BaseURL,Ni as CharacterRole,z as DEFAULT_CACHE_OPTIONS,ki as DEFAULT_LOGGER_SETTINGS,zr as JikanClient,pe as MangaClient,Lr as MangaEndpoints,_i as MangaSearchOrder,Ti as MangaStatus,Ii as MangaType,qi as SearchOrder,ji as SortOptions,Bi as TopAnimeFilter,le as TopClient,Nr as TopEndpoints,Di as TopMangaFilter,Fr as createLogger,Ur as handleRequest,Vr as handleRequestError,$r as handleResponse,Wr as handleResponseError};
|
|
1
|
+
import{setupCache as w}from"axios-cache-interceptor";import _ from"axios";var f=(n=>(n.REST="https://api.jikan.moe/v4",n))(f||{});var C=(m=>(m.AnimeSearch="/anime",m.AnimeFullById="/anime/{id}/full",m.AnimeById="/anime/{id}",m.AnimeCharacters="/anime/{id}/characters",m.AnimeStaff="/anime/{id}/staff",m.AnimeEpisodes="/anime/{id}/episodes",m.AnimeEpisodeById="/anime/{id}/episodes/{episode}",m.AnimeVideos="/anime/{id}/videos",m.AnimeVideosEpisodes="/anime/{id}/videos/episodes",m.AnimePictures="/anime/{id}/pictures",m.AnimeStatistics="/anime/{id}/statistics",m.AnimeRecommendations="/anime/{id}/recommendations",m))(C||{}),P=(t=>(t.MangaSearch="/manga",t.MangaFullById="/manga/{id}/full",t.MangaById="/manga/{id}",t.MangaCharacters="/manga/{id}/characters",t.MangaPictures="/manga/{id}/pictures",t.MangaStatistics="/manga/{id}/statistics",t.MangaRecommendations="/manga/{id}/recommendations",t))(P||{}),y=(i=>(i.TopAnime="/top/anime",i.TopManga="/top/manga",i))(y||{});import{buildMemoryStorage as I,defaultHeaderInterpreter as E,defaultKeyGenerator as S}from"axios-cache-interceptor";var g={storage:I(),generateKey:S,headerInterpreter:E,debug:void 0},R=r=>({storage:r?.storage??g.storage,generateKey:r?.generateKey??g.generateKey,headerInterpreter:r?.headerInterpreter??g.headerInterpreter,debug:r?.debug??g.debug});import{Logger as M}from"tslog";var L={prettyLogTemplate:"{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}} {{logLevelName}} [{{name}}] ",name:"Jikan-ts Logger"},l=(r=L)=>new M(r),A=(r,n)=>(n.info(`[Request Config] ${r.method?.toUpperCase()||""} | ${r.url||""}`),r),k=(r,n)=>{throw n.error(`[Request Error] CODE ${r.code||"UNKNOWN"} | ${r.message}`),r},J=(r,n)=>(n.info(),console.log(r.data),r),x=(r,n)=>{throw n.error(`[ Response Error ] CODE ${r.code||"UNKNOWN"} | ${r.message}`),r};var c=class{api;constructor(n={}){if(this.api=w(_.create({baseURL:n.baseURL??"https://api.jikan.moe/v4",headers:{"Content-Type":"application/json"}}),R(n.cacheOptions)),n.loggerOptions?.enabled){let i=l(n.loggerOptions.settings);this.addHttpInterceptors(i)}}addHttpInterceptors(n){this.api.interceptors.request.use(i=>A(i,n),i=>k(i,n)),this.api.interceptors.response.use(i=>J(i,n),i=>x(i,n))}};var u=class extends c{constructor(n){super(n)}async getAnimeSearch(n){return new Promise((i,a)=>{let s=`${"/anime"}`;this.api.get(s,{params:n}).then(e=>i(e.data)).catch(e=>a(e))})}async getAnimeFullById(n){return new Promise((i,a)=>{let s=`${"/anime/{id}/full".replace("{id}",String(n))}`;this.api.get(s).then(e=>i(e.data)).catch(e=>a(e))})}async getAnimeById(n){return new Promise((i,a)=>{let s=`${"/anime/{id}".replace("{id}",String(n))}`;this.api.get(s).then(e=>i(e.data)).catch(e=>a(e))})}async getAnimeCharacters(n){return new Promise((i,a)=>{let s=`${"/anime/{id}/characters".replace("{id}",String(n))}`;this.api.get(s).then(e=>i(e.data)).catch(e=>a(e))})}async getAnimeStaff(n){return new Promise((i,a)=>{let s=`${"/anime/{id}/staff".replace("{id}",String(n))}`;this.api.get(s).then(e=>i(e.data)).catch(e=>a(e))})}async getAnimeEpisodes(n){return new Promise((i,a)=>{let s=`${"/anime/{id}/episodes".replace("{id}",String(n))}`;this.api.get(s).then(e=>i(e.data)).catch(e=>a(e))})}async getAnimeEpisodeById(n,i){return new Promise((a,s)=>{let e=`${"/anime/{id}/episodes/{episode}".replace("{id}",String(n)).replace("{episode}",String(i))}`;this.api.get(e).then(o=>a(o.data)).catch(o=>s(o))})}async getAnimeVideos(n){return new Promise((i,a)=>{let s=`${"/anime/{id}/videos".replace("{id}",String(n))}`;this.api.get(s).then(e=>i(e.data)).catch(e=>a(e))})}async getAnimeEpisodeVideos(n){return new Promise((i,a)=>{let s=`${"/anime/{id}/videos/episodes".replace("{id}",String(n))}`;this.api.get(s).then(e=>i(e.data)).catch(e=>a(e))})}async getAnimePictures(n){return new Promise((i,a)=>{let s=`${"/anime/{id}/pictures".replace("{id}",String(n))}`;this.api.get(s).then(e=>i(e.data)).catch(e=>a(e))})}async getAnimeStatistics(n){return new Promise((i,a)=>{let s=`${"/anime/{id}/statistics".replace("{id}",String(n))}`;this.api.get(s).then(e=>i(e.data)).catch(e=>a(e))})}async getAnimeRecommendations(n){return new Promise((i,a)=>{let s=`${"/anime/{id}/recommendations".replace("{id}",String(n))}`;this.api.get(s).then(e=>i(e.data)).catch(e=>a(e))})}};var d=class extends c{constructor(n){super(n)}async getMangaSearch(n){return new Promise((i,a)=>{let s=`${"/manga"}`;this.api.get(s,{params:n}).then(e=>i(e.data)).catch(e=>a(e))})}async getMangaFullById(n){return new Promise((i,a)=>{let s=`${"/manga/{id}/full".replace("{id}",String(n))}`;this.api.get(s).then(e=>i(e.data)).catch(e=>a(e))})}async getMangaById(n){return new Promise((i,a)=>{let s=`${"/manga/{id}".replace("{id}",String(n))}`;this.api.get(s).then(e=>i(e.data)).catch(e=>a(e))})}async getMangaCharacters(n){return new Promise((i,a)=>{let s=`${"/manga/{id}/characters".replace("{id}",String(n))}`;this.api.get(s).then(e=>i(e.data)).catch(e=>a(e))})}async getMangaPictures(n){return new Promise((i,a)=>{let s=`${"/manga/{id}/pictures".replace("{id}",String(n))}`;this.api.get(s).then(e=>i(e.data)).catch(e=>a(e))})}async getMangaStatistics(n){return new Promise((i,a)=>{let s=`${"/manga/{id}/statistics".replace("{id}",String(n))}`;this.api.get(s).then(e=>i(e.data)).catch(e=>a(e))})}async getMangaRecommendations(n){return new Promise((i,a)=>{let s=`${"/manga/{id}/recommendations".replace("{id}",String(n))}`;this.api.get(s).then(e=>i(e.data)).catch(e=>a(e))})}};var h=class extends c{constructor(n){super(n)}async getTopAnime(n){return new Promise((i,a)=>{let s=`${"/top/anime"}`;this.api.get(s,{params:n}).then(e=>i(e.data)).catch(e=>a(e))})}async getTopManga(n){return new Promise((i,a)=>{let s=`${"/top/manga"}`;this.api.get(s,{params:n}).then(e=>i(e.data)).catch(e=>a(e))})}};var b=class{anime;manga;top;constructor(n){this.anime=new u(n),this.manga=new d(n),this.top=new h(n)}};var v=(o=>(o.tv="TV",o.movie="Movie",o.ova="Ova",o.special="Special",o.ona="Ona",o.music="Music",o))(v||{}),$=(a=>(a.finished="Finished Airing",a.airing="Currently Airing",a.complete="Complete",a))($||{}),T=(o=>(o.g="g",o.pg="pg",o.pg13="pg13",o.r17="r17",o.r="r",o.rx="rx",o))(T||{}),B=(s=>(s.spring="spring",s.summer="summer",s.fall="fall",s.winter="winter",s))(B||{});var V=(i=>(i.main="Main",i.supporting="Supporting",i))(V||{});var j=(t=>(t.manga="Manga",t.novel="Novel",t.lightnovel="Lightnovel",t.oneshot="Oneshot",t.doujin="Doujin",t.manhwa="Manhwa",t.manhua="Manhua",t))(j||{}),O=(e=>(e.publishing="Publishing",e.complete="Complete",e.hiatus="Hiatus",e.discontinued="Discontinued",e.upcoming="Upcoming",e))(O||{});var N=(i=>(i.asc="asc",i.desc="desc",i))(N||{}),q=(p=>(p.mal_id="mal_id",p.title="title",p.start_date="start_date",p.end_date="end_date",p.score="score",p.scored_by="scored_by",p.rank="rank",p.popularity="popularity",p.members="members",p.favorites="favorites",p))(q||{}),U=(a=>(a.type="type",a.rating="rating",a.episodes="episodes",a))(U||{}),D=(i=>(i.chapters="chapters",i.volumes="volumes",i))(D||{});var K=(s=>(s.airing="airing",s.upcoming="upcoming",s.bypopularity="bypopularity",s.favorite="favorite",s))(K||{}),H=(s=>(s.publishing="publishing",s.upcoming="upcoming",s.bypopularity="bypopularity",s.favorite="favorite",s))(H||{});export{u as AnimeClient,C as AnimeEndpoints,T as AnimeRating,U as AnimeSearchOrder,B as AnimeSeason,$ as AnimeStatus,v as AnimeType,c as BaseClient,f as BaseURL,V as CharacterRole,g as DEFAULT_CACHE_OPTIONS,L as DEFAULT_LOGGER_SETTINGS,b as JikanClient,d as MangaClient,P as MangaEndpoints,D as MangaSearchOrder,O as MangaStatus,j as MangaType,q as SearchOrder,N as SortOptions,K as TopAnimeFilter,h as TopClient,y as TopEndpoints,H as TopMangaFilter,l as createLogger,R as getCacheOptions,A as handleRequest,k as handleRequestError,J as handleResponse,x as handleResponseError};
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tutkli/jikan-ts",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Node.js wrapper for the Jikan API with build-in typings.",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"type": "module",
|
|
9
|
+
"sideEffects": false,
|
|
9
10
|
"scripts": {
|
|
10
11
|
"prebuild": "rimraf dist",
|
|
11
12
|
"build": "yarn run esbuild && yarn run build-types",
|
|
@@ -30,38 +31,33 @@
|
|
|
30
31
|
"name": "Clara Castillo",
|
|
31
32
|
"url": "https://github.com/tutkli"
|
|
32
33
|
},
|
|
33
|
-
"
|
|
34
|
-
{
|
|
35
|
-
"type": "MIT",
|
|
36
|
-
"url": "https://github.com/tutkli/jikan-ts/blob/main/LICENSE"
|
|
37
|
-
}
|
|
38
|
-
],
|
|
34
|
+
"license": "MIT",
|
|
39
35
|
"bugs": {
|
|
40
36
|
"url": "https://github.com/tutkli/jikan-ts/issues"
|
|
41
37
|
},
|
|
42
38
|
"homepage": "https://github.com/tutkli/jikan-ts#readme",
|
|
43
39
|
"dependencies": {
|
|
44
|
-
"axios": "
|
|
45
|
-
"axios-cache-interceptor": "
|
|
46
|
-
"
|
|
47
|
-
"tslog": "4.5.0"
|
|
40
|
+
"axios": "1.2.2",
|
|
41
|
+
"axios-cache-interceptor": "1.0.0",
|
|
42
|
+
"tslog": "4.7.1"
|
|
48
43
|
},
|
|
49
44
|
"devDependencies": {
|
|
50
|
-
"@swc/core": "1.3.
|
|
45
|
+
"@swc/core": "1.3.25",
|
|
51
46
|
"@swc/jest": "^0.2.23",
|
|
52
|
-
"@types/jest": "29.2.
|
|
53
|
-
"@types/node": "18.11.
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
55
|
-
"@typescript-eslint/parser": "5.
|
|
47
|
+
"@types/jest": "29.2.5",
|
|
48
|
+
"@types/node": "18.11.18",
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "5.48.1",
|
|
50
|
+
"@typescript-eslint/parser": "5.48.1",
|
|
56
51
|
"dts-bundle-generator": "^7.1.0",
|
|
57
|
-
"esbuild": "0.16.
|
|
58
|
-
"
|
|
59
|
-
"eslint
|
|
60
|
-
"eslint-
|
|
52
|
+
"esbuild": "0.16.16",
|
|
53
|
+
"esbuild-node-externals": "^1.6.0",
|
|
54
|
+
"eslint": "8.31.0",
|
|
55
|
+
"eslint-config-prettier": "8.6.0",
|
|
56
|
+
"eslint-plugin-jest": "27.2.1",
|
|
61
57
|
"eslint-plugin-node": "^11.1.0",
|
|
62
58
|
"eslint-plugin-prettier": "^4.2.1",
|
|
63
59
|
"jest": "^29.3.1",
|
|
64
|
-
"prettier": "
|
|
60
|
+
"prettier": "2.8.2",
|
|
65
61
|
"rimraf": "^3.0.2",
|
|
66
62
|
"typescript": "4.9.4"
|
|
67
63
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
# v0.6 (21/12/2022)
|
|
2
|
-
|
|
3
|
-
### BREAKING CHANGES
|
|
4
|
-
|
|
5
|
-
- `JikanUniqueResponse` has been removed. Now all the request return `JikanResponse` with the corresponding data Type.
|
|
6
|
-
- `JikanUniqueResource` has been renamed to `JikanResource`.
|
|
7
|
-
|
|
8
|
-
### MangaClient
|
|
9
|
-
|
|
10
|
-
- Correct `getMangaStatistics` function name.
|
|
11
|
-
- Correct `getEpisodeVideos` function name.
|
|
12
|
-
|
|
13
|
-
### AnimeClient
|
|
14
|
-
|
|
15
|
-
- Correct `getEpisodeVideos` function name.
|
|
16
|
-
|
|
17
|
-
### Tests
|
|
18
|
-
|
|
19
|
-
- Complete coverage of all the clients.
|
|
20
|
-
|
|
21
|
-
### Docs
|
|
22
|
-
|
|
23
|
-
- Remove typedoc documentation generator.
|
|
24
|
-
- Launch new documentation page! https://tutkli.github.io/jikan-ts-docs/
|
|
25
|
-
|
|
26
|
-
<!-- CHANGELOG SPLIT MARKER -->
|
|
27
|
-
|
|
28
|
-
# v0.5.52 (26/11/2022)
|
|
29
|
-
|
|
30
|
-
### Build
|
|
31
|
-
|
|
32
|
-
- Remove yarn-check from package as it has vulnerable dependencies
|
|
33
|
-
|
|
34
|
-
### Docs
|
|
35
|
-
|
|
36
|
-
- Complete docs overhaul
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<!-- CHANGELOG SPLIT MARKER -->
|
|
40
|
-
|
|
41
|
-
# v0.5.5 (26/11/2022)
|
|
42
|
-
|
|
43
|
-
### Build
|
|
44
|
-
|
|
45
|
-
- Replace parcel with esbuild
|
|
46
|
-
- Update dependencies
|
|
47
|
-
|
|
48
|
-
### Clients
|
|
49
|
-
|
|
50
|
-
- Replace Pino with tslog
|
|
51
|
-
- Fix exporting TopClient
|
|
52
|
-
|
|
53
|
-
<!-- CHANGELOG SPLIT MARKER -->
|
|
54
|
-
|
|
55
|
-
# v0.5.42 (13/11/2022)
|
|
56
|
-
|
|
57
|
-
### Models
|
|
58
|
-
|
|
59
|
-
- Fix typo in anime model
|
|
60
|
-
|
|
61
|
-
<!-- CHANGELOG SPLIT MARKER -->
|
|
62
|
-
|
|
63
|
-
# v0.5.4 (13/11/2022)
|
|
64
|
-
|
|
65
|
-
### Build
|
|
66
|
-
|
|
67
|
-
- Add .npmignore
|
|
68
|
-
|
|
69
|
-
<!-- CHANGELOG SPLIT MARKER -->
|
|
70
|
-
|
|
71
|
-
# v0.5.3 (13/11/2022)
|
|
72
|
-
|
|
73
|
-
### Bugs
|
|
74
|
-
|
|
75
|
-
- Fix pino logger imports
|
|
76
|
-
|
|
77
|
-
<!-- CHANGELOG SPLIT MARKER -->
|
|
78
|
-
|
|
79
|
-
# v0.5.2 (12/11/2022)
|
|
80
|
-
|
|
81
|
-
### Config
|
|
82
|
-
|
|
83
|
-
- Change TS module config to "es2022"
|
|
84
|
-
|
|
85
|
-
### Bugs
|
|
86
|
-
|
|
87
|
-
- Fix pino logger imports
|
|
88
|
-
|
|
89
|
-
<!-- CHANGELOG SPLIT MARKER -->
|
|
90
|
-
|
|
91
|
-
# v0.5.1 (12/11/2022)
|
|
92
|
-
|
|
93
|
-
### Modules
|
|
94
|
-
|
|
95
|
-
- Fix exporting Params module
|
|
96
|
-
|
|
97
|
-
### Build
|
|
98
|
-
|
|
99
|
-
- Add lint script
|
|
100
|
-
|
|
101
|
-
<!-- CHANGELOG SPLIT MARKER -->
|
|
102
|
-
|
|
103
|
-
# v0.5.0 (12/11/2022)
|
|
104
|
-
|
|
105
|
-
### Test
|
|
106
|
-
|
|
107
|
-
- Added Client tests
|
|
108
|
-
|
|
109
|
-
<!-- CHANGELOG SPLIT MARKER -->
|
|
110
|
-
|
|
111
|
-
# v0.4.0 (12/11/2022)
|
|
112
|
-
|
|
113
|
-
### Clients
|
|
114
|
-
|
|
115
|
-
- Added TopClient
|
|
116
|
-
- Added search queryParams to AnimeClient, MangaClient and TopClient.
|
|
117
|
-
|
|
118
|
-
### Docs
|
|
119
|
-
|
|
120
|
-
- Improve models and clients documentation
|
|
121
|
-
|
|
122
|
-
<!-- CHANGELOG SPLIT MARKER -->
|
|
123
|
-
|
|
124
|
-
# v0.3.0 (12/11/2022)
|
|
125
|
-
|
|
126
|
-
### Clients
|
|
127
|
-
|
|
128
|
-
- More endpoints added to the MangaClient:
|
|
129
|
-
- getMangaCharacters
|
|
130
|
-
- getMangaPictures
|
|
131
|
-
- getMangaStatistics
|
|
132
|
-
- getMangaRecommendations
|