@book000/pixivts 0.58.0 → 0.59.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.cjs +42 -7
- package/dist/index.d.cts +176 -162
- package/dist/index.d.ts +176 -162
- package/dist/index.js +42 -7
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -377,7 +377,7 @@ declare class HttpClient {
|
|
|
377
377
|
* - `.pages()` is an async generator that yields each page
|
|
378
378
|
* - `.items()` is an async generator that yields individual items across all pages
|
|
379
379
|
*
|
|
380
|
-
* Pagination uses the `
|
|
380
|
+
* Pagination uses the `nextUrl` field returned by list endpoints. The URL is
|
|
381
381
|
* fetched via `HttpClient.getAbsolute()` which reuses the same auth / retry /
|
|
382
382
|
* interceptor pipeline as regular requests.
|
|
383
383
|
*/
|
|
@@ -385,17 +385,17 @@ declare class HttpClient {
|
|
|
385
385
|
/**
|
|
386
386
|
* A page returned by a pixiv list endpoint.
|
|
387
387
|
*
|
|
388
|
-
* Must have a `
|
|
388
|
+
* Must have a `nextUrl` field (null when there are no more pages).
|
|
389
389
|
*/
|
|
390
390
|
interface PagedResponse {
|
|
391
391
|
/** URL to the next page, or `null` when there are no more pages. */
|
|
392
|
-
|
|
392
|
+
nextUrl: string | null;
|
|
393
393
|
}
|
|
394
394
|
/**
|
|
395
395
|
* A `ResultAsync<TPage, PixivError>` with additional `.pages()` / `.items()`
|
|
396
396
|
* async generators for consuming paginated pixiv list responses.
|
|
397
397
|
*
|
|
398
|
-
* Returned by all resource methods that produce a `
|
|
398
|
+
* Returned by all resource methods that produce a `nextUrl` field.
|
|
399
399
|
*/
|
|
400
400
|
declare class PaginatedResultAsync<TPage extends PagedResponse, TItem> extends ResultAsync<TPage, PixivError> {
|
|
401
401
|
#private;
|
|
@@ -481,8 +481,8 @@ interface ParsedNextUrl {
|
|
|
481
481
|
* @example
|
|
482
482
|
* ```ts
|
|
483
483
|
* const page = await client.users.bookmarks.illusts({ userId: client.userId })
|
|
484
|
-
* if (page.isOk && page.value.
|
|
485
|
-
* const cursor = parseNextUrl(page.value.
|
|
484
|
+
* if (page.isOk && page.value.nextUrl) {
|
|
485
|
+
* const cursor = parseNextUrl(page.value.nextUrl)
|
|
486
486
|
* // Resume later:
|
|
487
487
|
* const next = await client.users.bookmarks.illusts({
|
|
488
488
|
* userId: client.userId,
|
|
@@ -497,11 +497,11 @@ interface ParsedNextUrl {
|
|
|
497
497
|
declare function parseNextUrl(url: string): ParsedNextUrl;
|
|
498
498
|
|
|
499
499
|
/**
|
|
500
|
-
* Public option
|
|
500
|
+
* Public option constants for @book000/pixivts.
|
|
501
501
|
*
|
|
502
|
-
* Each option is exported as
|
|
503
|
-
*
|
|
504
|
-
*
|
|
502
|
+
* Each option is exported as a runtime `const` object for enum-like access
|
|
503
|
+
* (e.g. `BookmarkRestrict.PUBLIC`). Plain string literals are also accepted
|
|
504
|
+
* wherever these values are used as parameters.
|
|
505
505
|
*
|
|
506
506
|
* @example
|
|
507
507
|
* ```ts
|
|
@@ -526,7 +526,6 @@ declare const SearchTarget: {
|
|
|
526
526
|
readonly TITLE_AND_CAPTION: "title_and_caption";
|
|
527
527
|
readonly KEYWORD: "keyword";
|
|
528
528
|
};
|
|
529
|
-
type SearchTarget = (typeof SearchTarget)[keyof typeof SearchTarget];
|
|
530
529
|
/**
|
|
531
530
|
* Sort order for search results.
|
|
532
531
|
*
|
|
@@ -539,7 +538,6 @@ declare const SearchSort: {
|
|
|
539
538
|
readonly DATE_ASC: "date_asc";
|
|
540
539
|
readonly POPULAR_DESC: "popular_desc";
|
|
541
540
|
};
|
|
542
|
-
type SearchSort = (typeof SearchSort)[keyof typeof SearchSort];
|
|
543
541
|
/**
|
|
544
542
|
* Date range filter for search results.
|
|
545
543
|
*
|
|
@@ -552,7 +550,6 @@ declare const SearchDuration: {
|
|
|
552
550
|
readonly WITHIN_LAST_WEEK: "within_last_week";
|
|
553
551
|
readonly WITHIN_LAST_MONTH: "within_last_month";
|
|
554
552
|
};
|
|
555
|
-
type SearchDuration = (typeof SearchDuration)[keyof typeof SearchDuration];
|
|
556
553
|
/**
|
|
557
554
|
* Ranking mode for illust rankings.
|
|
558
555
|
*
|
|
@@ -573,7 +570,6 @@ declare const RankingMode: {
|
|
|
573
570
|
readonly DAY_FEMALE_R18: "day_female_r18";
|
|
574
571
|
readonly DAY_R18_AI: "day_r18_ai";
|
|
575
572
|
};
|
|
576
|
-
type RankingMode = (typeof RankingMode)[keyof typeof RankingMode];
|
|
577
573
|
/**
|
|
578
574
|
* Ranking mode for novel rankings.
|
|
579
575
|
*
|
|
@@ -589,7 +585,6 @@ declare const NovelRankingMode: {
|
|
|
589
585
|
readonly WEEK_R18: "week_r18";
|
|
590
586
|
readonly DAY_R18_AI: "day_r18_ai";
|
|
591
587
|
};
|
|
592
|
-
type NovelRankingMode = (typeof NovelRankingMode)[keyof typeof NovelRankingMode];
|
|
593
588
|
/**
|
|
594
589
|
* Visibility restriction for bookmarks.
|
|
595
590
|
*
|
|
@@ -600,7 +595,6 @@ declare const BookmarkRestrict: {
|
|
|
600
595
|
readonly PUBLIC: "public";
|
|
601
596
|
readonly PRIVATE: "private";
|
|
602
597
|
};
|
|
603
|
-
type BookmarkRestrict = (typeof BookmarkRestrict)[keyof typeof BookmarkRestrict];
|
|
604
598
|
/**
|
|
605
599
|
* Visibility restriction for follows.
|
|
606
600
|
*
|
|
@@ -611,7 +605,6 @@ declare const FollowRestrict: {
|
|
|
611
605
|
readonly PUBLIC: "public";
|
|
612
606
|
readonly PRIVATE: "private";
|
|
613
607
|
};
|
|
614
|
-
type FollowRestrict = (typeof FollowRestrict)[keyof typeof FollowRestrict];
|
|
615
608
|
/**
|
|
616
609
|
* OS filter used to request works compatible with the given platform.
|
|
617
610
|
*
|
|
@@ -622,7 +615,6 @@ declare const OSFilter: {
|
|
|
622
615
|
readonly FOR_IOS: "for_ios";
|
|
623
616
|
readonly FOR_ANDROID: "for_android";
|
|
624
617
|
};
|
|
625
|
-
type OSFilter = (typeof OSFilter)[keyof typeof OSFilter];
|
|
626
618
|
/**
|
|
627
619
|
* Work type filter for user illust listings.
|
|
628
620
|
*
|
|
@@ -633,7 +625,6 @@ declare const UserIllustType: {
|
|
|
633
625
|
readonly ILLUST: "illust";
|
|
634
626
|
readonly MANGA: "manga";
|
|
635
627
|
};
|
|
636
|
-
type UserIllustType = (typeof UserIllustType)[keyof typeof UserIllustType];
|
|
637
628
|
|
|
638
629
|
/**
|
|
639
630
|
* Public types for @book000/pixivts.
|
|
@@ -652,12 +643,12 @@ type UserIllustType = (typeof UserIllustType)[keyof typeof UserIllustType];
|
|
|
652
643
|
*/
|
|
653
644
|
interface ImageUrls {
|
|
654
645
|
/** 360×360 thumbnail */
|
|
655
|
-
|
|
646
|
+
squareMedium: string;
|
|
656
647
|
/** Long side ≤ 540 px */
|
|
657
648
|
medium: string;
|
|
658
649
|
/** Width ≤ 600 px, height ≤ 1200 px */
|
|
659
650
|
large: string;
|
|
660
|
-
/** Original image (present in `
|
|
651
|
+
/** Original image (present in `metaPages` entries only) */
|
|
661
652
|
original?: string;
|
|
662
653
|
}
|
|
663
654
|
/** Profile image URLs for a user. */
|
|
@@ -683,22 +674,22 @@ interface PixivUser {
|
|
|
683
674
|
/** Login account name (distinct from the display `name`). */
|
|
684
675
|
account: string;
|
|
685
676
|
/** Set of profile image URLs at different sizes. */
|
|
686
|
-
|
|
677
|
+
profileImageUrls: ProfileImageUrls;
|
|
687
678
|
/** Whether the authenticated user follows this user. */
|
|
688
|
-
|
|
679
|
+
isFollowed?: boolean;
|
|
689
680
|
/** Whether this user has blocked access by the authenticated user. */
|
|
690
|
-
|
|
681
|
+
isAccessBlockingUser?: boolean;
|
|
691
682
|
/** Whether this user accepts illustration commission requests. */
|
|
692
|
-
|
|
683
|
+
isAcceptRequest?: boolean;
|
|
693
684
|
}
|
|
694
685
|
/** Tag on a work. */
|
|
695
686
|
interface Tag {
|
|
696
687
|
/** Tag name in Japanese. */
|
|
697
688
|
name: string;
|
|
698
689
|
/** Translated tag name, or `null` if no translation is available. */
|
|
699
|
-
|
|
690
|
+
translatedName: string | null;
|
|
700
691
|
/** Whether the tag was added by the work's uploader. */
|
|
701
|
-
|
|
692
|
+
addedByUploadedUser?: boolean;
|
|
702
693
|
}
|
|
703
694
|
/** Series information embedded in a work item. */
|
|
704
695
|
interface Series {
|
|
@@ -719,12 +710,12 @@ interface PrivacyPolicy {
|
|
|
719
710
|
/** Original-image URL for a single-page illust. */
|
|
720
711
|
interface MetaSinglePage {
|
|
721
712
|
/** Direct URL to the original-resolution image. */
|
|
722
|
-
|
|
713
|
+
originalImageUrl: string;
|
|
723
714
|
}
|
|
724
715
|
/** Per-page image URLs for a multi-page work (manga). */
|
|
725
716
|
interface MetaPages {
|
|
726
717
|
/** Full set of image URLs for this page, including the original. */
|
|
727
|
-
|
|
718
|
+
imageUrls: Required<ImageUrls>;
|
|
728
719
|
}
|
|
729
720
|
/**
|
|
730
721
|
* A pixiv illust or manga work item as returned by the API.
|
|
@@ -745,7 +736,7 @@ interface PixivIllustItem {
|
|
|
745
736
|
/** Work category: illustration, manga, or animated illustration. */
|
|
746
737
|
type: 'illust' | 'manga' | 'ugoira';
|
|
747
738
|
/** Thumbnail image URLs at various sizes. */
|
|
748
|
-
|
|
739
|
+
imageUrls: ImageUrls;
|
|
749
740
|
/** Work caption / description (may contain HTML). */
|
|
750
741
|
caption: string;
|
|
751
742
|
/** Content restriction level (0 = public, 1 = mypixiv-only, 2 = private). */
|
|
@@ -757,46 +748,46 @@ interface PixivIllustItem {
|
|
|
757
748
|
/** Creation tools listed by the author (e.g. "Photoshop"). */
|
|
758
749
|
tools: string[];
|
|
759
750
|
/** ISO 8601 date-time string of when the work was posted. */
|
|
760
|
-
|
|
751
|
+
createDate: string;
|
|
761
752
|
/** Number of images in a multi-page work (1 for single-page). */
|
|
762
|
-
|
|
753
|
+
pageCount: number;
|
|
763
754
|
/** Canvas width in pixels. */
|
|
764
755
|
width: number;
|
|
765
756
|
/** Canvas height in pixels. */
|
|
766
757
|
height: number;
|
|
767
758
|
/** Sanity / sensitivity level assigned by the pixiv content filter. */
|
|
768
|
-
|
|
759
|
+
sanityLevel: number;
|
|
769
760
|
/** Age restriction: 0 = all-ages, 1 = R-18, 2 = R-18G */
|
|
770
|
-
|
|
761
|
+
xRestrict: number;
|
|
771
762
|
/** Series this work belongs to, or `null` if not part of a series. */
|
|
772
763
|
series: Series | null;
|
|
773
764
|
/**
|
|
774
|
-
* For single-page works: `{
|
|
765
|
+
* For single-page works: `{ originalImageUrl: string }`.
|
|
775
766
|
* For multi-page works: `{}` (empty object).
|
|
776
767
|
*/
|
|
777
|
-
|
|
768
|
+
metaSinglePage: MetaSinglePage | Record<string, never>;
|
|
778
769
|
/** Per-page image URLs for multi-page works (empty array for single-page). */
|
|
779
|
-
|
|
770
|
+
metaPages: MetaPages[];
|
|
780
771
|
/** Total number of views. */
|
|
781
|
-
|
|
772
|
+
totalView: number;
|
|
782
773
|
/** Total number of bookmarks. */
|
|
783
|
-
|
|
774
|
+
totalBookmarks: number;
|
|
784
775
|
/** Whether the authenticated user has bookmarked this work. */
|
|
785
|
-
|
|
776
|
+
isBookmarked: boolean;
|
|
786
777
|
/** Whether the work is publicly visible. */
|
|
787
778
|
visible: boolean;
|
|
788
779
|
/** Whether the work is muted for the authenticated user. */
|
|
789
|
-
|
|
780
|
+
isMuted: boolean;
|
|
790
781
|
/** Total number of comments (may be absent on some endpoints). */
|
|
791
|
-
|
|
782
|
+
totalComments?: number;
|
|
792
783
|
/** AI-generated content flag: 0 = no AI, 1 = partial AI, 2 = fully AI */
|
|
793
|
-
|
|
784
|
+
illustAiType: number;
|
|
794
785
|
/** Book-style rendering flag (0 = normal, 1 = book). */
|
|
795
|
-
|
|
786
|
+
illustBookStyle: number;
|
|
796
787
|
/** Controls who can post comments (may be absent). */
|
|
797
|
-
|
|
788
|
+
commentAccessControl?: number;
|
|
798
789
|
/** Additional access-restriction attributes (may be absent). */
|
|
799
|
-
|
|
790
|
+
restrictionAttributes?: string[];
|
|
800
791
|
}
|
|
801
792
|
/** Illust series metadata returned by GET /v1/illust/series. */
|
|
802
793
|
interface IllustSeriesDetail {
|
|
@@ -807,13 +798,13 @@ interface IllustSeriesDetail {
|
|
|
807
798
|
/** Series description / caption. */
|
|
808
799
|
caption: string;
|
|
809
800
|
/** Cover image URLs. */
|
|
810
|
-
|
|
801
|
+
coverImageUrls: {
|
|
811
802
|
medium: string;
|
|
812
803
|
};
|
|
813
804
|
/** Number of works in the series. */
|
|
814
|
-
|
|
805
|
+
seriesWorkCount: number;
|
|
815
806
|
/** ISO 8601 date-time string of when the series was created. */
|
|
816
|
-
|
|
807
|
+
createDate: string;
|
|
817
808
|
/** Canvas width of the cover image in pixels. */
|
|
818
809
|
width: number;
|
|
819
810
|
/** Canvas height of the cover image in pixels. */
|
|
@@ -821,7 +812,7 @@ interface IllustSeriesDetail {
|
|
|
821
812
|
/** Author of the series. */
|
|
822
813
|
user: PixivUser;
|
|
823
814
|
/** Whether the authenticated user has added this series to their watchlist. */
|
|
824
|
-
|
|
815
|
+
watchlistAdded: boolean;
|
|
825
816
|
}
|
|
826
817
|
/**
|
|
827
818
|
* A pixiv novel work item as returned by the API.
|
|
@@ -843,19 +834,19 @@ interface PixivNovelItem {
|
|
|
843
834
|
/** Content restriction level (0 = public, 1 = mypixiv-only, 2 = private). */
|
|
844
835
|
restrict: number;
|
|
845
836
|
/** Age restriction: 0 = all-ages, 1 = R-18, 2 = R-18G */
|
|
846
|
-
|
|
837
|
+
xRestrict: number;
|
|
847
838
|
/** Whether the novel is an original work (not fan fiction). */
|
|
848
|
-
|
|
839
|
+
isOriginal: boolean;
|
|
849
840
|
/** Cover image URLs. */
|
|
850
|
-
|
|
841
|
+
imageUrls: ImageUrls;
|
|
851
842
|
/** ISO 8601 date-time string of when the novel was posted. */
|
|
852
|
-
|
|
843
|
+
createDate: string;
|
|
853
844
|
/** Tags attached to the novel. */
|
|
854
845
|
tags: Tag[];
|
|
855
846
|
/** Number of pages (word-count chunks). */
|
|
856
|
-
|
|
847
|
+
pageCount: number;
|
|
857
848
|
/** Total character count of the novel body. */
|
|
858
|
-
|
|
849
|
+
textLength: number;
|
|
859
850
|
/** Author of the novel. */
|
|
860
851
|
user: PixivUser;
|
|
861
852
|
/**
|
|
@@ -865,25 +856,25 @@ interface PixivNovelItem {
|
|
|
865
856
|
*/
|
|
866
857
|
series: Series | Record<string, never>;
|
|
867
858
|
/** Whether the authenticated user has bookmarked this novel. */
|
|
868
|
-
|
|
859
|
+
isBookmarked: boolean;
|
|
869
860
|
/** Total number of bookmarks. */
|
|
870
|
-
|
|
861
|
+
totalBookmarks: number;
|
|
871
862
|
/** Total number of views. */
|
|
872
|
-
|
|
863
|
+
totalView: number;
|
|
873
864
|
/** Whether the novel is publicly visible. */
|
|
874
865
|
visible: boolean;
|
|
875
866
|
/** Total number of comments. */
|
|
876
|
-
|
|
867
|
+
totalComments: number;
|
|
877
868
|
/** Whether the novel is muted for the authenticated user. */
|
|
878
|
-
|
|
869
|
+
isMuted: boolean;
|
|
879
870
|
/** Whether the novel is restricted to mutual followers (mypixiv). */
|
|
880
|
-
|
|
881
|
-
/** Whether the novel contains explicit content beyond the `
|
|
882
|
-
|
|
871
|
+
isMypixivOnly: boolean;
|
|
872
|
+
/** Whether the novel contains explicit content beyond the `xRestrict` flag. */
|
|
873
|
+
isXRestricted: boolean;
|
|
883
874
|
/** AI-generated content flag: 0 = no AI, 1 = partial AI, 2 = fully AI */
|
|
884
|
-
|
|
875
|
+
novelAiType: number;
|
|
885
876
|
/** Controls who can post comments (may be absent). */
|
|
886
|
-
|
|
877
|
+
commentAccessControl?: number;
|
|
887
878
|
}
|
|
888
879
|
/** Novel series details returned by GET /v2/novel/series. */
|
|
889
880
|
interface NovelSeriesDetail {
|
|
@@ -894,21 +885,21 @@ interface NovelSeriesDetail {
|
|
|
894
885
|
/** Series description / caption. */
|
|
895
886
|
caption: string;
|
|
896
887
|
/** Whether every novel in the series is original (not fan fiction). */
|
|
897
|
-
|
|
888
|
+
isOriginal: boolean;
|
|
898
889
|
/** Whether the series has been marked as concluded by the author. */
|
|
899
|
-
|
|
890
|
+
isConcluded: boolean;
|
|
900
891
|
/** Number of novels in the series. */
|
|
901
|
-
|
|
892
|
+
contentCount: number;
|
|
902
893
|
/** Total character count across all novels in the series. */
|
|
903
|
-
|
|
894
|
+
totalCharacterCount: number;
|
|
904
895
|
/** Author of the series. */
|
|
905
896
|
user: PixivUser;
|
|
906
897
|
/** Human-readable series label / tagline. */
|
|
907
|
-
|
|
898
|
+
displayText: string;
|
|
908
899
|
/** AI-generated content flag: 0 = no AI, 1 = partial AI, 2 = fully AI */
|
|
909
|
-
|
|
900
|
+
novelAiType: number;
|
|
910
901
|
/** Whether the authenticated user has added this series to their watchlist. */
|
|
911
|
-
|
|
902
|
+
watchlistAdded: boolean;
|
|
912
903
|
}
|
|
913
904
|
/** User item with self-introduction; embedded in GET /v1/user/detail. */
|
|
914
905
|
type PixivUserItem = PixivUser & {
|
|
@@ -926,47 +917,47 @@ interface PixivUserProfile {
|
|
|
926
917
|
/** Birth date string (YYYY-MM-DD format, may be partial). */
|
|
927
918
|
birth: string;
|
|
928
919
|
/** Birth day portion (MM-DD format). */
|
|
929
|
-
|
|
920
|
+
birthDay: string;
|
|
930
921
|
/** Birth year. */
|
|
931
|
-
|
|
922
|
+
birthYear: number;
|
|
932
923
|
/** Region / prefecture. */
|
|
933
924
|
region: string;
|
|
934
925
|
/** Internal address ID. */
|
|
935
|
-
|
|
926
|
+
addressId: number;
|
|
936
927
|
/** Two-letter country code (ISO 3166-1 alpha-2). */
|
|
937
|
-
|
|
928
|
+
countryCode: string;
|
|
938
929
|
/** Occupation / job description. */
|
|
939
930
|
job: string;
|
|
940
931
|
/** Internal job category ID. */
|
|
941
|
-
|
|
932
|
+
jobId: number;
|
|
942
933
|
/** Number of users this user follows. */
|
|
943
|
-
|
|
934
|
+
totalFollowUsers: number;
|
|
944
935
|
/** Number of mutual-follow (mypixiv) connections. */
|
|
945
|
-
|
|
936
|
+
totalMypixivUsers: number;
|
|
946
937
|
/** Total number of public illusts. */
|
|
947
|
-
|
|
938
|
+
totalIllusts: number;
|
|
948
939
|
/** Total number of public manga works. */
|
|
949
|
-
|
|
940
|
+
totalManga: number;
|
|
950
941
|
/** Total number of public novels. */
|
|
951
|
-
|
|
942
|
+
totalNovels: number;
|
|
952
943
|
/** Total number of publicly bookmarked illusts. */
|
|
953
|
-
|
|
944
|
+
totalIllustBookmarksPublic: number;
|
|
954
945
|
/** Total number of illust series. */
|
|
955
|
-
|
|
946
|
+
totalIllustSeries: number;
|
|
956
947
|
/** Total number of novel series. */
|
|
957
|
-
|
|
948
|
+
totalNovelSeries: number;
|
|
958
949
|
/** Profile background image URL, or `null` if not set. */
|
|
959
|
-
|
|
950
|
+
backgroundImageUrl: string | null;
|
|
960
951
|
/** Linked Twitter/X account name (without @). */
|
|
961
|
-
|
|
952
|
+
twitterAccount: string;
|
|
962
953
|
/** Twitter/X profile URL, or `null` if not set. */
|
|
963
|
-
|
|
954
|
+
twitterUrl: string | null;
|
|
964
955
|
/** Pawoo profile URL, or `null` if not set. */
|
|
965
|
-
|
|
956
|
+
pawooUrl: string | null;
|
|
966
957
|
/** Whether the user has a premium (paid) account. */
|
|
967
|
-
|
|
958
|
+
isPremium: boolean;
|
|
968
959
|
/** Whether the user has set a custom profile image. */
|
|
969
|
-
|
|
960
|
+
isUsingCustomProfileImage: boolean;
|
|
970
961
|
}
|
|
971
962
|
/** Visibility settings for a user's profile fields. */
|
|
972
963
|
interface PixivUserProfilePublicity {
|
|
@@ -975,9 +966,9 @@ interface PixivUserProfilePublicity {
|
|
|
975
966
|
/** Visibility of the region field. */
|
|
976
967
|
region: Publicity;
|
|
977
968
|
/** Visibility of the birth-day field. */
|
|
978
|
-
|
|
969
|
+
birthDay: Publicity;
|
|
979
970
|
/** Visibility of the birth-year field. */
|
|
980
|
-
|
|
971
|
+
birthYear: Publicity;
|
|
981
972
|
/** Visibility of the job field. */
|
|
982
973
|
job: Publicity;
|
|
983
974
|
/** Whether the Pawoo account link is visible. */
|
|
@@ -1010,7 +1001,7 @@ interface PixivUserProfileWorkspace {
|
|
|
1010
1001
|
/** Free-text comment about the workspace. */
|
|
1011
1002
|
comment: string;
|
|
1012
1003
|
/** Workspace image URL, or `null` if not set. */
|
|
1013
|
-
|
|
1004
|
+
workspaceImageUrl: string | null;
|
|
1014
1005
|
}
|
|
1015
1006
|
/**
|
|
1016
1007
|
* Preview item for a user in the GET /v1/user/following response.
|
|
@@ -1025,7 +1016,7 @@ interface PixivUserPreviewItem {
|
|
|
1025
1016
|
/** A small sample of the user's recent novels. */
|
|
1026
1017
|
novels: PixivNovelItem[];
|
|
1027
1018
|
/** Whether this user is muted by the authenticated user. */
|
|
1028
|
-
|
|
1019
|
+
isMuted: boolean;
|
|
1029
1020
|
}
|
|
1030
1021
|
/** URLs for ugoira frame archives (ZIP files). */
|
|
1031
1022
|
interface ZipUrls {
|
|
@@ -1042,24 +1033,28 @@ interface Frame {
|
|
|
1042
1033
|
/** Ugoira metadata as returned by GET /v1/ugoira/metadata. */
|
|
1043
1034
|
interface PixivUgoiraItem {
|
|
1044
1035
|
/** Archive URLs for the frame ZIP. */
|
|
1045
|
-
|
|
1036
|
+
zipUrls: ZipUrls;
|
|
1046
1037
|
/** Per-frame timing data (in order). */
|
|
1047
1038
|
frames: Frame[];
|
|
1048
1039
|
}
|
|
1049
1040
|
/**
|
|
1050
|
-
*
|
|
1041
|
+
* Camelized shape of the JSON error body returned by the pixiv API.
|
|
1042
|
+
*
|
|
1043
|
+
* The pixiv wire format uses `snake_case` field names (e.g. `user_message`);
|
|
1044
|
+
* `HttpClient` applies `camelizeKeys()` before returning, so all fields here
|
|
1045
|
+
* are `lowerCamelCase`.
|
|
1051
1046
|
*/
|
|
1052
1047
|
interface PixivApiErrorBody {
|
|
1053
|
-
/** Error payload returned by the pixiv API. */
|
|
1048
|
+
/** Error payload returned by the pixiv API (keys camelized). */
|
|
1054
1049
|
error: {
|
|
1055
1050
|
/** Localised error message intended for end users. */
|
|
1056
|
-
|
|
1051
|
+
userMessage: string;
|
|
1057
1052
|
/** Internal error message. */
|
|
1058
1053
|
message: string;
|
|
1059
1054
|
/** Short error reason / code. */
|
|
1060
1055
|
reason: string;
|
|
1061
1056
|
/** Additional details for the user-facing message (may be absent). */
|
|
1062
|
-
|
|
1057
|
+
userMessageDetails?: Record<string, unknown>;
|
|
1063
1058
|
};
|
|
1064
1059
|
}
|
|
1065
1060
|
/** Response shape for GET /v1/illust/detail. */
|
|
@@ -1076,49 +1071,49 @@ interface IllustListPage {
|
|
|
1076
1071
|
*
|
|
1077
1072
|
* Only present on search responses; absent on related/ranking/recommended endpoints.
|
|
1078
1073
|
*/
|
|
1079
|
-
|
|
1074
|
+
showAi?: boolean;
|
|
1080
1075
|
/** URL to the next page, or `null` when this is the last page. */
|
|
1081
|
-
|
|
1076
|
+
nextUrl: string | null;
|
|
1082
1077
|
}
|
|
1083
1078
|
/** Page response for GET /v1/illust/recommended. */
|
|
1084
1079
|
interface IllustRecommendedPage {
|
|
1085
1080
|
/** Recommended illusts. */
|
|
1086
1081
|
illusts: PixivIllustItem[];
|
|
1087
1082
|
/** Ranking illusts included alongside recommendations. */
|
|
1088
|
-
|
|
1083
|
+
rankingIllusts: PixivIllustItem[];
|
|
1089
1084
|
/** Whether an ongoing contest exists. */
|
|
1090
|
-
|
|
1085
|
+
contestExists: boolean;
|
|
1091
1086
|
/** Privacy-policy notice (present on the first page). */
|
|
1092
|
-
|
|
1087
|
+
privacyPolicy?: PrivacyPolicy;
|
|
1093
1088
|
/** URL to the next page, or `null` when this is the last page. */
|
|
1094
|
-
|
|
1089
|
+
nextUrl: string | null;
|
|
1095
1090
|
}
|
|
1096
1091
|
/** Page response for GET /v1/illust/series. */
|
|
1097
1092
|
interface IllustSeriesPage {
|
|
1098
1093
|
/** Metadata for the series. */
|
|
1099
|
-
|
|
1094
|
+
illustSeriesDetail: IllustSeriesDetail;
|
|
1100
1095
|
/** First illust in the series. */
|
|
1101
|
-
|
|
1096
|
+
illustSeriesFirstIllust: PixivIllustItem;
|
|
1102
1097
|
/** Illusts on this page. */
|
|
1103
1098
|
illusts: PixivIllustItem[];
|
|
1104
1099
|
/** URL to the next page, or `null` when this is the last page. */
|
|
1105
|
-
|
|
1100
|
+
nextUrl: string | null;
|
|
1106
1101
|
}
|
|
1107
1102
|
/** Page response for GET /v1/manga/recommended. */
|
|
1108
1103
|
interface MangaRecommendedPage {
|
|
1109
1104
|
/** Recommended manga works. */
|
|
1110
1105
|
illusts: PixivIllustItem[];
|
|
1111
1106
|
/** Ranking manga works included alongside recommendations. */
|
|
1112
|
-
|
|
1107
|
+
rankingIllusts: PixivIllustItem[];
|
|
1113
1108
|
/** Privacy-policy notice (present on the first page). */
|
|
1114
|
-
|
|
1109
|
+
privacyPolicy?: PrivacyPolicy;
|
|
1115
1110
|
/** URL to the next page, or `null` when this is the last page. */
|
|
1116
|
-
|
|
1111
|
+
nextUrl: string | null;
|
|
1117
1112
|
}
|
|
1118
1113
|
/** Response shape for GET /v1/ugoira/metadata. */
|
|
1119
1114
|
interface UgoiraMetadataResponse {
|
|
1120
1115
|
/** Ugoira metadata (ZIP URLs and per-frame timings). */
|
|
1121
|
-
|
|
1116
|
+
ugoiraMetadata: PixivUgoiraItem;
|
|
1122
1117
|
}
|
|
1123
1118
|
/** Response shape for GET /v2/novel/detail. */
|
|
1124
1119
|
interface NovelDetailResponse {
|
|
@@ -1134,33 +1129,33 @@ interface NovelListPage {
|
|
|
1134
1129
|
*
|
|
1135
1130
|
* Only present on search responses; absent on related/ranking/recommended endpoints.
|
|
1136
1131
|
*/
|
|
1137
|
-
|
|
1132
|
+
showAi?: boolean;
|
|
1138
1133
|
/** URL to the next page, or `null` when this is the last page. */
|
|
1139
|
-
|
|
1134
|
+
nextUrl: string | null;
|
|
1140
1135
|
}
|
|
1141
1136
|
/** Page response for GET /v1/novel/recommended. */
|
|
1142
1137
|
interface NovelRecommendedPage {
|
|
1143
1138
|
/** Recommended novels. */
|
|
1144
1139
|
novels: PixivNovelItem[];
|
|
1145
1140
|
/** Ranking novels included alongside recommendations. */
|
|
1146
|
-
|
|
1141
|
+
rankingNovels: PixivNovelItem[];
|
|
1147
1142
|
/** Privacy-policy notice (present on the first page). */
|
|
1148
|
-
|
|
1143
|
+
privacyPolicy?: PrivacyPolicy;
|
|
1149
1144
|
/** URL to the next page, or `null` when this is the last page. */
|
|
1150
|
-
|
|
1145
|
+
nextUrl: string | null;
|
|
1151
1146
|
}
|
|
1152
1147
|
/** Page response for GET /v2/novel/series. */
|
|
1153
1148
|
interface NovelSeriesPage {
|
|
1154
1149
|
/** Metadata for the series. */
|
|
1155
|
-
|
|
1150
|
+
novelSeriesDetail: NovelSeriesDetail;
|
|
1156
1151
|
/** First novel in the series. */
|
|
1157
|
-
|
|
1152
|
+
novelSeriesFirstNovel: PixivNovelItem;
|
|
1158
1153
|
/** Most recently published novel in the series. */
|
|
1159
|
-
|
|
1154
|
+
novelSeriesLatestNovel: PixivNovelItem;
|
|
1160
1155
|
/** Novels on this page. */
|
|
1161
1156
|
novels: PixivNovelItem[];
|
|
1162
1157
|
/** URL to the next page, or `null` when this is the last page. */
|
|
1163
|
-
|
|
1158
|
+
nextUrl: string | null;
|
|
1164
1159
|
}
|
|
1165
1160
|
/** Response shape for GET /v1/user/detail. */
|
|
1166
1161
|
interface UserDetailResponse {
|
|
@@ -1169,7 +1164,7 @@ interface UserDetailResponse {
|
|
|
1169
1164
|
/** Detailed profile data. */
|
|
1170
1165
|
profile: PixivUserProfile;
|
|
1171
1166
|
/** Visibility settings for profile fields. */
|
|
1172
|
-
|
|
1167
|
+
profilePublicity: PixivUserProfilePublicity;
|
|
1173
1168
|
/** Workspace / desk-setup information. */
|
|
1174
1169
|
workspace: PixivUserProfileWorkspace;
|
|
1175
1170
|
}
|
|
@@ -1180,7 +1175,7 @@ interface UserIllustsPage {
|
|
|
1180
1175
|
/** Illusts on this page. */
|
|
1181
1176
|
illusts: PixivIllustItem[];
|
|
1182
1177
|
/** URL to the next page, or `null` when this is the last page. */
|
|
1183
|
-
|
|
1178
|
+
nextUrl: string | null;
|
|
1184
1179
|
}
|
|
1185
1180
|
/** Page response for GET /v1/user/novels. */
|
|
1186
1181
|
interface UserNovelsPage {
|
|
@@ -1189,28 +1184,28 @@ interface UserNovelsPage {
|
|
|
1189
1184
|
/** Novels on this page. */
|
|
1190
1185
|
novels: PixivNovelItem[];
|
|
1191
1186
|
/** URL to the next page, or `null` when this is the last page. */
|
|
1192
|
-
|
|
1187
|
+
nextUrl: string | null;
|
|
1193
1188
|
}
|
|
1194
1189
|
/** Page response for GET /v1/user/bookmarks/illust. */
|
|
1195
1190
|
interface UserBookmarksIllustPage {
|
|
1196
1191
|
/** Bookmarked illusts on this page. */
|
|
1197
1192
|
illusts: PixivIllustItem[];
|
|
1198
1193
|
/** URL to the next page, or `null` when this is the last page. */
|
|
1199
|
-
|
|
1194
|
+
nextUrl: string | null;
|
|
1200
1195
|
}
|
|
1201
1196
|
/** Page response for GET /v1/user/bookmarks/novel. */
|
|
1202
1197
|
interface UserBookmarksNovelPage {
|
|
1203
1198
|
/** Bookmarked novels on this page. */
|
|
1204
1199
|
novels: PixivNovelItem[];
|
|
1205
1200
|
/** URL to the next page, or `null` when this is the last page. */
|
|
1206
|
-
|
|
1201
|
+
nextUrl: string | null;
|
|
1207
1202
|
}
|
|
1208
1203
|
/** Page response for GET /v1/user/following. */
|
|
1209
1204
|
interface UserFollowingPage {
|
|
1210
1205
|
/** User preview items on this page. */
|
|
1211
|
-
|
|
1206
|
+
userPreviews: PixivUserPreviewItem[];
|
|
1212
1207
|
/** URL to the next page, or `null` when this is the last page. */
|
|
1213
|
-
|
|
1208
|
+
nextUrl: string | null;
|
|
1214
1209
|
}
|
|
1215
1210
|
|
|
1216
1211
|
/**
|
|
@@ -1222,7 +1217,7 @@ interface IllustDetailParams {
|
|
|
1222
1217
|
/** ID of the illust to fetch. */
|
|
1223
1218
|
illustId: number;
|
|
1224
1219
|
/** OS filter to apply (default: `"for_ios"`). */
|
|
1225
|
-
filter?: OSFilter;
|
|
1220
|
+
filter?: (typeof OSFilter)[keyof typeof OSFilter];
|
|
1226
1221
|
}
|
|
1227
1222
|
/** Parameters for fetching related illusts. */
|
|
1228
1223
|
interface IllustRelatedParams {
|
|
@@ -1231,24 +1226,24 @@ interface IllustRelatedParams {
|
|
|
1231
1226
|
/** Additional seed illust IDs to influence recommendations. */
|
|
1232
1227
|
seedIllustIds?: number[];
|
|
1233
1228
|
/** OS filter to apply (default: `"for_ios"`). */
|
|
1234
|
-
filter?: OSFilter;
|
|
1229
|
+
filter?: (typeof OSFilter)[keyof typeof OSFilter];
|
|
1235
1230
|
}
|
|
1236
1231
|
/** Parameters for searching illusts. */
|
|
1237
1232
|
interface IllustSearchParams {
|
|
1238
1233
|
/** Search keyword. */
|
|
1239
1234
|
word: string;
|
|
1240
1235
|
/** How to match the keyword against works (default: `"partial_match_for_tags"`). */
|
|
1241
|
-
searchTarget?: SearchTarget;
|
|
1236
|
+
searchTarget?: (typeof SearchTarget)[keyof typeof SearchTarget];
|
|
1242
1237
|
/** Sort order for results (default: `"date_desc"`). */
|
|
1243
|
-
sort?: SearchSort;
|
|
1238
|
+
sort?: (typeof SearchSort)[keyof typeof SearchSort];
|
|
1244
1239
|
/** Date range preset filter (omit for no restriction). */
|
|
1245
|
-
duration?: SearchDuration;
|
|
1240
|
+
duration?: (typeof SearchDuration)[keyof typeof SearchDuration];
|
|
1246
1241
|
/** Start date for a custom date range (YYYY-MM-DD; requires `endDate`). */
|
|
1247
1242
|
startDate?: string;
|
|
1248
1243
|
/** End date for a custom date range (YYYY-MM-DD; requires `startDate`). */
|
|
1249
1244
|
endDate?: string;
|
|
1250
1245
|
/** OS filter to apply (default: `"for_ios"`). */
|
|
1251
|
-
filter?: OSFilter;
|
|
1246
|
+
filter?: (typeof OSFilter)[keyof typeof OSFilter];
|
|
1252
1247
|
/** AI-generated content filter: `0` = hide AI works, `1` = show only AI works. */
|
|
1253
1248
|
searchAiType?: 0 | 1;
|
|
1254
1249
|
/** Zero-based offset for pagination. */
|
|
@@ -1257,9 +1252,9 @@ interface IllustSearchParams {
|
|
|
1257
1252
|
/** Parameters for fetching the illust ranking. */
|
|
1258
1253
|
interface IllustRankingParams {
|
|
1259
1254
|
/** Ranking category (default: `"day"`). */
|
|
1260
|
-
mode?: RankingMode;
|
|
1255
|
+
mode?: (typeof RankingMode)[keyof typeof RankingMode];
|
|
1261
1256
|
/** OS filter to apply (default: `"for_ios"`). */
|
|
1262
|
-
filter?: OSFilter;
|
|
1257
|
+
filter?: (typeof OSFilter)[keyof typeof OSFilter];
|
|
1263
1258
|
/** Specific date to fetch rankings for (YYYY-MM-DD; omit for the latest). */
|
|
1264
1259
|
date?: string;
|
|
1265
1260
|
/** Zero-based offset for pagination. */
|
|
@@ -1268,7 +1263,7 @@ interface IllustRankingParams {
|
|
|
1268
1263
|
/** Parameters for fetching recommended illusts. */
|
|
1269
1264
|
interface IllustRecommendedParams {
|
|
1270
1265
|
/** OS filter to apply (default: `"for_ios"`). */
|
|
1271
|
-
filter?: OSFilter;
|
|
1266
|
+
filter?: (typeof OSFilter)[keyof typeof OSFilter];
|
|
1272
1267
|
/** Zero-based offset for pagination. */
|
|
1273
1268
|
offset?: number;
|
|
1274
1269
|
/**
|
|
@@ -1287,14 +1282,14 @@ interface IllustSeriesParams {
|
|
|
1287
1282
|
/** ID of the illust series to fetch. */
|
|
1288
1283
|
illustSeriesId: number;
|
|
1289
1284
|
/** OS filter to apply (default: `"for_ios"`). */
|
|
1290
|
-
filter?: OSFilter;
|
|
1285
|
+
filter?: (typeof OSFilter)[keyof typeof OSFilter];
|
|
1291
1286
|
}
|
|
1292
1287
|
/** Parameters for adding an illust bookmark. */
|
|
1293
1288
|
interface IllustBookmarkAddParams {
|
|
1294
1289
|
/** ID of the illust to bookmark. */
|
|
1295
1290
|
illustId: number;
|
|
1296
1291
|
/** Bookmark visibility (default: `"public"`). */
|
|
1297
|
-
restrict?: BookmarkRestrict;
|
|
1292
|
+
restrict?: (typeof BookmarkRestrict)[keyof typeof BookmarkRestrict];
|
|
1298
1293
|
/** Tags to attach to the bookmark. */
|
|
1299
1294
|
tags?: string[];
|
|
1300
1295
|
}
|
|
@@ -1413,13 +1408,13 @@ interface NovelSearchParams {
|
|
|
1413
1408
|
/** Search keyword. */
|
|
1414
1409
|
word: string;
|
|
1415
1410
|
/** How to match the keyword against works (default: `"partial_match_for_tags"`). */
|
|
1416
|
-
searchTarget?: SearchTarget;
|
|
1411
|
+
searchTarget?: (typeof SearchTarget)[keyof typeof SearchTarget];
|
|
1417
1412
|
/** Sort order for results (default: `"date_desc"`). */
|
|
1418
|
-
sort?: SearchSort;
|
|
1413
|
+
sort?: (typeof SearchSort)[keyof typeof SearchSort];
|
|
1419
1414
|
/** OS filter to apply (default: `"for_ios"`). */
|
|
1420
|
-
filter?: OSFilter;
|
|
1415
|
+
filter?: (typeof OSFilter)[keyof typeof OSFilter];
|
|
1421
1416
|
/** Date range preset filter (omit for no restriction). */
|
|
1422
|
-
duration?: SearchDuration;
|
|
1417
|
+
duration?: (typeof SearchDuration)[keyof typeof SearchDuration];
|
|
1423
1418
|
/** Start date for a custom date range (YYYY-MM-DD; requires `endDate`). */
|
|
1424
1419
|
startDate?: string;
|
|
1425
1420
|
/** End date for a custom date range (YYYY-MM-DD; requires `startDate`). */
|
|
@@ -1432,9 +1427,9 @@ interface NovelSearchParams {
|
|
|
1432
1427
|
/** Parameters for fetching the novel ranking. */
|
|
1433
1428
|
interface NovelRankingParams {
|
|
1434
1429
|
/** Ranking category (default: `"day"`). */
|
|
1435
|
-
mode?: NovelRankingMode;
|
|
1430
|
+
mode?: (typeof NovelRankingMode)[keyof typeof NovelRankingMode];
|
|
1436
1431
|
/** OS filter to apply (default: `"for_ios"`). */
|
|
1437
|
-
filter?: OSFilter;
|
|
1432
|
+
filter?: (typeof OSFilter)[keyof typeof OSFilter];
|
|
1438
1433
|
/** Specific date to fetch rankings for (YYYY-MM-DD; omit for the latest). */
|
|
1439
1434
|
date?: string;
|
|
1440
1435
|
/** Zero-based offset for pagination. */
|
|
@@ -1443,7 +1438,7 @@ interface NovelRankingParams {
|
|
|
1443
1438
|
/** Parameters for fetching recommended novels. */
|
|
1444
1439
|
interface NovelRecommendedParams {
|
|
1445
1440
|
/** OS filter to apply (default: `"for_ios"`). */
|
|
1446
|
-
filter?: OSFilter;
|
|
1441
|
+
filter?: (typeof OSFilter)[keyof typeof OSFilter];
|
|
1447
1442
|
/** Zero-based offset for pagination. */
|
|
1448
1443
|
offset?: number;
|
|
1449
1444
|
/**
|
|
@@ -1464,7 +1459,7 @@ interface NovelBookmarkAddParams {
|
|
|
1464
1459
|
/** ID of the novel to bookmark. */
|
|
1465
1460
|
novelId: number;
|
|
1466
1461
|
/** Bookmark visibility (default: `"public"`). */
|
|
1467
|
-
restrict?: BookmarkRestrict;
|
|
1462
|
+
restrict?: (typeof BookmarkRestrict)[keyof typeof BookmarkRestrict];
|
|
1468
1463
|
/** Tags to attach to the bookmark. */
|
|
1469
1464
|
tags?: string[];
|
|
1470
1465
|
}
|
|
@@ -1578,9 +1573,9 @@ interface UserBookmarksIllustParams {
|
|
|
1578
1573
|
/** ID of the user whose bookmarks to fetch. */
|
|
1579
1574
|
userId: number;
|
|
1580
1575
|
/** Visibility of the bookmarks to return (default: `"public"`). */
|
|
1581
|
-
restrict?: BookmarkRestrict;
|
|
1576
|
+
restrict?: (typeof BookmarkRestrict)[keyof typeof BookmarkRestrict];
|
|
1582
1577
|
/** OS filter to apply (default: `"for_ios"`). */
|
|
1583
|
-
filter?: OSFilter;
|
|
1578
|
+
filter?: (typeof OSFilter)[keyof typeof OSFilter];
|
|
1584
1579
|
/** Limit results to bookmarks with this tag. */
|
|
1585
1580
|
tag?: string;
|
|
1586
1581
|
/** Fetch bookmarks older than this bookmark ID (cursor-based pagination). */
|
|
@@ -1593,9 +1588,9 @@ interface UserBookmarksNovelParams {
|
|
|
1593
1588
|
/** ID of the user whose bookmarks to fetch. */
|
|
1594
1589
|
userId: number;
|
|
1595
1590
|
/** Visibility of the bookmarks to return (default: `"public"`). */
|
|
1596
|
-
restrict?: BookmarkRestrict;
|
|
1591
|
+
restrict?: (typeof BookmarkRestrict)[keyof typeof BookmarkRestrict];
|
|
1597
1592
|
/** OS filter to apply (default: `"for_ios"`). */
|
|
1598
|
-
filter?: OSFilter;
|
|
1593
|
+
filter?: (typeof OSFilter)[keyof typeof OSFilter];
|
|
1599
1594
|
/** Limit results to bookmarks with this tag. */
|
|
1600
1595
|
tag?: string;
|
|
1601
1596
|
/** Fetch bookmarks older than this bookmark ID (cursor-based pagination). */
|
|
@@ -1608,16 +1603,16 @@ interface UserDetailParams {
|
|
|
1608
1603
|
/** ID of the user to fetch. */
|
|
1609
1604
|
userId: number;
|
|
1610
1605
|
/** OS filter to apply (default: `"for_ios"`). */
|
|
1611
|
-
filter?: OSFilter;
|
|
1606
|
+
filter?: (typeof OSFilter)[keyof typeof OSFilter];
|
|
1612
1607
|
}
|
|
1613
1608
|
/** Parameters for fetching a user's illusts. */
|
|
1614
1609
|
interface UserIllustsParams {
|
|
1615
1610
|
/** ID of the user whose illusts to fetch. */
|
|
1616
1611
|
userId: number;
|
|
1617
1612
|
/** Work type to filter by (omit to return both illusts and manga). */
|
|
1618
|
-
type?: UserIllustType;
|
|
1613
|
+
type?: (typeof UserIllustType)[keyof typeof UserIllustType];
|
|
1619
1614
|
/** OS filter to apply (default: `"for_ios"`). */
|
|
1620
|
-
filter?: OSFilter;
|
|
1615
|
+
filter?: (typeof OSFilter)[keyof typeof OSFilter];
|
|
1621
1616
|
/** Zero-based offset for pagination. */
|
|
1622
1617
|
offset?: number;
|
|
1623
1618
|
}
|
|
@@ -1626,7 +1621,7 @@ interface UserNovelsParams {
|
|
|
1626
1621
|
/** ID of the user whose novels to fetch. */
|
|
1627
1622
|
userId: number;
|
|
1628
1623
|
/** OS filter to apply (default: `"for_ios"`). */
|
|
1629
|
-
filter?: OSFilter;
|
|
1624
|
+
filter?: (typeof OSFilter)[keyof typeof OSFilter];
|
|
1630
1625
|
/** Zero-based offset for pagination. */
|
|
1631
1626
|
offset?: number;
|
|
1632
1627
|
}
|
|
@@ -1635,7 +1630,7 @@ interface UserFollowingParams {
|
|
|
1635
1630
|
/** ID of the user whose following list to fetch. */
|
|
1636
1631
|
userId: number;
|
|
1637
1632
|
/** Visibility of the follows to return (default: `"public"`). */
|
|
1638
|
-
restrict?: FollowRestrict;
|
|
1633
|
+
restrict?: (typeof FollowRestrict)[keyof typeof FollowRestrict];
|
|
1639
1634
|
/** Zero-based offset for pagination. */
|
|
1640
1635
|
offset?: number;
|
|
1641
1636
|
}
|
|
@@ -1644,7 +1639,7 @@ interface UserFollowAddParams {
|
|
|
1644
1639
|
/** ID of the user to follow. */
|
|
1645
1640
|
userId: number;
|
|
1646
1641
|
/** Visibility of the follow (default: `"public"`). */
|
|
1647
|
-
restrict?: FollowRestrict;
|
|
1642
|
+
restrict?: (typeof FollowRestrict)[keyof typeof FollowRestrict];
|
|
1648
1643
|
}
|
|
1649
1644
|
/** Parameters for unfollowing a user. */
|
|
1650
1645
|
interface UserFollowDeleteParams {
|
|
@@ -1671,8 +1666,8 @@ declare class UserBookmarksResource {
|
|
|
1671
1666
|
* // Resume from a saved cursor
|
|
1672
1667
|
* import { parseNextUrl } from '@book000/pixivts'
|
|
1673
1668
|
* const page = await client.users.bookmarks.illusts({ userId: client.userId })
|
|
1674
|
-
* if (page.isOk && page.value.
|
|
1675
|
-
* const cursor = parseNextUrl(page.value.
|
|
1669
|
+
* if (page.isOk && page.value.nextUrl) {
|
|
1670
|
+
* const cursor = parseNextUrl(page.value.nextUrl)
|
|
1676
1671
|
* const next = await client.users.bookmarks.illusts({
|
|
1677
1672
|
* userId: client.userId,
|
|
1678
1673
|
* maxBookmarkId: cursor.maxBookmarkId,
|
|
@@ -1754,7 +1749,7 @@ declare class UserResource {
|
|
|
1754
1749
|
/** Parameters for fetching recommended manga. */
|
|
1755
1750
|
interface MangaRecommendedParams {
|
|
1756
1751
|
/** OS filter to apply (default: `"for_ios"`). */
|
|
1757
|
-
filter?: OSFilter;
|
|
1752
|
+
filter?: (typeof OSFilter)[keyof typeof OSFilter];
|
|
1758
1753
|
/** Zero-based offset for pagination. */
|
|
1759
1754
|
offset?: number;
|
|
1760
1755
|
}
|
|
@@ -1866,6 +1861,25 @@ declare class PixivClient {
|
|
|
1866
1861
|
* ```
|
|
1867
1862
|
*/
|
|
1868
1863
|
get userId(): number;
|
|
1864
|
+
/**
|
|
1865
|
+
* Returns the current OAuth access token.
|
|
1866
|
+
*
|
|
1867
|
+
* The access token is short-lived and changes after each call to
|
|
1868
|
+
* {@link PixivClient.of} and after each automatic token refresh triggered
|
|
1869
|
+
* by a 401 response.
|
|
1870
|
+
*
|
|
1871
|
+
* @returns The current bearer access token string
|
|
1872
|
+
*/
|
|
1873
|
+
getAccessToken(): string;
|
|
1874
|
+
/**
|
|
1875
|
+
* Returns the current OAuth refresh token.
|
|
1876
|
+
*
|
|
1877
|
+
* The refresh token is long-lived and is used to obtain new access tokens.
|
|
1878
|
+
* It may rotate after a successful token refresh.
|
|
1879
|
+
*
|
|
1880
|
+
* @returns The current refresh token string
|
|
1881
|
+
*/
|
|
1882
|
+
getRefreshToken(): string;
|
|
1869
1883
|
/**
|
|
1870
1884
|
* Creates a PixivClient by refreshing the given token.
|
|
1871
1885
|
*
|