@book000/pixivts 0.64.0-beta.1 → 0.64.0-beta.10
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 +4 -4
- package/dist/index.cjs +177 -4
- package/dist/index.d.cts +536 -8
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +536 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +177 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -72,11 +72,11 @@ Creates a `PixivClient` by exchanging the given refresh token for an access toke
|
|
|
72
72
|
|
|
73
73
|
| Namespace | Methods |
|
|
74
74
|
|---|---|
|
|
75
|
-
| `illusts` | `detail`, `related`, `search`, `ranking`, `recommended`, `series`, `bookmarkAdd`, `bookmarkDelete`, `trendingTags` |
|
|
76
|
-
| `novels` | `detail`, `text`, `related`, `search`, `ranking`, `recommended`, `series`, `bookmarkAdd`, `bookmarkDelete` |
|
|
77
|
-
| `users` | `detail`, `search`, `illusts`, `novels`, `following`, `followAdd`, `followDelete`, `related`, `recommended`, `follower`, `mypixiv`, `list`, `bookmarkTagsIllust`, `editAiShowSettings` |
|
|
75
|
+
| `illusts` | `detail`, `related`, `search`, `ranking`, `recommended`, `series`, `bookmarkAdd`, `bookmarkDelete`, `trendingTags`, `popularPreview` |
|
|
76
|
+
| `novels` | `detail`, `text`, `related`, `search`, `ranking`, `recommended`, `series`, `bookmarkAdd`, `bookmarkDelete`, `trendingTags`, `popularPreview`, `watchlist`, `markers` |
|
|
77
|
+
| `users` | `detail`, `detailV2`, `search`, `illusts`, `novels`, `following`, `followAdd`, `followDelete`, `related`, `recommended`, `follower`, `mypixiv`, `list`, `bookmarkTagsIllust`, `editAiShowSettings`, `aiShowSettings`, `restrictedModeSettings`, `muteList`, `meState`, `hasUnreadNotifications` |
|
|
78
78
|
| `users.bookmarks` | `illusts`, `novels` |
|
|
79
|
-
| `manga` | `recommended` |
|
|
79
|
+
| `manga` | `recommended`, `watchlist` |
|
|
80
80
|
| `ugoira` | `metadata` |
|
|
81
81
|
| `spotlight` | `articles` |
|
|
82
82
|
| `images` | `fetch` |
|
package/dist/index.cjs
CHANGED
|
@@ -1076,10 +1076,40 @@ var IllustResource = class {
|
|
|
1076
1076
|
startDate: params.startDate,
|
|
1077
1077
|
endDate: params.endDate,
|
|
1078
1078
|
searchAiType: params.searchAiType,
|
|
1079
|
+
includeTranslatedTagResults: params.includeTranslatedTagResults,
|
|
1080
|
+
mergePlainKeywordResults: params.mergePlainKeywordResults,
|
|
1081
|
+
includePotentialViolationWorks: params.includePotentialViolationWorks,
|
|
1082
|
+
contentType: params.contentType,
|
|
1079
1083
|
offset: params.offset
|
|
1080
1084
|
})), this.#http, (page) => page.illusts);
|
|
1081
1085
|
}
|
|
1082
1086
|
/**
|
|
1087
|
+
* Fetches the popular-preview illust search results (a single page of 30).
|
|
1088
|
+
* GET /v1/search/popular-preview/illust
|
|
1089
|
+
*
|
|
1090
|
+
* The endpoint returns no `next_url`, so the result is not paginated.
|
|
1091
|
+
*
|
|
1092
|
+
* @param params - Request parameters
|
|
1093
|
+
*
|
|
1094
|
+
* @example
|
|
1095
|
+
* ```ts
|
|
1096
|
+
* const result = await client.illusts.popularPreview({ word: 'cat' })
|
|
1097
|
+
* if (result.isOk) {
|
|
1098
|
+
* console.log(result.value.illusts.length)
|
|
1099
|
+
* }
|
|
1100
|
+
* ```
|
|
1101
|
+
*/
|
|
1102
|
+
popularPreview(params) {
|
|
1103
|
+
return this.#http.get("/v1/search/popular-preview/illust", buildParams({
|
|
1104
|
+
word: params.word,
|
|
1105
|
+
searchTarget: params.searchTarget ?? "partial_match_for_tags",
|
|
1106
|
+
filter: params.filter ?? "for_ios",
|
|
1107
|
+
searchAiType: params.searchAiType,
|
|
1108
|
+
includeTranslatedTagResults: params.includeTranslatedTagResults,
|
|
1109
|
+
mergePlainKeywordResults: params.mergePlainKeywordResults
|
|
1110
|
+
}));
|
|
1111
|
+
}
|
|
1112
|
+
/**
|
|
1083
1113
|
* Fetches the illust ranking.
|
|
1084
1114
|
* GET /v1/illust/ranking
|
|
1085
1115
|
*
|
|
@@ -1173,6 +1203,18 @@ var IllustResource = class {
|
|
|
1173
1203
|
})), this.#http, (page) => page.comments);
|
|
1174
1204
|
}
|
|
1175
1205
|
/**
|
|
1206
|
+
* Fetches replies to a comment on an illust.
|
|
1207
|
+
* GET /v2/illust/comment/replies
|
|
1208
|
+
*
|
|
1209
|
+
* @param params - Request parameters
|
|
1210
|
+
*/
|
|
1211
|
+
commentReplies(params) {
|
|
1212
|
+
return PaginatedResultAsync.fromResultAsync(this.#http.get("/v2/illust/comment/replies", buildParams({
|
|
1213
|
+
commentId: params.commentId,
|
|
1214
|
+
offset: params.offset
|
|
1215
|
+
})), this.#http, (page) => page.comments);
|
|
1216
|
+
}
|
|
1217
|
+
/**
|
|
1176
1218
|
* Fetches bookmark metadata (tags, visibility) for an illust.
|
|
1177
1219
|
* GET /v2/illust/bookmark/detail
|
|
1178
1220
|
*
|
|
@@ -1327,10 +1369,47 @@ var NovelResource = class {
|
|
|
1327
1369
|
startDate: params.startDate,
|
|
1328
1370
|
endDate: params.endDate,
|
|
1329
1371
|
searchAiType: params.searchAiType,
|
|
1372
|
+
includeTranslatedTagResults: params.includeTranslatedTagResults,
|
|
1373
|
+
mergePlainKeywordResults: params.mergePlainKeywordResults,
|
|
1374
|
+
includePotentialViolationWorks: params.includePotentialViolationWorks,
|
|
1330
1375
|
offset: params.offset
|
|
1331
1376
|
})), this.#http, (page) => page.novels);
|
|
1332
1377
|
}
|
|
1333
1378
|
/**
|
|
1379
|
+
* Fetches the popular-preview novel search results (a single page of 30).
|
|
1380
|
+
* GET /v1/search/popular-preview/novel
|
|
1381
|
+
*
|
|
1382
|
+
* The endpoint returns no `next_url`, so the result is not paginated.
|
|
1383
|
+
*
|
|
1384
|
+
* @param params - Request parameters
|
|
1385
|
+
*
|
|
1386
|
+
* @example
|
|
1387
|
+
* ```ts
|
|
1388
|
+
* const result = await client.novels.popularPreview({ word: 'fantasy' })
|
|
1389
|
+
* if (result.isOk) {
|
|
1390
|
+
* console.log(result.value.novels.length)
|
|
1391
|
+
* }
|
|
1392
|
+
* ```
|
|
1393
|
+
*/
|
|
1394
|
+
popularPreview(params) {
|
|
1395
|
+
return this.#http.get("/v1/search/popular-preview/novel", buildParams({
|
|
1396
|
+
word: params.word,
|
|
1397
|
+
searchTarget: params.searchTarget ?? "partial_match_for_tags",
|
|
1398
|
+
searchAiType: params.searchAiType,
|
|
1399
|
+
includeTranslatedTagResults: params.includeTranslatedTagResults,
|
|
1400
|
+
mergePlainKeywordResults: params.mergePlainKeywordResults
|
|
1401
|
+
}));
|
|
1402
|
+
}
|
|
1403
|
+
/**
|
|
1404
|
+
* Fetches currently trending novel tags, each with a representative illust.
|
|
1405
|
+
* GET /v1/trending-tags/novel
|
|
1406
|
+
*
|
|
1407
|
+
* Takes no parameters: the endpoint ignores `filter`.
|
|
1408
|
+
*/
|
|
1409
|
+
trendingTags() {
|
|
1410
|
+
return this.#http.get("/v1/trending-tags/novel");
|
|
1411
|
+
}
|
|
1412
|
+
/**
|
|
1334
1413
|
* Fetches the novel ranking.
|
|
1335
1414
|
* GET /v1/novel/ranking
|
|
1336
1415
|
*
|
|
@@ -1372,6 +1451,24 @@ var NovelResource = class {
|
|
|
1372
1451
|
})), this.#http, (page) => page.novels);
|
|
1373
1452
|
}
|
|
1374
1453
|
/**
|
|
1454
|
+
* Fetches the authenticated user's novel series watchlist.
|
|
1455
|
+
* GET /v1/watchlist/novel
|
|
1456
|
+
*
|
|
1457
|
+
* Takes no parameters; later pages follow the server-provided `next_url`.
|
|
1458
|
+
*/
|
|
1459
|
+
watchlist() {
|
|
1460
|
+
return PaginatedResultAsync.fromResultAsync(this.#http.get("/v1/watchlist/novel"), this.#http, (page) => page.series);
|
|
1461
|
+
}
|
|
1462
|
+
/**
|
|
1463
|
+
* Fetches the novels with a saved reading position (marker).
|
|
1464
|
+
* GET /v2/novel/markers
|
|
1465
|
+
*
|
|
1466
|
+
* Takes no parameters; later pages follow the server-provided `next_url`.
|
|
1467
|
+
*/
|
|
1468
|
+
markers() {
|
|
1469
|
+
return PaginatedResultAsync.fromResultAsync(this.#http.get("/v2/novel/markers"), this.#http, (page) => page.markedNovels);
|
|
1470
|
+
}
|
|
1471
|
+
/**
|
|
1375
1472
|
* Adds a novel bookmark.
|
|
1376
1473
|
* POST /v2/novel/bookmark/add
|
|
1377
1474
|
*
|
|
@@ -1409,15 +1506,26 @@ var NovelResource = class {
|
|
|
1409
1506
|
}
|
|
1410
1507
|
/**
|
|
1411
1508
|
* Fetches comments posted on a novel.
|
|
1412
|
-
* GET /
|
|
1509
|
+
* GET /v3/novel/comments
|
|
1413
1510
|
*
|
|
1414
1511
|
* @param params - Request parameters
|
|
1415
1512
|
*/
|
|
1416
1513
|
comments(params) {
|
|
1417
|
-
return PaginatedResultAsync.fromResultAsync(this.#http.get("/
|
|
1514
|
+
return PaginatedResultAsync.fromResultAsync(this.#http.get("/v3/novel/comments", buildParams({
|
|
1418
1515
|
novelId: params.novelId,
|
|
1419
|
-
offset: params.offset
|
|
1420
|
-
|
|
1516
|
+
offset: params.offset
|
|
1517
|
+
})), this.#http, (page) => page.comments);
|
|
1518
|
+
}
|
|
1519
|
+
/**
|
|
1520
|
+
* Fetches replies to a comment on a novel.
|
|
1521
|
+
* GET /v2/novel/comment/replies
|
|
1522
|
+
*
|
|
1523
|
+
* @param params - Request parameters
|
|
1524
|
+
*/
|
|
1525
|
+
commentReplies(params) {
|
|
1526
|
+
return PaginatedResultAsync.fromResultAsync(this.#http.get("/v2/novel/comment/replies", buildParams({
|
|
1527
|
+
commentId: params.commentId,
|
|
1528
|
+
offset: params.offset
|
|
1421
1529
|
})), this.#http, (page) => page.comments);
|
|
1422
1530
|
}
|
|
1423
1531
|
/**
|
|
@@ -1514,6 +1622,9 @@ var UserResource = class {
|
|
|
1514
1622
|
* Fetches detailed profile information for a user.
|
|
1515
1623
|
* GET /v1/user/detail
|
|
1516
1624
|
*
|
|
1625
|
+
* See {@link UserResource.detailV2} for the v2 endpoint, which exposes
|
|
1626
|
+
* additional fields (`disabledLinks`, `profile.badge`).
|
|
1627
|
+
*
|
|
1517
1628
|
* @param params - Request parameters
|
|
1518
1629
|
*/
|
|
1519
1630
|
detail(params) {
|
|
@@ -1523,6 +1634,24 @@ var UserResource = class {
|
|
|
1523
1634
|
}));
|
|
1524
1635
|
}
|
|
1525
1636
|
/**
|
|
1637
|
+
* Fetches detailed profile information for a user using the v2 endpoint.
|
|
1638
|
+
* GET /v2/user/detail
|
|
1639
|
+
*
|
|
1640
|
+
* Unlike {@link UserResource.detail}, the response includes `disabledLinks`
|
|
1641
|
+
* and `profile.badge`, several profile values are `null` instead of empty
|
|
1642
|
+
* strings or `0`, and the v1-only fields (`profile.pawooUrl`,
|
|
1643
|
+
* `profile.totalIllustBookmarksPublic`, `profilePublicity.pawoo`,
|
|
1644
|
+
* `workspace.workspaceImageUrl`) are absent.
|
|
1645
|
+
*
|
|
1646
|
+
* @param params - Request parameters
|
|
1647
|
+
*/
|
|
1648
|
+
detailV2(params) {
|
|
1649
|
+
return this.#http.get("/v2/user/detail", buildParams({
|
|
1650
|
+
userId: params.userId,
|
|
1651
|
+
filter: params.filter ?? "for_ios"
|
|
1652
|
+
}));
|
|
1653
|
+
}
|
|
1654
|
+
/**
|
|
1526
1655
|
* Searches for users.
|
|
1527
1656
|
* GET /v1/search/user
|
|
1528
1657
|
*
|
|
@@ -1697,6 +1826,41 @@ var UserResource = class {
|
|
|
1697
1826
|
const body = buildParams({ setting: params.setting });
|
|
1698
1827
|
return this.#http.post("/v1/user/ai-show-settings/edit", body.toString());
|
|
1699
1828
|
}
|
|
1829
|
+
/**
|
|
1830
|
+
* Fetches the authenticated user's AI-generated-work display setting.
|
|
1831
|
+
* GET /v1/user/ai-show-settings
|
|
1832
|
+
*/
|
|
1833
|
+
aiShowSettings() {
|
|
1834
|
+
return this.#http.get("/v1/user/ai-show-settings");
|
|
1835
|
+
}
|
|
1836
|
+
/**
|
|
1837
|
+
* Fetches the authenticated user's restricted-mode setting.
|
|
1838
|
+
* GET /v1/user/restricted-mode-settings
|
|
1839
|
+
*/
|
|
1840
|
+
restrictedModeSettings() {
|
|
1841
|
+
return this.#http.get("/v1/user/restricted-mode-settings");
|
|
1842
|
+
}
|
|
1843
|
+
/**
|
|
1844
|
+
* Fetches the authenticated user's mute list.
|
|
1845
|
+
* GET /v1/mute/list
|
|
1846
|
+
*/
|
|
1847
|
+
muteList() {
|
|
1848
|
+
return this.#http.get("/v1/mute/list");
|
|
1849
|
+
}
|
|
1850
|
+
/**
|
|
1851
|
+
* Fetches the authenticated user's account state and profile.
|
|
1852
|
+
* GET /v1/user/me/state
|
|
1853
|
+
*/
|
|
1854
|
+
meState() {
|
|
1855
|
+
return this.#http.get("/v1/user/me/state");
|
|
1856
|
+
}
|
|
1857
|
+
/**
|
|
1858
|
+
* Fetches whether the authenticated user has unread notifications.
|
|
1859
|
+
* GET /v1/notification/has-unread-notifications
|
|
1860
|
+
*/
|
|
1861
|
+
hasUnreadNotifications() {
|
|
1862
|
+
return this.#http.get("/v1/notification/has-unread-notifications");
|
|
1863
|
+
}
|
|
1700
1864
|
};
|
|
1701
1865
|
//#endregion
|
|
1702
1866
|
//#region src/resources/manga.ts
|
|
@@ -1720,6 +1884,15 @@ var MangaResource = class {
|
|
|
1720
1884
|
offset: params.offset
|
|
1721
1885
|
})), this.#http, (page) => page.illusts);
|
|
1722
1886
|
}
|
|
1887
|
+
/**
|
|
1888
|
+
* Fetches the authenticated user's manga series watchlist.
|
|
1889
|
+
* GET /v1/watchlist/manga
|
|
1890
|
+
*
|
|
1891
|
+
* Takes no parameters; later pages follow the server-provided `next_url`.
|
|
1892
|
+
*/
|
|
1893
|
+
watchlist() {
|
|
1894
|
+
return PaginatedResultAsync.fromResultAsync(this.#http.get("/v1/watchlist/manga"), this.#http, (page) => page.series);
|
|
1895
|
+
}
|
|
1723
1896
|
};
|
|
1724
1897
|
//#endregion
|
|
1725
1898
|
//#region src/resources/ugoira.ts
|