narou 0.7.7 → 0.8.1
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.browser.d.ts +35 -29
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +82 -122
- package/dist/index.browser.js.map +1 -1
- package/dist/index.common.d.ts +14 -9
- package/dist/index.common.d.ts.map +1 -1
- package/dist/index.common.js +34 -24
- package/dist/index.common.js.map +1 -1
- package/dist/index.d.ts +42 -30
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +90 -124
- package/dist/index.js.map +1 -1
- package/dist/narou-fetch.d.ts +12 -12
- package/dist/narou-fetch.js +45 -128
- package/dist/narou-fetch.js.map +1 -1
- package/dist/narou-jsonp.d.ts +9 -9
- package/dist/narou-jsonp.js +23 -100
- package/dist/narou-jsonp.js.map +1 -1
- package/dist/narou-ranking-results.d.ts +9 -9
- package/dist/narou-ranking-results.js +2 -2
- package/dist/narou-search-results.d.ts +130 -120
- package/dist/narou-search-results.d.ts.map +1 -1
- package/dist/narou-search-results.js +62 -65
- package/dist/narou-search-results.js.map +1 -1
- package/dist/narou.d.ts +25 -24
- package/dist/narou.d.ts.map +1 -1
- package/dist/narou.js +29 -104
- package/dist/narou.js.map +1 -1
- package/dist/params.d.ts +323 -282
- package/dist/params.d.ts.map +1 -1
- package/dist/params.js +246 -229
- package/dist/params.js.map +1 -1
- package/dist/ranking-history.d.ts +13 -13
- package/dist/ranking-history.js +13 -13
- package/dist/ranking-history.js.map +1 -1
- package/dist/ranking.d.ts +45 -45
- package/dist/ranking.js +86 -155
- package/dist/ranking.js.map +1 -1
- package/dist/search-builder-r18.d.ts +28 -28
- package/dist/search-builder-r18.d.ts.map +1 -1
- package/dist/search-builder-r18.js +44 -64
- package/dist/search-builder-r18.js.map +1 -1
- package/dist/search-builder.d.ts +219 -234
- package/dist/search-builder.d.ts.map +1 -1
- package/dist/search-builder.js +380 -440
- package/dist/search-builder.js.map +1 -1
- package/dist/user-search.d.ts +63 -0
- package/dist/user-search.d.ts.map +1 -0
- package/dist/user-search.js +94 -0
- package/dist/user-search.js.map +1 -0
- package/dist/util/jsonp.d.ts +16 -16
- package/dist/util/jsonp.js +45 -47
- package/dist/util/jsonp.js.map +1 -1
- package/dist/util/type.d.ts +3 -3
- package/dist/util/type.js +2 -2
- package/dist/util/unzipp.d.ts +3 -3
- package/dist/util/unzipp.js +11 -56
- package/dist/util/unzipp.js.map +1 -1
- package/dist.esm/index.browser.js +86 -0
- package/dist.esm/index.browser.js.map +1 -0
- package/dist.esm/index.common.js +38 -0
- package/dist.esm/index.common.js.map +1 -0
- package/dist.esm/index.js +94 -0
- package/dist.esm/index.js.map +1 -0
- package/dist.esm/narou-fetch.js +49 -0
- package/dist.esm/narou-fetch.js.map +1 -0
- package/dist.esm/narou-jsonp.js +27 -0
- package/dist.esm/narou-jsonp.js.map +1 -0
- package/dist.esm/narou-ranking-results.js +3 -0
- package/dist.esm/narou-ranking-results.js.map +1 -0
- package/dist.esm/narou-search-results.js +63 -0
- package/dist.esm/narou-search-results.js.map +1 -0
- package/dist.esm/narou.js +33 -0
- package/dist.esm/narou.js.map +1 -0
- package/dist.esm/params.js +247 -0
- package/dist.esm/params.js.map +1 -0
- package/dist.esm/ranking-history.js +14 -0
- package/dist.esm/ranking-history.js.map +1 -0
- package/dist.esm/ranking.js +90 -0
- package/dist.esm/ranking.js.map +1 -0
- package/dist.esm/search-builder-r18.js +45 -0
- package/dist.esm/search-builder-r18.js.map +1 -0
- package/dist.esm/search-builder.js +381 -0
- package/dist.esm/search-builder.js.map +1 -0
- package/dist.esm/user-search.js +94 -0
- package/dist.esm/user-search.js.map +1 -0
- package/dist.esm/util/jsonp.js +46 -0
- package/dist.esm/util/jsonp.js.map +1 -0
- package/dist.esm/util/type.js +3 -0
- package/dist.esm/util/type.js.map +1 -0
- package/dist.esm/util/unzipp.js +12 -0
- package/dist.esm/util/unzipp.js.map +1 -0
- package/package.json +18 -8
- package/src/index.browser.ts +12 -1
- package/src/index.common.ts +18 -29
- package/src/index.ts +20 -3
- package/src/narou-search-results.ts +20 -7
- package/src/narou.ts +26 -11
- package/src/params.ts +60 -15
- package/src/search-builder-r18.ts +9 -9
- package/src/search-builder.ts +96 -102
- package/src/user-search.ts +109 -0
package/src/search-builder.ts
CHANGED
|
@@ -2,7 +2,7 @@ import NarouNovel from "./narou";
|
|
|
2
2
|
import {
|
|
3
3
|
NarouSearchResult,
|
|
4
4
|
SearchResultFields,
|
|
5
|
-
|
|
5
|
+
SearchResultOptionalFields,
|
|
6
6
|
} from "./narou-search-results";
|
|
7
7
|
import NarouSearchResults from "./narou-search-results";
|
|
8
8
|
import {
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
NovelTypeParam,
|
|
19
19
|
GzipLevel,
|
|
20
20
|
OptionalFields,
|
|
21
|
+
ParamsBaseWithOrder,
|
|
21
22
|
} from "./params";
|
|
22
23
|
import { Join } from "./util/type";
|
|
23
24
|
|
|
@@ -26,12 +27,18 @@ export type DefaultSearchResultFields = keyof Omit<
|
|
|
26
27
|
"weekly_unique" | "noveltype" | "nocgenre" | "xid"
|
|
27
28
|
>;
|
|
28
29
|
|
|
29
|
-
export abstract class SearchBuilderBase<
|
|
30
|
+
export abstract class SearchBuilderBase<
|
|
31
|
+
TParams extends ParamsBaseWithOrder<TOrder>,
|
|
32
|
+
TOrder extends string
|
|
33
|
+
> {
|
|
30
34
|
/**
|
|
31
35
|
* constructor
|
|
32
36
|
* @private
|
|
33
37
|
*/
|
|
34
|
-
constructor(
|
|
38
|
+
constructor(
|
|
39
|
+
protected params: TParams = {} as TParams,
|
|
40
|
+
protected api: NarouNovel
|
|
41
|
+
) {}
|
|
35
42
|
|
|
36
43
|
protected static distinct<T>(array: readonly T[]): T[] {
|
|
37
44
|
return Array.from(new Set(array));
|
|
@@ -47,6 +54,77 @@ export abstract class SearchBuilderBase<T extends SearchResultFieldNames> {
|
|
|
47
54
|
}
|
|
48
55
|
}
|
|
49
56
|
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
* @return {SearchBuilder} this
|
|
60
|
+
*/
|
|
61
|
+
limit(num: number): this {
|
|
62
|
+
this.set({ lim: num } as TParams);
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
*
|
|
68
|
+
* @return {SearchBuilder} this
|
|
69
|
+
*/
|
|
70
|
+
start(num: number): this {
|
|
71
|
+
this.set({ st: num } as TParams);
|
|
72
|
+
return this;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
*
|
|
77
|
+
* @return {SearchBuilder} this
|
|
78
|
+
*/
|
|
79
|
+
page(no: number, count = 20): this {
|
|
80
|
+
return this.limit(count).start(no * count);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* 出力順序を指定する。指定しない場合は新着順となります。
|
|
85
|
+
* old 古い順
|
|
86
|
+
* @param {TOrder} order 出力順序
|
|
87
|
+
* @return {SearchBuilder} this
|
|
88
|
+
*/
|
|
89
|
+
order(order: TOrder): this {
|
|
90
|
+
this.set({ order: order } as TParams);
|
|
91
|
+
return this;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* gzip圧縮する。
|
|
96
|
+
*
|
|
97
|
+
* 転送量上限を減らすためにも推奨
|
|
98
|
+
* @param {GzipLevel} level gzip圧縮レベル(1~5)
|
|
99
|
+
* @return {SearchBuilder} this
|
|
100
|
+
*/
|
|
101
|
+
gzip(level: GzipLevel): this {
|
|
102
|
+
this.set({ gzip: level } as TParams);
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* クエリパラメータをセットする
|
|
108
|
+
* @private
|
|
109
|
+
* @return {SearchBuilder} this
|
|
110
|
+
*/
|
|
111
|
+
protected set(obj: TParams): this {
|
|
112
|
+
this.params = { ...this.params, ...obj };
|
|
113
|
+
return this;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* クエリパラメータを削除する
|
|
118
|
+
*/
|
|
119
|
+
protected unset(key: keyof TParams): this {
|
|
120
|
+
delete this.params[key];
|
|
121
|
+
return this;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export abstract class NovelSearchBuilderBase<
|
|
126
|
+
T extends SearchResultFieldNames
|
|
127
|
+
> extends SearchBuilderBase<SearchParams, Order> {
|
|
50
128
|
/**
|
|
51
129
|
* a
|
|
52
130
|
* @return {SearchBuilder} this
|
|
@@ -180,7 +258,7 @@ export abstract class SearchBuilderBase<T extends SearchResultFieldNames> {
|
|
|
180
258
|
* @return {SearchBuilder} this
|
|
181
259
|
*/
|
|
182
260
|
length(length: number | readonly number[]): this {
|
|
183
|
-
this.set({ length:
|
|
261
|
+
this.set({ length: NovelSearchBuilderBase.array2string(length) });
|
|
184
262
|
return this;
|
|
185
263
|
}
|
|
186
264
|
|
|
@@ -207,7 +285,7 @@ export abstract class SearchBuilderBase<T extends SearchResultFieldNames> {
|
|
|
207
285
|
* @return {SearchBuilder} this
|
|
208
286
|
*/
|
|
209
287
|
sasie(num: number | readonly number[]): this {
|
|
210
|
-
this.set({ sasie:
|
|
288
|
+
this.set({ sasie: NovelSearchBuilderBase.array2string(num) });
|
|
211
289
|
return this;
|
|
212
290
|
}
|
|
213
291
|
|
|
@@ -216,7 +294,7 @@ export abstract class SearchBuilderBase<T extends SearchResultFieldNames> {
|
|
|
216
294
|
* @return {SearchBuilder} this
|
|
217
295
|
*/
|
|
218
296
|
time(num: number | readonly number[]): this {
|
|
219
|
-
this.set({ time:
|
|
297
|
+
this.set({ time: NovelSearchBuilderBase.array2string(num) });
|
|
220
298
|
return this;
|
|
221
299
|
}
|
|
222
300
|
|
|
@@ -225,7 +303,7 @@ export abstract class SearchBuilderBase<T extends SearchResultFieldNames> {
|
|
|
225
303
|
* @return {SearchBuilder} this
|
|
226
304
|
*/
|
|
227
305
|
ncode(ncodes: string | readonly string[]): this {
|
|
228
|
-
this.set({ ncode:
|
|
306
|
+
this.set({ ncode: NovelSearchBuilderBase.array2string(ncodes) });
|
|
229
307
|
return this;
|
|
230
308
|
}
|
|
231
309
|
|
|
@@ -243,7 +321,7 @@ export abstract class SearchBuilderBase<T extends SearchResultFieldNames> {
|
|
|
243
321
|
* @return {SearchBuilder} this
|
|
244
322
|
*/
|
|
245
323
|
buntai(buntai: BuntaiParam | readonly BuntaiParam[]): this {
|
|
246
|
-
this.set({ buntai:
|
|
324
|
+
this.set({ buntai: NovelSearchBuilderBase.array2string(buntai) });
|
|
247
325
|
return this;
|
|
248
326
|
}
|
|
249
327
|
|
|
@@ -289,95 +367,11 @@ export abstract class SearchBuilderBase<T extends SearchResultFieldNames> {
|
|
|
289
367
|
return this;
|
|
290
368
|
}
|
|
291
369
|
|
|
292
|
-
/**
|
|
293
|
-
*
|
|
294
|
-
* @return {SearchBuilder} this
|
|
295
|
-
*/
|
|
296
|
-
limit(num: number): this {
|
|
297
|
-
this.set({ lim: num });
|
|
298
|
-
return this;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
*
|
|
303
|
-
* @return {SearchBuilder} this
|
|
304
|
-
*/
|
|
305
|
-
start(num: number): this {
|
|
306
|
-
this.set({ st: num });
|
|
307
|
-
return this;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
*
|
|
312
|
-
* @return {SearchBuilder} this
|
|
313
|
-
*/
|
|
314
|
-
page(no: number, count = 20): this {
|
|
315
|
-
return this.limit(count).start(no * count);
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
/**
|
|
319
|
-
* 出力順序を指定する。指定しない場合は新着順となります。
|
|
320
|
-
*
|
|
321
|
-
* @description
|
|
322
|
-
* allunique 閲覧者の多い順(未実装)
|
|
323
|
-
* favnovelcnt ブックマーク数の多い順
|
|
324
|
-
* reviewcnt レビュー数の多い順
|
|
325
|
-
* hyoka 総合評価の高い順
|
|
326
|
-
* hyokaasc 総合評価の低い順
|
|
327
|
-
* impressioncnt 感想の多い順
|
|
328
|
-
* hyokacnt 評価者数の多い順
|
|
329
|
-
* hyokacntasc 評価者数の少ない順
|
|
330
|
-
* weekly 週間ユニークユーザの多い順 毎週火曜日早朝リセット
|
|
331
|
-
* (前週の日曜日から土曜日分)
|
|
332
|
-
* lengthdesc 小説本文の文字数が多い順
|
|
333
|
-
* lengthasc 小説本文の文字数が少ない順
|
|
334
|
-
* ncodedesc Nコードが新しい順
|
|
335
|
-
* old 古い順
|
|
336
|
-
* @param {Order} order 出力順序
|
|
337
|
-
* @return {SearchBuilder} this
|
|
338
|
-
*/
|
|
339
|
-
order(order: Order): this {
|
|
340
|
-
this.set({ order: order });
|
|
341
|
-
return this;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* gzip圧縮する。
|
|
346
|
-
*
|
|
347
|
-
* 転送量上限を減らすためにも推奨
|
|
348
|
-
* @param {GzipLevel} level gzip圧縮レベル(1~5)
|
|
349
|
-
* @return {SearchBuilder} this
|
|
350
|
-
*/
|
|
351
|
-
gzip(level: GzipLevel): this {
|
|
352
|
-
this.set({ gzip: level });
|
|
353
|
-
return this;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* クエリパラメータをセットする
|
|
358
|
-
* @private
|
|
359
|
-
* @return {SearchBuilder} this
|
|
360
|
-
*/
|
|
361
|
-
protected set(obj: SearchParams): this {
|
|
362
|
-
this.params = { ...this.params, ...obj };
|
|
363
|
-
return this;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
/**
|
|
367
|
-
* クエリパラメータを削除する
|
|
368
|
-
* @private
|
|
369
|
-
* @return {SearchBuilder} this
|
|
370
|
-
*/
|
|
371
|
-
protected unset(key: keyof SearchParams): this {
|
|
372
|
-
delete this.params[key];
|
|
373
|
-
return this;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
370
|
/**
|
|
377
371
|
* なろう小説APIへの検索リクエストを実行する
|
|
378
372
|
* @returns {Promise<NarouSearchResults>} 検索結果
|
|
379
373
|
*/
|
|
380
|
-
execute(): Promise<NarouSearchResults<T>> {
|
|
374
|
+
execute(): Promise<NarouSearchResults<NarouSearchResult, T>> {
|
|
381
375
|
return this.api.executeNovel(this.params);
|
|
382
376
|
}
|
|
383
377
|
}
|
|
@@ -389,13 +383,13 @@ export abstract class SearchBuilderBase<T extends SearchResultFieldNames> {
|
|
|
389
383
|
export default class SearchBuilder<
|
|
390
384
|
T extends keyof NarouSearchResult = DefaultSearchResultFields,
|
|
391
385
|
TOpt extends keyof NarouSearchResult = never
|
|
392
|
-
> extends
|
|
386
|
+
> extends NovelSearchBuilderBase<T | TOpt> {
|
|
393
387
|
/**
|
|
394
388
|
*
|
|
395
389
|
* @return {SearchBuilder} this
|
|
396
390
|
*/
|
|
397
391
|
bigGenre(genre: BigGenre | readonly BigGenre[]): this {
|
|
398
|
-
this.set({ biggenre:
|
|
392
|
+
this.set({ biggenre: SearchBuilder.array2string(genre) });
|
|
399
393
|
return this;
|
|
400
394
|
}
|
|
401
395
|
|
|
@@ -404,7 +398,7 @@ export default class SearchBuilder<
|
|
|
404
398
|
* @return {SearchBuilder} this
|
|
405
399
|
*/
|
|
406
400
|
notBigGenre(genre: BigGenre | readonly BigGenre[]): this {
|
|
407
|
-
this.set({ notbiggenre:
|
|
401
|
+
this.set({ notbiggenre: SearchBuilder.array2string(genre) });
|
|
408
402
|
return this;
|
|
409
403
|
}
|
|
410
404
|
|
|
@@ -413,7 +407,7 @@ export default class SearchBuilder<
|
|
|
413
407
|
* @return {SearchBuilder} this
|
|
414
408
|
*/
|
|
415
409
|
genre(genre: Genre | readonly Genre[]): this {
|
|
416
|
-
this.set({ genre:
|
|
410
|
+
this.set({ genre: SearchBuilder.array2string(genre) });
|
|
417
411
|
return this;
|
|
418
412
|
}
|
|
419
413
|
|
|
@@ -422,7 +416,7 @@ export default class SearchBuilder<
|
|
|
422
416
|
* @return {SearchBuilder} this
|
|
423
417
|
*/
|
|
424
418
|
notGenre(genre: Genre | readonly Genre[]): this {
|
|
425
|
-
this.set({ notgenre:
|
|
419
|
+
this.set({ notgenre: SearchBuilder.array2string(genre) });
|
|
426
420
|
return this;
|
|
427
421
|
}
|
|
428
422
|
|
|
@@ -431,7 +425,7 @@ export default class SearchBuilder<
|
|
|
431
425
|
* @return {SearchBuilder} this
|
|
432
426
|
*/
|
|
433
427
|
userId(ids: number | readonly number[]): this {
|
|
434
|
-
this.set({ userid:
|
|
428
|
+
this.set({ userid: SearchBuilder.array2string(ids) });
|
|
435
429
|
return this;
|
|
436
430
|
}
|
|
437
431
|
|
|
@@ -455,15 +449,15 @@ export default class SearchBuilder<
|
|
|
455
449
|
fields<TFields extends Fields>(
|
|
456
450
|
fields: TFields | readonly TFields[]
|
|
457
451
|
): SearchBuilder<SearchResultFields<TFields>, TOpt> {
|
|
458
|
-
this.set({ of:
|
|
452
|
+
this.set({ of: SearchBuilder.array2string(fields) });
|
|
459
453
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
460
454
|
return this as any;
|
|
461
455
|
}
|
|
462
456
|
|
|
463
457
|
opt<TFields extends OptionalFields>(
|
|
464
458
|
option: TFields | readonly TFields[]
|
|
465
|
-
): SearchBuilder<T,
|
|
466
|
-
this.set({ opt:
|
|
459
|
+
): SearchBuilder<T, SearchResultOptionalFields<TFields>> {
|
|
460
|
+
this.set({ opt: SearchBuilder.array2string(option) });
|
|
467
461
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
468
462
|
return this as any;
|
|
469
463
|
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import NarouSearchResults, {
|
|
2
|
+
UserSearchResult,
|
|
3
|
+
UserSearchResultFields,
|
|
4
|
+
} from "./narou-search-results";
|
|
5
|
+
import { UserFields, UserOrder, UserSearchParams } from "./params";
|
|
6
|
+
import { SearchBuilderBase } from "./search-builder";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* なろうユーザ検索API
|
|
10
|
+
* @class UserSearch
|
|
11
|
+
*/
|
|
12
|
+
export default class UserSearchBuilder<
|
|
13
|
+
TField extends keyof UserSearchResult = keyof UserSearchResult
|
|
14
|
+
> extends SearchBuilderBase<UserSearchParams, UserOrder> {
|
|
15
|
+
/**
|
|
16
|
+
* 単語を指定できます。
|
|
17
|
+
* 半角または全角スペースで区切るとAND抽出になります。
|
|
18
|
+
* 部分一致でHITします。検索の対象はユーザ名とユーザ名のフリガナです。
|
|
19
|
+
*/
|
|
20
|
+
word(word: string) {
|
|
21
|
+
this.set({ word });
|
|
22
|
+
return this;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 含みたくない単語を指定できます。
|
|
27
|
+
* スペースで区切ることにより含ませない単語を増やせます。部分一致で除外されます。
|
|
28
|
+
* 除外の対象はユーザ名とユーザ名のフリガナです。
|
|
29
|
+
*/
|
|
30
|
+
notWord(notword: string) {
|
|
31
|
+
this.set({ notword });
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* ユーザIDで抽出可能。
|
|
37
|
+
*/
|
|
38
|
+
userId(userid: number) {
|
|
39
|
+
this.set({ userid });
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 抽出するユーザのユーザ名のフリガナの頭文字を指定できます。
|
|
45
|
+
* 頭文字はユーザ名のフリガナをひらがなに変換し、最初の1文字が「ぁ」~「ん」の場合に対象となります。
|
|
46
|
+
* 「ぱ」や「ば」等の半濁音や濁音は清音として扱われます。
|
|
47
|
+
* 漢字や英数字が頭文字のユーザは対象外です。
|
|
48
|
+
*/
|
|
49
|
+
name1st(name1st: string) {
|
|
50
|
+
this.set({ name1st });
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 抽出するユーザの小説投稿数の下限を指定できます。
|
|
56
|
+
* 小説投稿件数が指定された数値以上のユーザを抽出します。
|
|
57
|
+
*/
|
|
58
|
+
minNovel(minnovel: number) {
|
|
59
|
+
this.set({ minnovel });
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* 抽出するユーザの小説投稿数の上限を指定できます。
|
|
65
|
+
* 小説投稿件数が指定された数値以下のユーザを抽出します。
|
|
66
|
+
*/
|
|
67
|
+
maxNovel(maxnovel: number) {
|
|
68
|
+
this.set({ maxnovel });
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* 抽出するユーザのレビュー投稿数の下限を指定できます。
|
|
74
|
+
* レビュー投稿件数が指定された数値以上のユーザを抽出します。
|
|
75
|
+
*/
|
|
76
|
+
minReview(minreview: number) {
|
|
77
|
+
this.set({ minreview });
|
|
78
|
+
return this;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 抽出するユーザのレビュー投稿数の上限を指定できます。
|
|
83
|
+
* レビュー投稿件数が指定された数値以下のユーザを抽出します。
|
|
84
|
+
*/
|
|
85
|
+
maxReview(maxreview: number) {
|
|
86
|
+
this.set({ maxreview });
|
|
87
|
+
return this;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* 出力する項目を個別に指定できます。未指定時は全項目出力されます。転送量軽減のため、このパラメータの使用が推奨されます。
|
|
92
|
+
* @return {SearchBuilder} this
|
|
93
|
+
*/
|
|
94
|
+
fields<TFields extends UserFields>(
|
|
95
|
+
fields: TFields | readonly TFields[]
|
|
96
|
+
): UserSearchBuilder<UserSearchResultFields<TFields>> {
|
|
97
|
+
this.set({ of: UserSearchBuilder.array2string(fields) });
|
|
98
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
99
|
+
return this as any;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* なろう小説APIへのリクエストを実行する
|
|
104
|
+
* @returns ランキング
|
|
105
|
+
*/
|
|
106
|
+
execute(): Promise<NarouSearchResults<UserSearchResult, TField>> {
|
|
107
|
+
return this.api.executeUserSearch(this.params as UserSearchParams);
|
|
108
|
+
}
|
|
109
|
+
}
|