narou 0.8.0 → 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.
Files changed (70) hide show
  1. package/dist/index.browser.d.ts +35 -35
  2. package/dist/index.browser.js +82 -82
  3. package/dist/index.common.d.ts +14 -14
  4. package/dist/index.common.js +34 -34
  5. package/dist/index.d.ts +42 -42
  6. package/dist/index.js +90 -90
  7. package/dist/narou-fetch.d.ts +12 -12
  8. package/dist/narou-fetch.js +45 -45
  9. package/dist/narou-jsonp.d.ts +9 -9
  10. package/dist/narou-jsonp.js +23 -23
  11. package/dist/narou-ranking-results.d.ts +9 -9
  12. package/dist/narou-ranking-results.js +2 -2
  13. package/dist/narou-search-results.d.ts +130 -130
  14. package/dist/narou-search-results.js +62 -62
  15. package/dist/narou.d.ts +25 -25
  16. package/dist/narou.js +29 -29
  17. package/dist/params.d.ts +323 -323
  18. package/dist/params.js +246 -246
  19. package/dist/ranking-history.d.ts +13 -13
  20. package/dist/ranking-history.js +13 -13
  21. package/dist/ranking.d.ts +45 -45
  22. package/dist/ranking.js +86 -86
  23. package/dist/search-builder-r18.d.ts +28 -28
  24. package/dist/search-builder-r18.js +44 -44
  25. package/dist/search-builder.d.ts +219 -219
  26. package/dist/search-builder.js +380 -380
  27. package/dist/user-search.d.ts +62 -62
  28. package/dist/user-search.js +93 -93
  29. package/dist/util/jsonp.d.ts +16 -16
  30. package/dist/util/jsonp.js +45 -45
  31. package/dist/util/type.d.ts +3 -3
  32. package/dist/util/type.js +2 -2
  33. package/dist/util/unzipp.d.ts +3 -3
  34. package/dist/util/unzipp.js +11 -11
  35. package/dist.esm/index.browser.js +86 -0
  36. package/dist.esm/index.browser.js.map +1 -0
  37. package/dist.esm/index.common.js +38 -0
  38. package/dist.esm/index.common.js.map +1 -0
  39. package/dist.esm/index.js +94 -0
  40. package/dist.esm/index.js.map +1 -0
  41. package/dist.esm/narou-fetch.js +49 -0
  42. package/dist.esm/narou-fetch.js.map +1 -0
  43. package/dist.esm/narou-jsonp.js +27 -0
  44. package/dist.esm/narou-jsonp.js.map +1 -0
  45. package/dist.esm/narou-ranking-results.js +3 -0
  46. package/dist.esm/narou-ranking-results.js.map +1 -0
  47. package/dist.esm/narou-search-results.js +63 -0
  48. package/dist.esm/narou-search-results.js.map +1 -0
  49. package/dist.esm/narou.js +33 -0
  50. package/dist.esm/narou.js.map +1 -0
  51. package/dist.esm/params.js +247 -0
  52. package/dist.esm/params.js.map +1 -0
  53. package/dist.esm/ranking-history.js +14 -0
  54. package/dist.esm/ranking-history.js.map +1 -0
  55. package/dist.esm/ranking.js +90 -0
  56. package/dist.esm/ranking.js.map +1 -0
  57. package/dist.esm/search-builder-r18.js +45 -0
  58. package/dist.esm/search-builder-r18.js.map +1 -0
  59. package/dist.esm/search-builder.js +381 -0
  60. package/dist.esm/search-builder.js.map +1 -0
  61. package/dist.esm/user-search.js +94 -0
  62. package/dist.esm/user-search.js.map +1 -0
  63. package/dist.esm/util/jsonp.js +46 -0
  64. package/dist.esm/util/jsonp.js.map +1 -0
  65. package/dist.esm/util/type.js +3 -0
  66. package/dist.esm/util/type.js.map +1 -0
  67. package/dist.esm/util/unzipp.js +12 -0
  68. package/dist.esm/util/unzipp.js.map +1 -0
  69. package/package.json +1 -1
  70. package/src/user-search.ts +109 -109
@@ -1,220 +1,220 @@
1
- import NarouNovel from "./narou";
2
- import { NarouSearchResult, SearchResultFields, SearchResultOptionalFields } from "./narou-search-results";
3
- import NarouSearchResults from "./narou-search-results";
4
- import { BigGenre, SearchResultFieldNames, Genre, SearchParams, Fields, Order, BuntaiParam, NovelTypeParam, GzipLevel, OptionalFields, ParamsBaseWithOrder } from "./params";
5
- import { Join } from "./util/type";
6
- export declare type DefaultSearchResultFields = keyof Omit<NarouSearchResult, "weekly_unique" | "noveltype" | "nocgenre" | "xid">;
7
- export declare abstract class SearchBuilderBase<TParams extends ParamsBaseWithOrder<TOrder>, TOrder extends string> {
8
- protected params: TParams;
9
- protected api: NarouNovel;
10
- /**
11
- * constructor
12
- * @private
13
- */
14
- constructor(params: TParams, api: NarouNovel);
15
- protected static distinct<T>(array: readonly T[]): T[];
16
- protected static array2string<T extends string | number>(n: T | readonly T[]): Join<T>;
17
- /**
18
- *
19
- * @return {SearchBuilder} this
20
- */
21
- limit(num: number): this;
22
- /**
23
- *
24
- * @return {SearchBuilder} this
25
- */
26
- start(num: number): this;
27
- /**
28
- *
29
- * @return {SearchBuilder} this
30
- */
31
- page(no: number, count?: number): this;
32
- /**
33
- * 出力順序を指定する。指定しない場合は新着順となります。
34
- * old 古い順
35
- * @param {TOrder} order 出力順序
36
- * @return {SearchBuilder} this
37
- */
38
- order(order: TOrder): this;
39
- /**
40
- * gzip圧縮する。
41
- *
42
- * 転送量上限を減らすためにも推奨
43
- * @param {GzipLevel} level gzip圧縮レベル(1~5)
44
- * @return {SearchBuilder} this
45
- */
46
- gzip(level: GzipLevel): this;
47
- /**
48
- * クエリパラメータをセットする
49
- * @private
50
- * @return {SearchBuilder} this
51
- */
52
- protected set(obj: TParams): this;
53
- /**
54
- * クエリパラメータを削除する
55
- */
56
- protected unset(key: keyof TParams): this;
57
- }
58
- export declare abstract class NovelSearchBuilderBase<T extends SearchResultFieldNames> extends SearchBuilderBase<SearchParams, Order> {
59
- /**
60
- * a
61
- * @return {SearchBuilder} this
62
- */
63
- word(word: string): this;
64
- /**
65
- *
66
- * @return {SearchBuilder} this
67
- */
68
- notWord(word: string): this;
69
- /**
70
- *
71
- * @return {SearchBuilder} this
72
- */
73
- byTitle(bool?: boolean): this;
74
- /**
75
- *
76
- * @return {SearchBuilder} this
77
- */
78
- byOutline(bool?: boolean): this;
79
- /**
80
- *
81
- * @return {SearchBuilder} this
82
- */
83
- byKeyword(bool?: boolean): this;
84
- /**
85
- *
86
- * @return {SearchBuilder} this
87
- */
88
- byAuthor(bool?: boolean): this;
89
- /**
90
- *
91
- * @return {SearchBuilder} this
92
- */
93
- isBL(bool?: boolean): this;
94
- /**
95
- *
96
- * @return {SearchBuilder} this
97
- */
98
- isGL(bool?: boolean): this;
99
- /**
100
- *
101
- * @return {SearchBuilder} this
102
- */
103
- isZankoku(bool?: boolean): this;
104
- /**
105
- *
106
- * @return {SearchBuilder} this
107
- */
108
- isTensei(bool?: boolean): this;
109
- /**
110
- *
111
- * @return {SearchBuilder} this
112
- */
113
- isTenni(bool?: boolean): this;
114
- /**
115
- *
116
- * @return {SearchBuilder} this
117
- */
118
- isTT(): this;
119
- /**
120
- *
121
- * @return {SearchBuilder} this
122
- */
123
- length(length: number | readonly number[]): this;
124
- /**
125
- *
126
- * @return {SearchBuilder} this
127
- */
128
- kaiwaritu(num: number): this;
129
- kaiwaritu(min: number, max: number): this;
130
- /**
131
- *
132
- * @return {SearchBuilder} this
133
- */
134
- sasie(num: number | readonly number[]): this;
135
- /**
136
- *
137
- * @return {SearchBuilder} this
138
- */
139
- time(num: number | readonly number[]): this;
140
- /**
141
- *
142
- * @return {SearchBuilder} this
143
- */
144
- ncode(ncodes: string | readonly string[]): this;
145
- /**
146
- *
147
- * @return {SearchBuilder} this
148
- */
149
- type(type: NovelTypeParam): this;
150
- /**
151
- *
152
- * @return {SearchBuilder} this
153
- */
154
- buntai(buntai: BuntaiParam | readonly BuntaiParam[]): this;
155
- /**
156
- *
157
- * @return {SearchBuilder} this
158
- */
159
- isStop(bool?: boolean): this;
160
- /**
161
- *
162
- * @return {SearchBuilder} this
163
- */
164
- isPickup(bool?: boolean): this;
165
- /**
166
- *
167
- * @return {SearchBuilder} this
168
- */
169
- lastUpdate(date: string): this;
170
- lastUpdate(from: number, to: number): this;
171
- lastUpdate(from: Date, to: Date): this;
172
- /**
173
- * なろう小説APIへの検索リクエストを実行する
174
- * @returns {Promise<NarouSearchResults>} 検索結果
175
- */
176
- execute(): Promise<NarouSearchResults<NarouSearchResult, T>>;
177
- }
178
- /**
179
- * 検索ヘルパー
180
- * @class SearchBuilder
181
- */
182
- export default class SearchBuilder<T extends keyof NarouSearchResult = DefaultSearchResultFields, TOpt extends keyof NarouSearchResult = never> extends NovelSearchBuilderBase<T | TOpt> {
183
- /**
184
- *
185
- * @return {SearchBuilder} this
186
- */
187
- bigGenre(genre: BigGenre | readonly BigGenre[]): this;
188
- /**
189
- *
190
- * @return {SearchBuilder} this
191
- */
192
- notBigGenre(genre: BigGenre | readonly BigGenre[]): this;
193
- /**
194
- *
195
- * @return {SearchBuilder} this
196
- */
197
- genre(genre: Genre | readonly Genre[]): this;
198
- /**
199
- *
200
- * @return {SearchBuilder} this
201
- */
202
- notGenre(genre: Genre | readonly Genre[]): this;
203
- /**
204
- *
205
- * @return {SearchBuilder} this
206
- */
207
- userId(ids: number | readonly number[]): this;
208
- /**
209
- *
210
- * @return {SearchBuilder} this
211
- */
212
- isR15(bool?: boolean): this;
213
- /**
214
- *
215
- * @return {SearchBuilder} this
216
- */
217
- fields<TFields extends Fields>(fields: TFields | readonly TFields[]): SearchBuilder<SearchResultFields<TFields>, TOpt>;
218
- opt<TFields extends OptionalFields>(option: TFields | readonly TFields[]): SearchBuilder<T, SearchResultOptionalFields<TFields>>;
219
- }
1
+ import NarouNovel from "./narou";
2
+ import { NarouSearchResult, SearchResultFields, SearchResultOptionalFields } from "./narou-search-results";
3
+ import NarouSearchResults from "./narou-search-results";
4
+ import { BigGenre, SearchResultFieldNames, Genre, SearchParams, Fields, Order, BuntaiParam, NovelTypeParam, GzipLevel, OptionalFields, ParamsBaseWithOrder } from "./params";
5
+ import { Join } from "./util/type";
6
+ export declare type DefaultSearchResultFields = keyof Omit<NarouSearchResult, "weekly_unique" | "noveltype" | "nocgenre" | "xid">;
7
+ export declare abstract class SearchBuilderBase<TParams extends ParamsBaseWithOrder<TOrder>, TOrder extends string> {
8
+ protected params: TParams;
9
+ protected api: NarouNovel;
10
+ /**
11
+ * constructor
12
+ * @private
13
+ */
14
+ constructor(params: TParams, api: NarouNovel);
15
+ protected static distinct<T>(array: readonly T[]): T[];
16
+ protected static array2string<T extends string | number>(n: T | readonly T[]): Join<T>;
17
+ /**
18
+ *
19
+ * @return {SearchBuilder} this
20
+ */
21
+ limit(num: number): this;
22
+ /**
23
+ *
24
+ * @return {SearchBuilder} this
25
+ */
26
+ start(num: number): this;
27
+ /**
28
+ *
29
+ * @return {SearchBuilder} this
30
+ */
31
+ page(no: number, count?: number): this;
32
+ /**
33
+ * 出力順序を指定する。指定しない場合は新着順となります。
34
+ * old 古い順
35
+ * @param {TOrder} order 出力順序
36
+ * @return {SearchBuilder} this
37
+ */
38
+ order(order: TOrder): this;
39
+ /**
40
+ * gzip圧縮する。
41
+ *
42
+ * 転送量上限を減らすためにも推奨
43
+ * @param {GzipLevel} level gzip圧縮レベル(1~5)
44
+ * @return {SearchBuilder} this
45
+ */
46
+ gzip(level: GzipLevel): this;
47
+ /**
48
+ * クエリパラメータをセットする
49
+ * @private
50
+ * @return {SearchBuilder} this
51
+ */
52
+ protected set(obj: TParams): this;
53
+ /**
54
+ * クエリパラメータを削除する
55
+ */
56
+ protected unset(key: keyof TParams): this;
57
+ }
58
+ export declare abstract class NovelSearchBuilderBase<T extends SearchResultFieldNames> extends SearchBuilderBase<SearchParams, Order> {
59
+ /**
60
+ * a
61
+ * @return {SearchBuilder} this
62
+ */
63
+ word(word: string): this;
64
+ /**
65
+ *
66
+ * @return {SearchBuilder} this
67
+ */
68
+ notWord(word: string): this;
69
+ /**
70
+ *
71
+ * @return {SearchBuilder} this
72
+ */
73
+ byTitle(bool?: boolean): this;
74
+ /**
75
+ *
76
+ * @return {SearchBuilder} this
77
+ */
78
+ byOutline(bool?: boolean): this;
79
+ /**
80
+ *
81
+ * @return {SearchBuilder} this
82
+ */
83
+ byKeyword(bool?: boolean): this;
84
+ /**
85
+ *
86
+ * @return {SearchBuilder} this
87
+ */
88
+ byAuthor(bool?: boolean): this;
89
+ /**
90
+ *
91
+ * @return {SearchBuilder} this
92
+ */
93
+ isBL(bool?: boolean): this;
94
+ /**
95
+ *
96
+ * @return {SearchBuilder} this
97
+ */
98
+ isGL(bool?: boolean): this;
99
+ /**
100
+ *
101
+ * @return {SearchBuilder} this
102
+ */
103
+ isZankoku(bool?: boolean): this;
104
+ /**
105
+ *
106
+ * @return {SearchBuilder} this
107
+ */
108
+ isTensei(bool?: boolean): this;
109
+ /**
110
+ *
111
+ * @return {SearchBuilder} this
112
+ */
113
+ isTenni(bool?: boolean): this;
114
+ /**
115
+ *
116
+ * @return {SearchBuilder} this
117
+ */
118
+ isTT(): this;
119
+ /**
120
+ *
121
+ * @return {SearchBuilder} this
122
+ */
123
+ length(length: number | readonly number[]): this;
124
+ /**
125
+ *
126
+ * @return {SearchBuilder} this
127
+ */
128
+ kaiwaritu(num: number): this;
129
+ kaiwaritu(min: number, max: number): this;
130
+ /**
131
+ *
132
+ * @return {SearchBuilder} this
133
+ */
134
+ sasie(num: number | readonly number[]): this;
135
+ /**
136
+ *
137
+ * @return {SearchBuilder} this
138
+ */
139
+ time(num: number | readonly number[]): this;
140
+ /**
141
+ *
142
+ * @return {SearchBuilder} this
143
+ */
144
+ ncode(ncodes: string | readonly string[]): this;
145
+ /**
146
+ *
147
+ * @return {SearchBuilder} this
148
+ */
149
+ type(type: NovelTypeParam): this;
150
+ /**
151
+ *
152
+ * @return {SearchBuilder} this
153
+ */
154
+ buntai(buntai: BuntaiParam | readonly BuntaiParam[]): this;
155
+ /**
156
+ *
157
+ * @return {SearchBuilder} this
158
+ */
159
+ isStop(bool?: boolean): this;
160
+ /**
161
+ *
162
+ * @return {SearchBuilder} this
163
+ */
164
+ isPickup(bool?: boolean): this;
165
+ /**
166
+ *
167
+ * @return {SearchBuilder} this
168
+ */
169
+ lastUpdate(date: string): this;
170
+ lastUpdate(from: number, to: number): this;
171
+ lastUpdate(from: Date, to: Date): this;
172
+ /**
173
+ * なろう小説APIへの検索リクエストを実行する
174
+ * @returns {Promise<NarouSearchResults>} 検索結果
175
+ */
176
+ execute(): Promise<NarouSearchResults<NarouSearchResult, T>>;
177
+ }
178
+ /**
179
+ * 検索ヘルパー
180
+ * @class SearchBuilder
181
+ */
182
+ export default class SearchBuilder<T extends keyof NarouSearchResult = DefaultSearchResultFields, TOpt extends keyof NarouSearchResult = never> extends NovelSearchBuilderBase<T | TOpt> {
183
+ /**
184
+ *
185
+ * @return {SearchBuilder} this
186
+ */
187
+ bigGenre(genre: BigGenre | readonly BigGenre[]): this;
188
+ /**
189
+ *
190
+ * @return {SearchBuilder} this
191
+ */
192
+ notBigGenre(genre: BigGenre | readonly BigGenre[]): this;
193
+ /**
194
+ *
195
+ * @return {SearchBuilder} this
196
+ */
197
+ genre(genre: Genre | readonly Genre[]): this;
198
+ /**
199
+ *
200
+ * @return {SearchBuilder} this
201
+ */
202
+ notGenre(genre: Genre | readonly Genre[]): this;
203
+ /**
204
+ *
205
+ * @return {SearchBuilder} this
206
+ */
207
+ userId(ids: number | readonly number[]): this;
208
+ /**
209
+ *
210
+ * @return {SearchBuilder} this
211
+ */
212
+ isR15(bool?: boolean): this;
213
+ /**
214
+ *
215
+ * @return {SearchBuilder} this
216
+ */
217
+ fields<TFields extends Fields>(fields: TFields | readonly TFields[]): SearchBuilder<SearchResultFields<TFields>, TOpt>;
218
+ opt<TFields extends OptionalFields>(option: TFields | readonly TFields[]): SearchBuilder<T, SearchResultOptionalFields<TFields>>;
219
+ }
220
220
  //# sourceMappingURL=search-builder.d.ts.map