@book000/pixivts 0.64.0-beta.1 → 0.64.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -722,6 +722,60 @@ interface MetaPages {
722
722
  /** Full set of image URLs for this page, including the original. */
723
723
  imageUrls: Required<ImageUrls>;
724
724
  }
725
+ /** A user who can accept requests, listed in {@link IllustRequest}. */
726
+ interface IllustRequestUser {
727
+ /** User ID. */
728
+ id: number;
729
+ /** Display name. */
730
+ name: string;
731
+ /** Account name (used in URLs). */
732
+ account: string;
733
+ /** Profile image URLs. */
734
+ profileImageUrls: ProfileImageUrls;
735
+ /** Whether the authenticated user follows this user. */
736
+ isFollowed: boolean;
737
+ /** Whether this user blocks the authenticated user's access. */
738
+ isAccessBlockingUser: boolean;
739
+ /** Whether this user accepts requests. */
740
+ isAcceptRequest: boolean;
741
+ }
742
+ /** A collaborating user sample in {@link IllustRequestCollaborateStatus}. */
743
+ interface IllustRequestCollaborateUserSample {
744
+ /** User ID, or `null` when the collaborator is anonymous. */
745
+ userId: number | null;
746
+ /** Whether the collaborator is shown anonymously. */
747
+ anonymousFlag: boolean;
748
+ }
749
+ /** Collaboration status of a request. */
750
+ interface IllustRequestCollaborateStatus {
751
+ /** Whether the work is being collaborated on. */
752
+ collaborating: boolean;
753
+ /** Whether collaborators are shown anonymously. */
754
+ collaborateAnonymousFlag: boolean;
755
+ /** Sample of collaborating users. */
756
+ collaborateUserSamples: IllustRequestCollaborateUserSample[];
757
+ }
758
+ /** Request details of an illust created from a request. */
759
+ interface IllustRequestInfo {
760
+ /** ID of the user who made the request, or `null` when not disclosed. */
761
+ fanUserId: number | null;
762
+ /** Collaboration status. */
763
+ collaborateStatus: IllustRequestCollaborateStatus;
764
+ /** Role of the author in the request (e.g. the requested creator). */
765
+ role: string;
766
+ }
767
+ /**
768
+ * Request (commission) metadata attached to an illust.
769
+ *
770
+ * The shape is based on a small number of live responses and may be
771
+ * incomplete.
772
+ */
773
+ interface IllustRequest {
774
+ /** Request details. */
775
+ requestInfo: IllustRequestInfo;
776
+ /** Users who can accept requests. */
777
+ requestUsers: IllustRequestUser[];
778
+ }
725
779
  /**
726
780
  * A pixiv illust or manga work item as returned by the API.
727
781
  *
@@ -793,6 +847,12 @@ interface PixivIllustItem {
793
847
  commentAccessControl?: number;
794
848
  /** Additional access-restriction attributes (may be absent). */
795
849
  restrictionAttributes?: string[];
850
+ /** Request (commission) metadata, or `null` when the work is not request-related. */
851
+ request?: IllustRequest | null;
852
+ /** Event banner data. Always `null` in observed responses; the non-null shape is unknown. */
853
+ eventBanners?: unknown;
854
+ /** Seasonal-effect animation URLs. Always `null` in observed responses; the non-null shape is unknown. */
855
+ seasonalEffectAnimationUrls?: unknown;
796
856
  }
797
857
  /** Stamp attached to an illust comment. */
798
858
  interface IllustCommentStamp {
@@ -928,7 +988,7 @@ interface PixivNovelItem {
928
988
  /**
929
989
  * A single comment on a novel.
930
990
  *
931
- * Returned by GET /v1/novel/comments.
991
+ * Returned by GET /v3/novel/comments.
932
992
  */
933
993
  interface NovelComment {
934
994
  /** Comment ID. */
@@ -941,7 +1001,13 @@ interface NovelComment {
941
1001
  user: PixivUser;
942
1002
  /** Whether this comment has replies. */
943
1003
  hasReplies?: boolean;
944
- /** The comment this is a reply to, or `{}` (empty object) for a top-level comment. */
1004
+ /** Stamp attached to this comment, or `null` when the comment has no stamp. */
1005
+ stamp?: IllustCommentStamp | null;
1006
+ /**
1007
+ * The comment this is a reply to, or `{}` (empty object) for a top-level comment.
1008
+ *
1009
+ * Not returned by `/v3/novel/comments`.
1010
+ */
945
1011
  parentComment?: NovelComment | Record<string, never>;
946
1012
  }
947
1013
  /** Novel series details returned by GET /v2/novel/series. */
@@ -1167,6 +1233,13 @@ interface IllustCommentsPage {
1167
1233
  /** Who is permitted to post comments (may be absent). */
1168
1234
  commentAccessControl?: number;
1169
1235
  }
1236
+ /** Page response for GET /v2/illust/comment/replies. */
1237
+ interface IllustCommentRepliesPage {
1238
+ /** Replies on this page. */
1239
+ comments: IllustComment[];
1240
+ /** URL to the next page, or `null` when this is the last page. */
1241
+ nextUrl: string | null;
1242
+ }
1170
1243
  /** Response shape for GET /v2/illust/bookmark/detail. */
1171
1244
  interface IllustBookmarkDetailResponse {
1172
1245
  /** Bookmark metadata for the requested illust. */
@@ -1199,6 +1272,33 @@ interface TrendingTagsIllustResponse {
1199
1272
  /** Currently trending tags, each with a representative illust. */
1200
1273
  trendTags: TrendingTagIllust[];
1201
1274
  }
1275
+ /** Response shape for GET /v1/trending-tags/novel. */
1276
+ interface TrendingTagsNovelResponse {
1277
+ /** Currently trending novel tags, each with a representative illust. */
1278
+ trendTags: TrendingTagIllust[];
1279
+ }
1280
+ /**
1281
+ * Response shape for GET /v1/search/popular-preview/illust.
1282
+ *
1283
+ * Single page: the endpoint returns no `next_url`.
1284
+ */
1285
+ interface IllustPopularPreviewResponse {
1286
+ /** Popular illusts for the search keyword. */
1287
+ illusts: PixivIllustItem[];
1288
+ /** Maximum number of results the search will return. */
1289
+ searchSpanLimit: number;
1290
+ }
1291
+ /**
1292
+ * Response shape for GET /v1/search/popular-preview/novel.
1293
+ *
1294
+ * Single page: the endpoint returns no `next_url`.
1295
+ */
1296
+ interface NovelPopularPreviewResponse {
1297
+ /** Popular novels for the search keyword. */
1298
+ novels: PixivNovelItem[];
1299
+ /** Maximum number of results the search will return. */
1300
+ searchSpanLimit: number;
1301
+ }
1202
1302
  /** Page response for GET /v1/manga/recommended. */
1203
1303
  interface MangaRecommendedPage {
1204
1304
  /** Recommended manga works. */
@@ -1210,6 +1310,39 @@ interface MangaRecommendedPage {
1210
1310
  /** URL to the next page, or `null` when this is the last page. */
1211
1311
  nextUrl: string | null;
1212
1312
  }
1313
+ /** A series on the authenticated user's watchlist. */
1314
+ interface WatchlistSeries {
1315
+ /** Series ID. */
1316
+ id: number;
1317
+ /** Series title. */
1318
+ title: string;
1319
+ /** URL of the series page. */
1320
+ url: string;
1321
+ /** Mask text shown in place of the title, or `null` when not masked. */
1322
+ maskText: string | null;
1323
+ /** Number of published works in the series. */
1324
+ publishedContentCount: number;
1325
+ /** Datetime (ISO 8601) of the most recently published work. */
1326
+ lastPublishedContentDatetime: string;
1327
+ /** ID of the most recently published work. */
1328
+ latestContentId: number;
1329
+ /** Author of the series. */
1330
+ user: PixivUser;
1331
+ }
1332
+ /** Page response for GET /v1/watchlist/manga. */
1333
+ interface WatchlistMangaPage {
1334
+ /** Manga series on this page. */
1335
+ series: WatchlistSeries[];
1336
+ /** URL to the next page, or `null` when this is the last page. */
1337
+ nextUrl: string | null;
1338
+ }
1339
+ /** Page response for GET /v1/watchlist/novel. */
1340
+ interface WatchlistNovelPage {
1341
+ /** Novel series on this page. */
1342
+ series: WatchlistSeries[];
1343
+ /** URL to the next page, or `null` when this is the last page. */
1344
+ nextUrl: string | null;
1345
+ }
1213
1346
  /** A pixivision spotlight article. */
1214
1347
  interface SpotlightArticle {
1215
1348
  /** Article ID. */
@@ -1270,9 +1403,9 @@ interface NovelRecommendedPage {
1270
1403
  /** URL to the next page, or `null` when this is the last page. */
1271
1404
  nextUrl: string | null;
1272
1405
  }
1273
- /** Page response for GET /v1/novel/comments. */
1406
+ /** Page response for GET /v3/novel/comments. */
1274
1407
  interface NovelCommentsPage {
1275
- /** Total number of comments on the novel (present only when `includeTotalComments` is requested). */
1408
+ /** Total number of comments on the novel. Not returned by v3; use `novel.totalComments` from `novels.detail()` instead. */
1276
1409
  totalComments?: number;
1277
1410
  /** Comments on this page. */
1278
1411
  comments: NovelComment[];
@@ -1281,6 +1414,13 @@ interface NovelCommentsPage {
1281
1414
  /** Who is permitted to post comments (may be absent). */
1282
1415
  commentAccessControl?: number;
1283
1416
  }
1417
+ /** Page response for GET /v2/novel/comment/replies. */
1418
+ interface NovelCommentRepliesPage {
1419
+ /** Replies on this page. */
1420
+ comments: NovelComment[];
1421
+ /** URL to the next page, or `null` when this is the last page. */
1422
+ nextUrl: string | null;
1423
+ }
1284
1424
  /** Page response for GET /v2/novel/series. */
1285
1425
  interface NovelSeriesPage {
1286
1426
  /** Metadata for the series. */
@@ -1294,6 +1434,25 @@ interface NovelSeriesPage {
1294
1434
  /** URL to the next page, or `null` when this is the last page. */
1295
1435
  nextUrl: string | null;
1296
1436
  }
1437
+ /** Saved reading position of a novel. */
1438
+ interface NovelMarker {
1439
+ /** Marked page number within the novel. */
1440
+ page: number;
1441
+ }
1442
+ /** A novel together with the authenticated user's saved marker. */
1443
+ interface MarkedNovel {
1444
+ /** The marked novel. */
1445
+ novel: PixivNovelItem;
1446
+ /** The saved reading position. */
1447
+ novelMarker: NovelMarker;
1448
+ }
1449
+ /** Page response for GET /v2/novel/markers. */
1450
+ interface NovelMarkersPage {
1451
+ /** Marked novels on this page. */
1452
+ markedNovels: MarkedNovel[];
1453
+ /** URL to the next page, or `null` when this is the last page. */
1454
+ nextUrl: string | null;
1455
+ }
1297
1456
  /** Bookmark / view counters embedded in a WebView novel page. */
1298
1457
  interface WebviewNovelRating {
1299
1458
  /** Number of "likes" (lightweight reactions). */
@@ -1376,7 +1535,105 @@ interface WebviewNovel {
1376
1535
  /** Whether the novel is an original work (not fan fiction). */
1377
1536
  isOriginal: boolean;
1378
1537
  }
1379
- /** Response shape for GET /v1/user/detail. */
1538
+ /** Badge shown on a user's profile, returned by GET /v2/user/detail. */
1539
+ interface PixivUserProfileBadge {
1540
+ /** Badge kind (observed: `"premium"`, `"official"`). */
1541
+ type: string;
1542
+ /** Badge icon URL, or `null` when none is provided. */
1543
+ url: string | null;
1544
+ }
1545
+ /** Detailed profile information returned by GET /v2/user/detail. */
1546
+ interface PixivUserProfileV2 {
1547
+ /** Personal website URL, or `null` if not set. */
1548
+ webpage: string | null;
1549
+ /** Numeric gender code (observed: 0, 1, 2), or `null` when not disclosed. */
1550
+ gender: number | null;
1551
+ /** Birth date string, or `null` when not disclosed. */
1552
+ birth: string | null;
1553
+ /** Birth day portion (MM-DD format), or `null` when not disclosed. */
1554
+ birthDay: string | null;
1555
+ /** Birth year, or `null` when not disclosed. */
1556
+ birthYear: number | null;
1557
+ /** Region / prefecture, or `null` when not disclosed. */
1558
+ region: string | null;
1559
+ /** Internal address ID, or `null` when not disclosed. */
1560
+ addressId: number | null;
1561
+ /** Country code, or `null` when not disclosed. */
1562
+ countryCode: string | null;
1563
+ /** Occupation / job description, or `null` when not disclosed. */
1564
+ job: string | null;
1565
+ /** Internal job category ID, or `null` when not disclosed. */
1566
+ jobId: number | null;
1567
+ /** Number of users this user follows. */
1568
+ totalFollowUsers: number;
1569
+ /** Number of mutual-follow (mypixiv) connections. */
1570
+ totalMypixivUsers: number;
1571
+ /** Total number of public illusts. */
1572
+ totalIllusts: number;
1573
+ /** Total number of public manga works. */
1574
+ totalManga: number;
1575
+ /** Total number of public novels. */
1576
+ totalNovels: number;
1577
+ /** Total number of illust series. */
1578
+ totalIllustSeries: number;
1579
+ /** Total number of novel series. */
1580
+ totalNovelSeries: number;
1581
+ /** Profile background image URL, or `null` if not set. */
1582
+ backgroundImageUrl: string | null;
1583
+ /** Linked Twitter/X account name (without @), or `null` if not set. */
1584
+ twitterAccount: string | null;
1585
+ /** Twitter/X profile URL, or `null` if not set. */
1586
+ twitterUrl: string | null;
1587
+ /** Whether the user has a premium (paid) account. */
1588
+ isPremium: boolean;
1589
+ /** Whether the user has set a custom profile image. */
1590
+ isUsingCustomProfileImage: boolean;
1591
+ /** Profile badge, or `null` when the user has none. */
1592
+ badge: PixivUserProfileBadge | null;
1593
+ }
1594
+ /** Visibility settings returned by GET /v2/user/detail (each `null` when not exposed). */
1595
+ interface PixivUserProfilePublicityV2 {
1596
+ /** Visibility of the gender field. */
1597
+ gender: Publicity | null;
1598
+ /** Visibility of the region field. */
1599
+ region: Publicity | null;
1600
+ /** Visibility of the birth-day field. */
1601
+ birthDay: Publicity | null;
1602
+ /** Visibility of the birth-year field. */
1603
+ birthYear: Publicity | null;
1604
+ /** Visibility of the job field. */
1605
+ job: Publicity | null;
1606
+ }
1607
+ /** Workspace information returned by GET /v2/user/detail (no image URL). */
1608
+ type PixivUserProfileWorkspaceV2 = Omit<PixivUserProfileWorkspace, 'workspaceImageUrl'>;
1609
+ /**
1610
+ * Response shape for GET /v2/user/detail.
1611
+ *
1612
+ * Differs from {@link UserDetailResponse}: several profile values are nullable,
1613
+ * `disabledLinks` and `profile.badge` are present, and the v1-only fields
1614
+ * (`profile.pawooUrl`, `profile.totalIllustBookmarksPublic`,
1615
+ * `profilePublicity.pawoo`, `workspace.workspaceImageUrl`) are absent.
1616
+ */
1617
+ interface UserDetailV2Response {
1618
+ /** Basic user info with self-introduction. */
1619
+ user: PixivUserItem & {
1620
+ isAcceptRequest: boolean;
1621
+ };
1622
+ /** Detailed profile data. */
1623
+ profile: PixivUserProfileV2;
1624
+ /** Visibility settings for profile fields. */
1625
+ profilePublicity: PixivUserProfilePublicityV2;
1626
+ /** Workspace / desk-setup information. */
1627
+ workspace: PixivUserProfileWorkspaceV2;
1628
+ /** Links the user has disabled; the element shape is not yet known. */
1629
+ disabledLinks: unknown[];
1630
+ }
1631
+ /**
1632
+ * Response shape for GET /v1/user/detail.
1633
+ *
1634
+ * See {@link UserDetailV2Response} (`users.detailV2()`) for the v2 endpoint
1635
+ * and its additional fields.
1636
+ */
1380
1637
  interface UserDetailResponse {
1381
1638
  /** Basic user info with self-introduction. */
1382
1639
  user: PixivUserItem;
@@ -1387,6 +1644,96 @@ interface UserDetailResponse {
1387
1644
  /** Workspace / desk-setup information. */
1388
1645
  workspace: PixivUserProfileWorkspace;
1389
1646
  }
1647
+ /** Response shape for GET /v1/user/ai-show-settings. */
1648
+ interface AiShowSettingsResponse {
1649
+ /** Whether AI-generated works are shown. */
1650
+ showAi: boolean;
1651
+ }
1652
+ /** Response shape for GET /v1/user/restricted-mode-settings. */
1653
+ interface RestrictedModeSettingsResponse {
1654
+ /** Whether restricted mode is enabled. */
1655
+ isRestrictedModeEnabled: boolean;
1656
+ }
1657
+ /** A tag in the authenticated user's mute list. */
1658
+ interface MutedTag {
1659
+ /** The muted tag. */
1660
+ tag: {
1661
+ /** Tag name. */
1662
+ name: string;
1663
+ };
1664
+ /** Whether the tag occupies a premium-only mute slot. */
1665
+ isPremiumSlot: boolean;
1666
+ }
1667
+ /** Response shape for GET /v1/mute/list. */
1668
+ interface MuteListResponse {
1669
+ /** Muted tags. */
1670
+ mutedTags: MutedTag[];
1671
+ /** Muted users. The item shape is not known, so callers must narrow it. */
1672
+ mutedUsers: unknown[];
1673
+ /** Total number of muted items. */
1674
+ mutedCount: number;
1675
+ /** Number of muted tags. */
1676
+ mutedTagsCount: number;
1677
+ /** Number of muted users. */
1678
+ mutedUsersCount: number;
1679
+ /** Maximum number of mute entries for the current account. */
1680
+ muteLimitCount: number;
1681
+ /** Mute limits shown in the UI text, by premium status. */
1682
+ forText: {
1683
+ /** Mute limit for accounts without premium. */
1684
+ muteLimitCountIfNoPremium: number;
1685
+ /** Mute limit for premium accounts. */
1686
+ muteLimitCountIfPremium: number;
1687
+ };
1688
+ }
1689
+ /** Account state flags returned by GET /v1/user/me/state. */
1690
+ interface UserMeState {
1691
+ /** Whether the mail address is verified. */
1692
+ isMailAuthorized: boolean;
1693
+ /** Whether a mail address is registered. */
1694
+ hasMailAddress: boolean;
1695
+ /** Whether the pixiv ID has been changed. */
1696
+ hasChangedPixivId: boolean;
1697
+ /** Whether the pixiv ID can be changed. */
1698
+ canChangePixivId: boolean;
1699
+ /** Whether a password is set. */
1700
+ hasPassword: boolean;
1701
+ /** Whether a policy agreement is required. */
1702
+ requirePolicyAgreement: boolean;
1703
+ /** Whether the account has no login method. */
1704
+ noLoginMethod: boolean;
1705
+ /** Whether the account is restricted. */
1706
+ isUserRestricted: boolean;
1707
+ /** Whether official event notifications are enabled. */
1708
+ isOfficialEventNotificationsEnabled: boolean;
1709
+ }
1710
+ /** Profile of the authenticated user returned by GET /v1/user/me/state. */
1711
+ interface UserMeProfile {
1712
+ /** User ID. */
1713
+ userId: number;
1714
+ /** pixiv ID (account name). */
1715
+ pixivId: string;
1716
+ /** Display name. */
1717
+ name: string;
1718
+ /** Profile image URLs. */
1719
+ profileImageUrls: ProfileImageUrls;
1720
+ /** Whether the account has premium. */
1721
+ isPremium: boolean;
1722
+ /** Restriction level of the account's content setting. */
1723
+ xRestrict: number;
1724
+ }
1725
+ /** Response shape for GET /v1/user/me/state. */
1726
+ interface UserMeStateResponse {
1727
+ /** Account state flags. */
1728
+ userState: UserMeState;
1729
+ /** Profile of the authenticated user. */
1730
+ profile: UserMeProfile;
1731
+ }
1732
+ /** Response shape for GET /v1/notification/has-unread-notifications. */
1733
+ interface HasUnreadNotificationsResponse {
1734
+ /** Whether there are unread notifications. */
1735
+ hasUnreadNotifications: boolean;
1736
+ }
1390
1737
  /** Page response for GET /v1/user/illusts. */
1391
1738
  interface UserIllustsPage {
1392
1739
  /** The user whose illusts are listed. */
@@ -1530,9 +1877,35 @@ interface IllustSearchParams {
1530
1877
  filter?: (typeof OSFilter)[keyof typeof OSFilter];
1531
1878
  /** AI-generated content filter: `0` = hide AI works, `1` = show only AI works. */
1532
1879
  searchAiType?: 0 | 1;
1880
+ /** Include results matched through translated tags (sent only when set). */
1881
+ includeTranslatedTagResults?: boolean;
1882
+ /** Merge plain-keyword results into tag results (sent only when set). */
1883
+ mergePlainKeywordResults?: boolean;
1884
+ /** Include works that may violate guidelines (sent only when set). */
1885
+ includePotentialViolationWorks?: boolean;
1886
+ /**
1887
+ * Content type selector as sent by the Android client, e.g.
1888
+ * `"illust_and_manga_and_ugoira"` (sent only when set).
1889
+ */
1890
+ contentType?: string;
1533
1891
  /** Zero-based offset for pagination. */
1534
1892
  offset?: number;
1535
1893
  }
1894
+ /** Parameters for the popular-preview illust search. */
1895
+ interface IllustPopularPreviewParams {
1896
+ /** Search keyword. */
1897
+ word: string;
1898
+ /** How to match the keyword against works (default: `"partial_match_for_tags"`). */
1899
+ searchTarget?: (typeof SearchTarget)[keyof typeof SearchTarget];
1900
+ /** AI-generated content filter: `0` = hide AI works, `1` = show only AI works. */
1901
+ searchAiType?: 0 | 1;
1902
+ /** Include results matched through translated tags (sent only when set). */
1903
+ includeTranslatedTagResults?: boolean;
1904
+ /** Merge plain-keyword results into tag results (sent only when set). */
1905
+ mergePlainKeywordResults?: boolean;
1906
+ /** OS filter to apply (default: `"for_ios"`). */
1907
+ filter?: (typeof OSFilter)[keyof typeof OSFilter];
1908
+ }
1536
1909
  /** Parameters for fetching the illust ranking. */
1537
1910
  interface IllustRankingParams {
1538
1911
  /** Ranking category (default: `"day"`). */
@@ -1576,6 +1949,10 @@ interface IllustRecommendedParams {
1576
1949
  * IDs of illusts already seen by the user.
1577
1950
  * The API will exclude these from the recommendations.
1578
1951
  * Serialised as repeated `viewed[]=<id>` query parameters.
1952
+ *
1953
+ * Sent with `GET`, so a long list fails with `414` (observed at about 500
1954
+ * IDs, roughly 9.5 KB). `POST /v1/illust/recommended` returns `404`, so
1955
+ * there is no POST alternative.
1579
1956
  */
1580
1957
  viewed?: number[];
1581
1958
  }
@@ -1621,6 +1998,13 @@ interface IllustCommentsParams {
1621
1998
  */
1622
1999
  includeTotalComments?: boolean;
1623
2000
  }
2001
+ /** Parameters for fetching replies to an illust comment. */
2002
+ interface IllustCommentRepliesParams {
2003
+ /** ID of the comment to fetch replies for. */
2004
+ commentId: number;
2005
+ /** Zero-based offset for pagination. */
2006
+ offset?: number;
2007
+ }
1624
2008
  /** Parameters for fetching bookmark metadata for an illust. */
1625
2009
  interface IllustBookmarkDetailParams {
1626
2010
  /** ID of the illust to fetch bookmark metadata for. */
@@ -1689,6 +2073,23 @@ declare class IllustResource {
1689
2073
  * ```
1690
2074
  */
1691
2075
  search(params: IllustSearchParams): PaginatedResultAsync<IllustListPage, IllustListPage['illusts'][number]>;
2076
+ /**
2077
+ * Fetches the popular-preview illust search results (a single page of 30).
2078
+ * GET /v1/search/popular-preview/illust
2079
+ *
2080
+ * The endpoint returns no `next_url`, so the result is not paginated.
2081
+ *
2082
+ * @param params - Request parameters
2083
+ *
2084
+ * @example
2085
+ * ```ts
2086
+ * const result = await client.illusts.popularPreview({ word: 'cat' })
2087
+ * if (result.isOk) {
2088
+ * console.log(result.value.illusts.length)
2089
+ * }
2090
+ * ```
2091
+ */
2092
+ popularPreview(params: IllustPopularPreviewParams): ResultAsync<IllustPopularPreviewResponse, PixivError>;
1692
2093
  /**
1693
2094
  * Fetches the illust ranking.
1694
2095
  * GET /v1/illust/ranking
@@ -1738,6 +2139,13 @@ declare class IllustResource {
1738
2139
  * @param params - Request parameters
1739
2140
  */
1740
2141
  comments(params: IllustCommentsParams): PaginatedResultAsync<IllustCommentsPage, IllustComment>;
2142
+ /**
2143
+ * Fetches replies to a comment on an illust.
2144
+ * GET /v2/illust/comment/replies
2145
+ *
2146
+ * @param params - Request parameters
2147
+ */
2148
+ commentReplies(params: IllustCommentRepliesParams): PaginatedResultAsync<IllustCommentRepliesPage, IllustComment>;
1741
2149
  /**
1742
2150
  * Fetches bookmark metadata (tags, visibility) for an illust.
1743
2151
  * GET /v2/illust/bookmark/detail
@@ -1795,9 +2203,28 @@ interface NovelSearchParams {
1795
2203
  endDate?: string;
1796
2204
  /** AI-generated content filter: `0` = hide AI works, `1` = show only AI works. */
1797
2205
  searchAiType?: 0 | 1;
2206
+ /** Include results matched through translated tags (sent only when set). */
2207
+ includeTranslatedTagResults?: boolean;
2208
+ /** Merge plain-keyword results into tag results (sent only when set). */
2209
+ mergePlainKeywordResults?: boolean;
2210
+ /** Include works that may violate guidelines (sent only when set). */
2211
+ includePotentialViolationWorks?: boolean;
1798
2212
  /** Zero-based offset for pagination. */
1799
2213
  offset?: number;
1800
2214
  }
2215
+ /** Parameters for the popular-preview novel search. */
2216
+ interface NovelPopularPreviewParams {
2217
+ /** Search keyword. */
2218
+ word: string;
2219
+ /** How to match the keyword against works (default: `"partial_match_for_tags"`). */
2220
+ searchTarget?: (typeof SearchTarget)[keyof typeof SearchTarget];
2221
+ /** AI-generated content filter: `0` = hide AI works, `1` = show only AI works. */
2222
+ searchAiType?: 0 | 1;
2223
+ /** Include results matched through translated tags (sent only when set). */
2224
+ includeTranslatedTagResults?: boolean;
2225
+ /** Merge plain-keyword results into tag results (sent only when set). */
2226
+ mergePlainKeywordResults?: boolean;
2227
+ }
1801
2228
  /** Parameters for fetching the novel ranking. */
1802
2229
  interface NovelRankingParams {
1803
2230
  /** Ranking category (default: `"day"`). */
@@ -1809,6 +2236,17 @@ interface NovelRankingParams {
1809
2236
  /** Zero-based offset for pagination. */
1810
2237
  offset?: number;
1811
2238
  }
2239
+ /** A novel the user has viewed, sent as view history. */
2240
+ interface NovelViewedEntry {
2241
+ /** ID of the viewed novel. */
2242
+ id: number;
2243
+ /**
2244
+ * When the novel was viewed. A `Date` is formatted as ISO 8601 with
2245
+ * milliseconds and the local UTC offset (e.g. `2026-10-14T23:23:55.960+09:00`);
2246
+ * a string is sent as-is.
2247
+ */
2248
+ viewedAt: Date | string;
2249
+ }
1812
2250
  /** Parameters for fetching recommended novels. */
1813
2251
  interface NovelRecommendedParams {
1814
2252
  /** OS filter to apply (default: `"for_ios"`). */
@@ -1820,6 +2258,21 @@ interface NovelRecommendedParams {
1820
2258
  * extracted from a previous page's `next_url` via {@link parseNextUrl}.
1821
2259
  */
1822
2260
  maxBookmarkIdForRecommend?: number;
2261
+ /**
2262
+ * View history to send with the request.
2263
+ * When non-empty, the first page is fetched with `POST` and the history is
2264
+ * serialised as paired `view_novel_ids[]` / `view_novel_datetimes[]` body
2265
+ * fields; pagination via `next_url` still uses `GET`. Omit (or pass an empty
2266
+ * array) to keep the plain `GET` request.
2267
+ *
2268
+ * Observed limits: `GET` fails with `414` at 100 pairs, while `POST` succeeds
2269
+ * with 200 pairs and fails with `500` at 1000 pairs. Whether the history
2270
+ * changes the recommendations is unproven.
2271
+ *
2272
+ * When a response interceptor such as the DB recorder is used, the history
2273
+ * is stored as part of the recorded request body.
2274
+ */
2275
+ viewed?: NovelViewedEntry[];
1823
2276
  }
1824
2277
  /** Parameters for fetching a novel series. */
1825
2278
  interface NovelSeriesParams {
@@ -1855,9 +2308,21 @@ interface NovelCommentsParams {
1855
2308
  novelId: number;
1856
2309
  /** Zero-based offset for pagination. */
1857
2310
  offset?: number;
1858
- /** Whether to include the `totalComments` count in the response. */
2311
+ /**
2312
+ * Has no effect: `/v3/novel/comments` does not return `totalComments`
2313
+ * and this parameter is not sent.
2314
+ *
2315
+ * @deprecated Read `novel.totalComments` from `novels.detail()` instead.
2316
+ */
1859
2317
  includeTotalComments?: boolean;
1860
2318
  }
2319
+ /** Parameters for fetching replies to a novel comment. */
2320
+ interface NovelCommentRepliesParams {
2321
+ /** ID of the comment to fetch replies for. */
2322
+ commentId: number;
2323
+ /** Zero-based offset for pagination. */
2324
+ offset?: number;
2325
+ }
1861
2326
  /** Parameters for fetching newly posted novels. */
1862
2327
  interface NovelNewParams {
1863
2328
  /** OS filter to apply (default: `"for_ios"`). */
@@ -1928,6 +2393,30 @@ declare class NovelResource {
1928
2393
  * ```
1929
2394
  */
1930
2395
  search(params: NovelSearchParams): PaginatedResultAsync<NovelListPage, PixivNovelItem>;
2396
+ /**
2397
+ * Fetches the popular-preview novel search results (a single page of 30).
2398
+ * GET /v1/search/popular-preview/novel
2399
+ *
2400
+ * The endpoint returns no `next_url`, so the result is not paginated.
2401
+ *
2402
+ * @param params - Request parameters
2403
+ *
2404
+ * @example
2405
+ * ```ts
2406
+ * const result = await client.novels.popularPreview({ word: 'fantasy' })
2407
+ * if (result.isOk) {
2408
+ * console.log(result.value.novels.length)
2409
+ * }
2410
+ * ```
2411
+ */
2412
+ popularPreview(params: NovelPopularPreviewParams): ResultAsync<NovelPopularPreviewResponse, PixivError>;
2413
+ /**
2414
+ * Fetches currently trending novel tags, each with a representative illust.
2415
+ * GET /v1/trending-tags/novel
2416
+ *
2417
+ * Takes no parameters: the endpoint ignores `filter`.
2418
+ */
2419
+ trendingTags(): ResultAsync<TrendingTagsNovelResponse, PixivError>;
1931
2420
  /**
1932
2421
  * Fetches the novel ranking.
1933
2422
  * GET /v1/novel/ranking
@@ -1937,7 +2426,8 @@ declare class NovelResource {
1937
2426
  ranking(params?: NovelRankingParams): PaginatedResultAsync<NovelListPage, PixivNovelItem>;
1938
2427
  /**
1939
2428
  * Fetches recommended novels.
1940
- * GET /v1/novel/recommended
2429
+ * GET /v1/novel/recommended, or POST /v1/novel/recommended when
2430
+ * `params.viewed` is non-empty.
1941
2431
  *
1942
2432
  * @param params - Request parameters
1943
2433
  */
@@ -1949,6 +2439,20 @@ declare class NovelResource {
1949
2439
  * @param params - Request parameters
1950
2440
  */
1951
2441
  series(params: NovelSeriesParams): PaginatedResultAsync<NovelSeriesPage, PixivNovelItem>;
2442
+ /**
2443
+ * Fetches the authenticated user's novel series watchlist.
2444
+ * GET /v1/watchlist/novel
2445
+ *
2446
+ * Takes no parameters; later pages follow the server-provided `next_url`.
2447
+ */
2448
+ watchlist(): PaginatedResultAsync<WatchlistNovelPage, WatchlistSeries>;
2449
+ /**
2450
+ * Fetches the novels with a saved reading position (marker).
2451
+ * GET /v2/novel/markers
2452
+ *
2453
+ * Takes no parameters; later pages follow the server-provided `next_url`.
2454
+ */
2455
+ markers(): PaginatedResultAsync<NovelMarkersPage, MarkedNovel>;
1952
2456
  /**
1953
2457
  * Adds a novel bookmark.
1954
2458
  * POST /v2/novel/bookmark/add
@@ -1972,11 +2476,18 @@ declare class NovelResource {
1972
2476
  follow(params?: NovelFollowParams): PaginatedResultAsync<NovelListPage, PixivNovelItem>;
1973
2477
  /**
1974
2478
  * Fetches comments posted on a novel.
1975
- * GET /v1/novel/comments
2479
+ * GET /v3/novel/comments
1976
2480
  *
1977
2481
  * @param params - Request parameters
1978
2482
  */
1979
2483
  comments(params: NovelCommentsParams): PaginatedResultAsync<NovelCommentsPage, NovelComment>;
2484
+ /**
2485
+ * Fetches replies to a comment on a novel.
2486
+ * GET /v2/novel/comment/replies
2487
+ *
2488
+ * @param params - Request parameters
2489
+ */
2490
+ commentReplies(params: NovelCommentRepliesParams): PaginatedResultAsync<NovelCommentRepliesPage, NovelComment>;
1980
2491
  /**
1981
2492
  * Fetches newly posted novels.
1982
2493
  * GET /v1/novel/new
@@ -2189,9 +2700,25 @@ declare class UserResource {
2189
2700
  * Fetches detailed profile information for a user.
2190
2701
  * GET /v1/user/detail
2191
2702
  *
2703
+ * See {@link UserResource.detailV2} for the v2 endpoint, which exposes
2704
+ * additional fields (`disabledLinks`, `profile.badge`).
2705
+ *
2192
2706
  * @param params - Request parameters
2193
2707
  */
2194
2708
  detail(params: UserDetailParams): ResultAsync<UserDetailResponse, PixivError>;
2709
+ /**
2710
+ * Fetches detailed profile information for a user using the v2 endpoint.
2711
+ * GET /v2/user/detail
2712
+ *
2713
+ * Unlike {@link UserResource.detail}, the response includes `disabledLinks`
2714
+ * and `profile.badge`, several profile values are `null` instead of empty
2715
+ * strings or `0`, and the v1-only fields (`profile.pawooUrl`,
2716
+ * `profile.totalIllustBookmarksPublic`, `profilePublicity.pawoo`,
2717
+ * `workspace.workspaceImageUrl`) are absent.
2718
+ *
2719
+ * @param params - Request parameters
2720
+ */
2721
+ detailV2(params: UserDetailParams): ResultAsync<UserDetailV2Response, PixivError>;
2195
2722
  /**
2196
2723
  * Searches for users.
2197
2724
  * GET /v1/search/user
@@ -2294,6 +2821,31 @@ declare class UserResource {
2294
2821
  * @param params - Request parameters
2295
2822
  */
2296
2823
  editAiShowSettings(params: UserEditAiShowSettingsParams): ResultAsync<Record<string, never>, PixivError>;
2824
+ /**
2825
+ * Fetches the authenticated user's AI-generated-work display setting.
2826
+ * GET /v1/user/ai-show-settings
2827
+ */
2828
+ aiShowSettings(): ResultAsync<AiShowSettingsResponse, PixivError>;
2829
+ /**
2830
+ * Fetches the authenticated user's restricted-mode setting.
2831
+ * GET /v1/user/restricted-mode-settings
2832
+ */
2833
+ restrictedModeSettings(): ResultAsync<RestrictedModeSettingsResponse, PixivError>;
2834
+ /**
2835
+ * Fetches the authenticated user's mute list.
2836
+ * GET /v1/mute/list
2837
+ */
2838
+ muteList(): ResultAsync<MuteListResponse, PixivError>;
2839
+ /**
2840
+ * Fetches the authenticated user's account state and profile.
2841
+ * GET /v1/user/me/state
2842
+ */
2843
+ meState(): ResultAsync<UserMeStateResponse, PixivError>;
2844
+ /**
2845
+ * Fetches whether the authenticated user has unread notifications.
2846
+ * GET /v1/notification/has-unread-notifications
2847
+ */
2848
+ hasUnreadNotifications(): ResultAsync<HasUnreadNotificationsResponse, PixivError>;
2297
2849
  }
2298
2850
  //#endregion
2299
2851
  //#region src/resources/spotlight.d.ts
@@ -2343,6 +2895,13 @@ declare class MangaResource {
2343
2895
  * @param params - Request parameters
2344
2896
  */
2345
2897
  recommended(params?: MangaRecommendedParams): PaginatedResultAsync<MangaRecommendedPage, PixivIllustItem>;
2898
+ /**
2899
+ * Fetches the authenticated user's manga series watchlist.
2900
+ * GET /v1/watchlist/manga
2901
+ *
2902
+ * Takes no parameters; later pages follow the server-provided `next_url`.
2903
+ */
2904
+ watchlist(): PaginatedResultAsync<WatchlistMangaPage, WatchlistSeries>;
2346
2905
  }
2347
2906
  //#endregion
2348
2907
  //#region src/resources/ugoira.d.ts
@@ -2455,5 +3014,5 @@ export declare class PixivClient {
2455
3014
  static of(refreshToken: string, options?: PixivClientOptions): Promise<PixivClient>;
2456
3015
  }
2457
3016
  //#endregion
2458
- export type { BookmarkDetail, BookmarkDetailTag, BookmarkTag, ErrResult, Frame, HttpMethod, IllustBookmarkAddParams, IllustBookmarkDeleteParams, IllustBookmarkDetailParams, IllustBookmarkDetailResponse, IllustComment, IllustCommentStamp, IllustCommentsPage, IllustCommentsParams, IllustDetailParams, IllustDetailResponse, IllustFollowParams, IllustListPage, IllustNewParams, IllustRankingParams, IllustRecommendedPage, IllustRecommendedParams, IllustRelatedParams, IllustSearchParams, IllustSeriesDetail, IllustSeriesPage, IllustSeriesParams, IllustTrendingTagsParams, ImageUrls, MangaRecommendedPage, MetaPages, MetaSinglePage, NovelBookmarkAddParams, NovelBookmarkDeleteParams, NovelComment, NovelCommentsPage, NovelCommentsParams, NovelDetailParams, NovelDetailResponse, NovelFollowParams, NovelListPage, NovelNewParams, NovelRankingParams, NovelRecommendedPage, NovelRecommendedParams, NovelRelatedParams, NovelSearchParams, NovelSeriesDetail, NovelSeriesPage, NovelSeriesParams, NovelTextParams, OkResult, PagedResponse, ParsedNextUrl, PixivApiErrorBody, PixivClientOptions, PixivError, PixivIllustItem, PixivNovelItem, PixivUgoiraItem, PixivUser, PixivUserItem, PixivUserPreviewItem, PixivUserProfile, PixivUserProfilePublicity, PixivUserProfileWorkspace, PrivacyPolicy, ProfileImageUrls, ResponseInterceptor, ResponseRecord, Result, Series, SpotlightArticle, SpotlightArticlesPage, SpotlightArticlesParams, Tag, TrendingTagIllust, TrendingTagsIllustResponse, UgoiraMetadataResponse, UserBookmarkTagsIllustPage, UserBookmarkTagsIllustParams, UserBookmarksIllustPage, UserBookmarksIllustParams, UserBookmarksNovelPage, UserBookmarksNovelParams, UserDetailParams, UserDetailResponse, UserEditAiShowSettingsParams, UserFollowAddParams, UserFollowDeleteParams, UserFollowerPage, UserFollowerParams, UserFollowingPage, UserFollowingParams, UserIllustsPage, UserIllustsParams, UserListPage, UserListParams, UserMypixivPage, UserMypixivParams, UserNovelsPage, UserNovelsParams, UserRecommendedPage, UserRecommendedParams, UserRelatedPage, UserRelatedParams, UserSearchPage, UserSearchParams, WebviewNovel, WebviewNovelNavigationInfo, WebviewNovelRating, WebviewNovelSeriesNavigation, ZipUrls };
3017
+ export type { AiShowSettingsResponse, BookmarkDetail, BookmarkDetailTag, BookmarkTag, ErrResult, Frame, HasUnreadNotificationsResponse, HttpMethod, IllustBookmarkAddParams, IllustBookmarkDeleteParams, IllustBookmarkDetailParams, IllustBookmarkDetailResponse, IllustComment, IllustCommentRepliesPage, IllustCommentRepliesParams, IllustCommentStamp, IllustCommentsPage, IllustCommentsParams, IllustDetailParams, IllustDetailResponse, IllustFollowParams, IllustListPage, IllustNewParams, IllustPopularPreviewParams, IllustPopularPreviewResponse, IllustRankingParams, IllustRecommendedPage, IllustRecommendedParams, IllustRelatedParams, IllustRequest, IllustRequestCollaborateStatus, IllustRequestCollaborateUserSample, IllustRequestInfo, IllustRequestUser, IllustSearchParams, IllustSeriesDetail, IllustSeriesPage, IllustSeriesParams, IllustTrendingTagsParams, ImageUrls, MangaRecommendedPage, MarkedNovel, MetaPages, MetaSinglePage, MuteListResponse, MutedTag, NovelBookmarkAddParams, NovelBookmarkDeleteParams, NovelComment, NovelCommentRepliesPage, NovelCommentRepliesParams, NovelCommentsPage, NovelCommentsParams, NovelDetailParams, NovelDetailResponse, NovelFollowParams, NovelListPage, NovelMarker, NovelMarkersPage, NovelNewParams, NovelPopularPreviewParams, NovelPopularPreviewResponse, NovelRankingParams, NovelRecommendedPage, NovelRecommendedParams, NovelRelatedParams, NovelSearchParams, NovelSeriesDetail, NovelSeriesPage, NovelSeriesParams, NovelTextParams, NovelViewedEntry, OkResult, PagedResponse, ParsedNextUrl, PixivApiErrorBody, PixivClientOptions, PixivError, PixivIllustItem, PixivNovelItem, PixivUgoiraItem, PixivUser, PixivUserItem, PixivUserPreviewItem, PixivUserProfile, PixivUserProfileBadge, PixivUserProfilePublicity, PixivUserProfilePublicityV2, PixivUserProfileV2, PixivUserProfileWorkspace, PixivUserProfileWorkspaceV2, PrivacyPolicy, ProfileImageUrls, ResponseInterceptor, ResponseRecord, RestrictedModeSettingsResponse, Result, Series, SpotlightArticle, SpotlightArticlesPage, SpotlightArticlesParams, Tag, TrendingTagIllust, TrendingTagsIllustResponse, TrendingTagsNovelResponse, UgoiraMetadataResponse, UserBookmarkTagsIllustPage, UserBookmarkTagsIllustParams, UserBookmarksIllustPage, UserBookmarksIllustParams, UserBookmarksNovelPage, UserBookmarksNovelParams, UserDetailParams, UserDetailResponse, UserDetailV2Response, UserEditAiShowSettingsParams, UserFollowAddParams, UserFollowDeleteParams, UserFollowerPage, UserFollowerParams, UserFollowingPage, UserFollowingParams, UserIllustsPage, UserIllustsParams, UserListPage, UserListParams, UserMeProfile, UserMeState, UserMeStateResponse, UserMypixivPage, UserMypixivParams, UserNovelsPage, UserNovelsParams, UserRecommendedPage, UserRecommendedParams, UserRelatedPage, UserRelatedParams, UserSearchPage, UserSearchParams, WatchlistMangaPage, WatchlistNovelPage, WatchlistSeries, WebviewNovel, WebviewNovelNavigationInfo, WebviewNovelRating, WebviewNovelSeriesNavigation, ZipUrls };
2459
3018
  //# sourceMappingURL=index.d.ts.map