@book000/pixivts 0.51.2 → 0.51.3
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 +1 -2
- package/dist/checks.js +9 -9
- package/dist/checks.js.map +1 -1
- package/dist/checks.test.js +28 -28
- package/dist/checks.test.js.map +1 -1
- package/dist/http-client.d.ts +20 -20
- package/dist/http-client.d.ts.map +1 -1
- package/dist/http-client.js +28 -27
- package/dist/http-client.js.map +1 -1
- package/dist/http-client.test.js +11 -11
- package/dist/http-client.test.js.map +1 -1
- package/dist/options.d.ts +59 -59
- package/dist/options.d.ts.map +1 -1
- package/dist/options.js +34 -34
- package/dist/options.js.map +1 -1
- package/dist/pixiv.d.ts +96 -96
- package/dist/pixiv.js +104 -104
- package/dist/pixiv.js.map +1 -1
- package/dist/pixiv.test.js +47 -47
- package/dist/pixiv.test.js.map +1 -1
- package/dist/saving-responses/index.d.ts +33 -33
- package/dist/saving-responses/index.js +31 -31
- package/dist/saving-responses/index.js.map +1 -1
- package/dist/saving-responses/index.test.js +20 -20
- package/dist/saving-responses/index.test.js.map +1 -1
- package/dist/saving-responses/response-entity.js +12 -12
- package/dist/saving-responses/response-entity.js.map +1 -1
- package/dist/types/endpoints/v1/illust/bookmark/delete.d.ts +3 -3
- package/dist/types/endpoints/v1/illust/detail.d.ts +4 -4
- package/dist/types/endpoints/v1/illust/ranking.d.ts +11 -11
- package/dist/types/endpoints/v1/illust/ranking.js +3 -3
- package/dist/types/endpoints/v1/illust/recommended.d.ts +13 -13
- package/dist/types/endpoints/v1/illust/series.d.ts +8 -8
- package/dist/types/endpoints/v1/illust/ugoira/metadata.d.ts +4 -4
- package/dist/types/endpoints/v1/manga/recommended.d.ts +11 -11
- package/dist/types/endpoints/v1/novel/bookmark/delete.d.ts +3 -3
- package/dist/types/endpoints/v1/novel/ranking.d.ts +10 -10
- package/dist/types/endpoints/v1/novel/ranking.js +3 -3
- package/dist/types/endpoints/v1/novel/recommended.d.ts +11 -11
- package/dist/types/endpoints/v1/novel/related.d.ts +7 -7
- package/dist/types/endpoints/v1/search/illust.d.ts +15 -15
- package/dist/types/endpoints/v1/search/novel.d.ts +15 -15
- package/dist/types/endpoints/v1/user/bookmarks/illust.d.ts +9 -9
- package/dist/types/endpoints/v1/user/bookmarks/novel.d.ts +8 -8
- package/dist/types/endpoints/v1/user/detail.d.ts +8 -8
- package/dist/types/endpoints/v2/illust/bookmark/add.d.ts +7 -7
- package/dist/types/endpoints/v2/illust/related.d.ts +8 -8
- package/dist/types/endpoints/v2/novel/bookmark/add.d.ts +7 -7
- package/dist/types/endpoints/v2/novel/detail.d.ts +4 -4
- package/dist/types/endpoints/v2/novel/series.d.ts +9 -9
- package/dist/types/endpoints/webview/v2/novel.d.ts +4 -4
- package/dist/types/error-response.d.ts +7 -7
- package/dist/types/errors.d.ts +1 -1
- package/dist/types/errors.js +1 -1
- package/dist/types/pixiv-common.d.ts +25 -25
- package/dist/types/pixiv-common.d.ts.map +1 -1
- package/dist/types/pixiv-illust-series.d.ts +12 -12
- package/dist/types/pixiv-illust.d.ts +53 -52
- package/dist/types/pixiv-illust.d.ts.map +1 -1
- package/dist/types/pixiv-illust.js.map +1 -1
- package/dist/types/pixiv-novel-series.d.ts +18 -18
- package/dist/types/pixiv-novel.d.ts +34 -33
- package/dist/types/pixiv-novel.d.ts.map +1 -1
- package/dist/types/pixiv-novel.js.map +1 -1
- package/dist/types/pixiv-ugoira.d.ts +10 -10
- package/dist/types/pixiv-user.d.ts +89 -89
- package/dist/types/pixiv-user.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/pixiv.d.ts
CHANGED
|
@@ -50,227 +50,227 @@ export default class Pixiv {
|
|
|
50
50
|
readonly rateLimitRetryOptions: PixivRateLimitRetryOptions | null;
|
|
51
51
|
readonly http: PixivHttpClient;
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* Constructor. Cannot be instantiated externally; use the `of` method instead.
|
|
54
54
|
*
|
|
55
|
-
* @param userId
|
|
56
|
-
* @param accessToken
|
|
57
|
-
* @param refreshToken
|
|
58
|
-
* @param responseDatabase
|
|
59
|
-
* @param rateLimitRetryOptions 429
|
|
55
|
+
* @param userId User ID
|
|
56
|
+
* @param accessToken Access token
|
|
57
|
+
* @param refreshToken Refresh token
|
|
58
|
+
* @param responseDatabase Database for saving responses (null if not used)
|
|
59
|
+
* @param rateLimitRetryOptions Retry settings for 429 errors
|
|
60
60
|
*/
|
|
61
61
|
private constructor();
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
63
|
+
* Creates an instance from a refresh token.
|
|
64
64
|
*
|
|
65
|
-
* @param refreshToken
|
|
66
|
-
* @returns Pixiv
|
|
65
|
+
* @param refreshToken Refresh token
|
|
66
|
+
* @returns Pixiv instance
|
|
67
67
|
*/
|
|
68
68
|
static of(refreshToken: string, pixivTsOptions?: PixivTsOptions): Promise<Pixiv>;
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
70
|
+
* Returns a `Response` for fetching an image.
|
|
71
71
|
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
72
|
+
* The return value is a `Response` object, not the stream itself;
|
|
73
|
+
* to read it as a stream, refer to `response.body`.
|
|
74
|
+
* Other `Response` APIs such as `arrayBuffer()` can also be used as needed.
|
|
75
75
|
*
|
|
76
|
-
* @param url
|
|
77
|
-
* @returns
|
|
76
|
+
* @param url Image URL
|
|
77
|
+
* @returns The `Response` from fetching the image
|
|
78
78
|
*/
|
|
79
79
|
static getImageStream(url: string): Promise<Response>;
|
|
80
80
|
/**
|
|
81
|
-
*
|
|
81
|
+
* Gets the details of an illust.
|
|
82
82
|
*
|
|
83
|
-
* @param options
|
|
84
|
-
* @returns
|
|
83
|
+
* @param options Options
|
|
84
|
+
* @returns Response
|
|
85
85
|
*/
|
|
86
86
|
illustDetail(options: IllustDetailOptions): Promise<PixivApiResponse<GetV1IllustDetailResponse>>;
|
|
87
87
|
/**
|
|
88
|
-
*
|
|
88
|
+
* Gets illusts related to an illust.
|
|
89
89
|
*
|
|
90
|
-
* @param options
|
|
91
|
-
* @returns
|
|
90
|
+
* @param options Options
|
|
91
|
+
* @returns Response
|
|
92
92
|
*/
|
|
93
93
|
illustRelated(options: IllustRelatedOptions): Promise<PixivApiResponse<GetV2IllustRelatedResponse>>;
|
|
94
94
|
/**
|
|
95
|
-
*
|
|
95
|
+
* Searches for illusts.
|
|
96
96
|
*
|
|
97
|
-
* @param options
|
|
98
|
-
* @returns
|
|
97
|
+
* @param options Options
|
|
98
|
+
* @returns Response
|
|
99
99
|
*/
|
|
100
100
|
searchIllust(options: SearchIllustOptions): Promise<PixivApiResponse<GetV1SearchIllustResponse>>;
|
|
101
101
|
/**
|
|
102
|
-
*
|
|
102
|
+
* Gets the illust ranking.
|
|
103
103
|
*
|
|
104
|
-
* @param options
|
|
105
|
-
* @returns
|
|
104
|
+
* @param options Options
|
|
105
|
+
* @returns Response
|
|
106
106
|
*/
|
|
107
107
|
illustRanking(options?: IllustRankingOptions): Promise<PixivApiResponse<GetV1IllustRankingResponse>>;
|
|
108
108
|
/**
|
|
109
|
-
*
|
|
109
|
+
* Gets recommended illusts.
|
|
110
110
|
*
|
|
111
|
-
* @param options
|
|
112
|
-
* @returns
|
|
111
|
+
* @param options Options
|
|
112
|
+
* @returns Response
|
|
113
113
|
*/
|
|
114
114
|
illustRecommended(options?: RecommendedIllustOptions): Promise<PixivApiResponse<GetV1IllustRecommendedResponse>>;
|
|
115
115
|
/**
|
|
116
|
-
*
|
|
116
|
+
* Gets the details of an illust series.
|
|
117
117
|
*
|
|
118
|
-
* @param options
|
|
119
|
-
* @returns
|
|
118
|
+
* @param options Options
|
|
119
|
+
* @returns Response
|
|
120
120
|
*/
|
|
121
121
|
illustSeries(options: IllustSeriesOptions): Promise<PixivApiResponse<GetV1IllustSeriesResponse>>;
|
|
122
122
|
/**
|
|
123
|
-
*
|
|
123
|
+
* Bookmarks an illust.
|
|
124
124
|
*
|
|
125
|
-
* @param options
|
|
126
|
-
* @returns
|
|
125
|
+
* @param options Options
|
|
126
|
+
* @returns Response
|
|
127
127
|
*/
|
|
128
128
|
illustBookmarkAdd(options: IllustBookmarkAddOptions): Promise<PixivApiResponse<PostV2IllustBookmarkAddResponse>>;
|
|
129
129
|
/**
|
|
130
|
-
*
|
|
130
|
+
* Removes an illust bookmark.
|
|
131
131
|
*
|
|
132
|
-
* @param options
|
|
133
|
-
* @returns
|
|
132
|
+
* @param options Options
|
|
133
|
+
* @returns Response
|
|
134
134
|
*/
|
|
135
135
|
illustBookmarkDelete(options: IllustBookmarkDeleteOptions): Promise<PixivApiResponse<PostV1IllustBookmarkDeleteResponse>>;
|
|
136
136
|
mangaRecommended(options?: MangaRecommendedOptions): Promise<PixivApiResponse<GetV1MangaRecommendedResponse>>;
|
|
137
137
|
/**
|
|
138
|
-
*
|
|
138
|
+
* Gets the details of an ugoira.
|
|
139
139
|
*
|
|
140
|
-
* @param options
|
|
141
|
-
* @returns
|
|
140
|
+
* @param options Options
|
|
141
|
+
* @returns Response
|
|
142
142
|
*/
|
|
143
143
|
ugoiraMetadata(options: UgoiraDetailOptions): Promise<PixivApiResponse<GetV1IllustUgoiraMetadataResponse>>;
|
|
144
144
|
/**
|
|
145
|
-
*
|
|
145
|
+
* Gets the details of a novel.
|
|
146
146
|
*
|
|
147
|
-
* @param options
|
|
148
|
-
* @returns
|
|
147
|
+
* @param options Options
|
|
148
|
+
* @returns Response
|
|
149
149
|
*/
|
|
150
150
|
novelDetail(options: NovelDetailOptions): Promise<PixivApiResponse<GetV2NovelDetailResponse>>;
|
|
151
151
|
/**
|
|
152
|
-
*
|
|
152
|
+
* Gets the text of a novel.
|
|
153
153
|
*
|
|
154
|
-
* @param options
|
|
155
|
-
* @returns
|
|
154
|
+
* @param options Options
|
|
155
|
+
* @returns Response
|
|
156
156
|
*/
|
|
157
157
|
novelText(options: NovelTextOptions): Promise<PixivApiResponse<string>>;
|
|
158
158
|
/**
|
|
159
|
-
*
|
|
159
|
+
* Gets novels related to a novel.
|
|
160
160
|
*
|
|
161
|
-
* @param options
|
|
162
|
-
* @returns
|
|
161
|
+
* @param options Options
|
|
162
|
+
* @returns Response
|
|
163
163
|
*/
|
|
164
164
|
novelRelated(options: NovelRelatedOptions): Promise<PixivApiResponse<GetV1NovelRelatedResponse>>;
|
|
165
165
|
/**
|
|
166
|
-
*
|
|
166
|
+
* Searches for novels.
|
|
167
167
|
*
|
|
168
|
-
* @param options
|
|
169
|
-
* @returns
|
|
168
|
+
* @param options Options
|
|
169
|
+
* @returns Response
|
|
170
170
|
*/
|
|
171
171
|
searchNovel(options: SearchNovelOptions): Promise<PixivApiResponse<GetV1SearchNovelResponse>>;
|
|
172
172
|
/**
|
|
173
|
-
*
|
|
173
|
+
* Gets the novel ranking.
|
|
174
174
|
*/
|
|
175
175
|
novelRanking(options?: NovelRankingOptions): Promise<PixivApiResponse<GetV1NovelRankingResponse>>;
|
|
176
176
|
/**
|
|
177
|
-
*
|
|
177
|
+
* Gets recommended novels.
|
|
178
178
|
*
|
|
179
|
-
* @param options
|
|
180
|
-
* @returns
|
|
179
|
+
* @param options Options
|
|
180
|
+
* @returns Response
|
|
181
181
|
*/
|
|
182
182
|
novelRecommended(options?: RecommendedNovelOptions): Promise<PixivApiResponse<GetV1NovelRecommendedResponse>>;
|
|
183
183
|
/**
|
|
184
|
-
*
|
|
184
|
+
* Gets the details of a novel series.
|
|
185
185
|
*
|
|
186
|
-
* @param options
|
|
187
|
-
* @returns
|
|
186
|
+
* @param options Options
|
|
187
|
+
* @returns Response
|
|
188
188
|
*/
|
|
189
189
|
novelSeries(options: NovelSeriesOptions): Promise<PixivApiResponse<GetV2NovelSeriesResponse>>;
|
|
190
190
|
/**
|
|
191
|
-
*
|
|
191
|
+
* Bookmarks a novel.
|
|
192
192
|
*
|
|
193
|
-
* @param options
|
|
194
|
-
* @returns
|
|
193
|
+
* @param options Options
|
|
194
|
+
* @returns Response
|
|
195
195
|
*/
|
|
196
196
|
novelBookmarkAdd(options: NovelBookmarkAddOptions): Promise<PixivApiResponse<PostV2NovelBookmarkAddResponse>>;
|
|
197
197
|
/**
|
|
198
|
-
*
|
|
198
|
+
* Removes a novel bookmark.
|
|
199
199
|
*
|
|
200
|
-
* @param options
|
|
201
|
-
* @returns
|
|
200
|
+
* @param options Options
|
|
201
|
+
* @returns Response
|
|
202
202
|
*/
|
|
203
203
|
novelBookmarkDelete(options: NovelBookmarkDeleteOptions): Promise<PixivApiResponse<PostV1NovelBookmarkDeleteResponse>>;
|
|
204
204
|
/**
|
|
205
|
-
*
|
|
205
|
+
* Gets the details of a user.
|
|
206
206
|
*
|
|
207
|
-
* @param options
|
|
208
|
-
* @returns
|
|
207
|
+
* @param options Options
|
|
208
|
+
* @returns Response
|
|
209
209
|
*/
|
|
210
210
|
userDetail(options: UserDetailOptions): Promise<PixivApiResponse<GetV1UserDetailResponse>>;
|
|
211
211
|
/**
|
|
212
|
-
*
|
|
212
|
+
* Gets a user's illust bookmarks.
|
|
213
213
|
*
|
|
214
|
-
* @param options
|
|
215
|
-
* @returns
|
|
214
|
+
* @param options Options
|
|
215
|
+
* @returns Response
|
|
216
216
|
*/
|
|
217
217
|
userBookmarksIllust(options: UserBookmarksIllustOptions): Promise<PixivApiResponse<GetV1UserBookmarksIllustResponse>>;
|
|
218
218
|
/**
|
|
219
|
-
*
|
|
219
|
+
* Gets a user's novel bookmarks.
|
|
220
220
|
*
|
|
221
|
-
* @param options
|
|
222
|
-
* @returns
|
|
221
|
+
* @param options Options
|
|
222
|
+
* @returns Response
|
|
223
223
|
*/
|
|
224
224
|
userBookmarksNovel(options: UserBookmarksNovelOptions): Promise<PixivApiResponse<GetV1UserBookmarksNovelResponse>>;
|
|
225
225
|
/**
|
|
226
|
-
*
|
|
226
|
+
* Closes the connection.
|
|
227
227
|
*/
|
|
228
228
|
close(): Promise<void>;
|
|
229
229
|
/**
|
|
230
|
-
*
|
|
230
|
+
* Parses a query string.
|
|
231
231
|
*
|
|
232
232
|
* @param url URL
|
|
233
|
-
* @returns
|
|
233
|
+
* @returns The parsed query string object
|
|
234
234
|
*/
|
|
235
235
|
static parseQueryString(url: string): qs.ParsedQs;
|
|
236
236
|
/**
|
|
237
|
-
*
|
|
237
|
+
* Determines whether the response is an error.
|
|
238
238
|
*
|
|
239
|
-
* @param response Axios
|
|
240
|
-
* @returns
|
|
239
|
+
* @param response Axios response
|
|
240
|
+
* @returns Whether it is an error
|
|
241
241
|
*/
|
|
242
242
|
static isError(response: any): response is PixivApiError;
|
|
243
243
|
/**
|
|
244
|
-
* MD5
|
|
244
|
+
* Generates an MD5 hash.
|
|
245
245
|
*
|
|
246
|
-
* @param str
|
|
247
|
-
* @returns
|
|
246
|
+
* @param str String
|
|
247
|
+
* @returns Hash
|
|
248
248
|
*/
|
|
249
249
|
private static hash;
|
|
250
250
|
/**
|
|
251
|
-
*
|
|
251
|
+
* Sends a request.
|
|
252
252
|
*
|
|
253
|
-
*
|
|
253
|
+
* The order of generics is T: request, U: response.
|
|
254
254
|
*
|
|
255
|
-
* @param options
|
|
256
|
-
* @returns
|
|
255
|
+
* @param options Options
|
|
256
|
+
* @returns Response
|
|
257
257
|
*/
|
|
258
258
|
private request;
|
|
259
259
|
private saveResponse;
|
|
260
260
|
private isJSON;
|
|
261
261
|
/**
|
|
262
|
-
*
|
|
262
|
+
* Checks whether the required options are included.
|
|
263
263
|
*
|
|
264
|
-
* @param options
|
|
265
|
-
* @param required
|
|
266
|
-
* @throws
|
|
264
|
+
* @param options Options
|
|
265
|
+
* @param required Required option keys
|
|
266
|
+
* @throws If a required option is missing
|
|
267
267
|
*/
|
|
268
268
|
private checkRequiredOptions;
|
|
269
269
|
/**
|
|
270
|
-
*
|
|
270
|
+
* Converts camelCase object keys to snake_case object keys.
|
|
271
271
|
*
|
|
272
|
-
* @param object
|
|
273
|
-
* @returns
|
|
272
|
+
* @param object Object
|
|
273
|
+
* @returns The converted object
|
|
274
274
|
*/
|
|
275
275
|
private convertCamelToSnake;
|
|
276
276
|
}
|