narou 0.8.1 → 0.9.0

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 (162) hide show
  1. package/dist/chunk-3UZPHZZH.js +43 -0
  2. package/dist/chunk-46WN4HIZ.js +25 -0
  3. package/dist/chunk-55V5YY6H.js +71 -0
  4. package/dist/chunk-5OZA6DNS.js +14 -0
  5. package/dist/chunk-67BSHN66.js +82 -0
  6. package/dist/chunk-6SHYBHWX.js +0 -0
  7. package/dist/chunk-AIRK7Y7G.js +0 -0
  8. package/dist/chunk-C54MSVRN.js +3064 -0
  9. package/dist/chunk-EQL67JCA.js +38 -0
  10. package/dist/chunk-IKR7OZGM.js +49 -0
  11. package/dist/chunk-IVQKYEQQ.js +371 -0
  12. package/dist/chunk-JFVJBECE.js +36 -0
  13. package/dist/chunk-JS5XPNGB.js +93 -0
  14. package/dist/chunk-OVGZ6RWT.js +23 -0
  15. package/dist/chunk-U3H4E2XZ.js +396 -0
  16. package/dist/index.browser.cjs +1221 -0
  17. package/dist/index.browser.d.cts +40 -0
  18. package/dist/index.browser.d.ts +20 -16
  19. package/dist/index.browser.js +116 -72
  20. package/dist/index.cjs +4305 -0
  21. package/dist/index.common.cjs +1032 -0
  22. package/dist/index.common.d.cts +6 -0
  23. package/dist/index.common.d.ts +6 -15
  24. package/dist/index.common.js +73 -34
  25. package/dist/index.d.cts +47 -0
  26. package/dist/index.d.ts +21 -17
  27. package/dist/index.js +121 -80
  28. package/dist/narou-61329eea.d.ts +298 -0
  29. package/dist/narou-98ededc8.d.ts +298 -0
  30. package/dist/narou-fetch.cjs +3190 -0
  31. package/dist/narou-fetch.d.cts +16 -0
  32. package/dist/narou-fetch.d.ts +10 -7
  33. package/dist/narou-fetch.js +10 -46
  34. package/dist/narou-jsonp.cjs +158 -0
  35. package/dist/narou-jsonp.d.cts +13 -0
  36. package/dist/narou-jsonp.d.ts +8 -5
  37. package/dist/narou-jsonp.js +10 -24
  38. package/dist/narou-ranking-results.cjs +18 -0
  39. package/dist/narou-ranking-results.d.cts +4 -0
  40. package/dist/narou-ranking-results.d.ts +4 -10
  41. package/dist/narou-ranking-results.js +1 -3
  42. package/dist/narou-search-results-6727b1ce.d.ts +716 -0
  43. package/dist/narou-search-results-b7c10db0.d.ts +716 -0
  44. package/dist/narou-search-results.cjs +61 -0
  45. package/dist/narou-search-results.d.cts +2 -0
  46. package/dist/narou-search-results.d.ts +2 -131
  47. package/dist/narou-search-results.js +10 -62
  48. package/dist/narou.cjs +108 -0
  49. package/dist/narou.d.cts +4 -0
  50. package/dist/narou.d.ts +4 -26
  51. package/dist/narou.js +8 -30
  52. package/dist/params.cjs +436 -0
  53. package/dist/params.d.cts +2 -0
  54. package/dist/params.d.ts +2 -324
  55. package/dist/params.js +38 -246
  56. package/dist/ranking-history.cjs +38 -0
  57. package/dist/ranking-history.d.cts +17 -0
  58. package/dist/ranking-history.d.ts +8 -5
  59. package/dist/ranking-history.js +7 -14
  60. package/dist/ranking.cjs +659 -0
  61. package/dist/ranking.d.cts +47 -0
  62. package/dist/ranking.d.ts +8 -7
  63. package/dist/ranking.js +9 -87
  64. package/dist/search-builder-r18.cjs +473 -0
  65. package/dist/search-builder-r18.d.cts +32 -0
  66. package/dist/search-builder-r18.d.ts +9 -6
  67. package/dist/search-builder-r18.js +9 -45
  68. package/dist/search-builder.cjs +510 -0
  69. package/dist/search-builder.d.cts +4 -0
  70. package/dist/search-builder.d.ts +4 -220
  71. package/dist/search-builder.js +12 -381
  72. package/dist/user-search.cjs +300 -0
  73. package/{dist.esm/user-search.js → dist/user-search.d.cts} +18 -46
  74. package/dist/user-search.d.ts +8 -5
  75. package/dist/user-search.js +9 -94
  76. package/dist/util/jsonp.cjs +62 -0
  77. package/dist/util/jsonp.d.cts +13 -0
  78. package/dist/util/jsonp.d.ts +4 -8
  79. package/dist/util/jsonp.js +7 -46
  80. package/dist/util/type.cjs +18 -0
  81. package/dist/util/type.d.cts +4 -0
  82. package/dist/util/type.d.ts +4 -4
  83. package/dist/util/type.js +0 -3
  84. package/dist/util/unzipp.cjs +47 -0
  85. package/dist/util/unzipp.d.cts +3 -0
  86. package/dist/util/unzipp.d.ts +3 -4
  87. package/dist/util/unzipp.js +7 -12
  88. package/package.json +35 -33
  89. package/src/narou-fetch.ts +6 -16
  90. package/src/narou-jsonp.ts +0 -2
  91. package/src/narou-ranking-results.ts +10 -0
  92. package/src/narou-search-results.ts +118 -63
  93. package/src/narou.ts +42 -3
  94. package/src/params.ts +220 -61
  95. package/src/util/unzipp.ts +13 -3
  96. package/dist/index.browser.d.ts.map +0 -1
  97. package/dist/index.browser.js.map +0 -1
  98. package/dist/index.common.d.ts.map +0 -1
  99. package/dist/index.common.js.map +0 -1
  100. package/dist/index.d.ts.map +0 -1
  101. package/dist/index.js.map +0 -1
  102. package/dist/narou-fetch.d.ts.map +0 -1
  103. package/dist/narou-fetch.js.map +0 -1
  104. package/dist/narou-jsonp.d.ts.map +0 -1
  105. package/dist/narou-jsonp.js.map +0 -1
  106. package/dist/narou-ranking-results.d.ts.map +0 -1
  107. package/dist/narou-ranking-results.js.map +0 -1
  108. package/dist/narou-search-results.d.ts.map +0 -1
  109. package/dist/narou-search-results.js.map +0 -1
  110. package/dist/narou.d.ts.map +0 -1
  111. package/dist/narou.js.map +0 -1
  112. package/dist/params.d.ts.map +0 -1
  113. package/dist/params.js.map +0 -1
  114. package/dist/ranking-history.d.ts.map +0 -1
  115. package/dist/ranking-history.js.map +0 -1
  116. package/dist/ranking.d.ts.map +0 -1
  117. package/dist/ranking.js.map +0 -1
  118. package/dist/search-builder-r18.d.ts.map +0 -1
  119. package/dist/search-builder-r18.js.map +0 -1
  120. package/dist/search-builder.d.ts.map +0 -1
  121. package/dist/search-builder.js.map +0 -1
  122. package/dist/user-search.d.ts.map +0 -1
  123. package/dist/user-search.js.map +0 -1
  124. package/dist/util/jsonp.d.ts.map +0 -1
  125. package/dist/util/jsonp.js.map +0 -1
  126. package/dist/util/type.d.ts.map +0 -1
  127. package/dist/util/type.js.map +0 -1
  128. package/dist/util/unzipp.d.ts.map +0 -1
  129. package/dist/util/unzipp.js.map +0 -1
  130. package/dist.esm/index.browser.js +0 -86
  131. package/dist.esm/index.browser.js.map +0 -1
  132. package/dist.esm/index.common.js +0 -38
  133. package/dist.esm/index.common.js.map +0 -1
  134. package/dist.esm/index.js +0 -94
  135. package/dist.esm/index.js.map +0 -1
  136. package/dist.esm/narou-fetch.js +0 -49
  137. package/dist.esm/narou-fetch.js.map +0 -1
  138. package/dist.esm/narou-jsonp.js +0 -27
  139. package/dist.esm/narou-jsonp.js.map +0 -1
  140. package/dist.esm/narou-ranking-results.js +0 -3
  141. package/dist.esm/narou-ranking-results.js.map +0 -1
  142. package/dist.esm/narou-search-results.js +0 -63
  143. package/dist.esm/narou-search-results.js.map +0 -1
  144. package/dist.esm/narou.js +0 -33
  145. package/dist.esm/narou.js.map +0 -1
  146. package/dist.esm/params.js +0 -247
  147. package/dist.esm/params.js.map +0 -1
  148. package/dist.esm/ranking-history.js +0 -14
  149. package/dist.esm/ranking-history.js.map +0 -1
  150. package/dist.esm/ranking.js +0 -90
  151. package/dist.esm/ranking.js.map +0 -1
  152. package/dist.esm/search-builder-r18.js +0 -45
  153. package/dist.esm/search-builder-r18.js.map +0 -1
  154. package/dist.esm/search-builder.js +0 -381
  155. package/dist.esm/search-builder.js.map +0 -1
  156. package/dist.esm/user-search.js.map +0 -1
  157. package/dist.esm/util/jsonp.js +0 -46
  158. package/dist.esm/util/jsonp.js.map +0 -1
  159. package/dist.esm/util/type.js +0 -3
  160. package/dist.esm/util/type.js.map +0 -1
  161. package/dist.esm/util/unzipp.js +0 -12
  162. package/dist.esm/util/unzipp.js.map +0 -1
@@ -0,0 +1,300 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/user-search.ts
21
+ var user_search_exports = {};
22
+ __export(user_search_exports, {
23
+ default: () => UserSearchBuilder
24
+ });
25
+ module.exports = __toCommonJS(user_search_exports);
26
+
27
+ // src/params.ts
28
+ var R18Site = {
29
+ /** ノクターンノベルズ(男性向け) */
30
+ Nocturne: 1,
31
+ /** ムーンライトノベルズ(女性向け) */
32
+ MoonLight: 2,
33
+ /** ムーンライトノベルズ(BL) */
34
+ MoonLightBL: 3,
35
+ /** ミッドナイトノベルズ(大人向け) */
36
+ Midnight: 4
37
+ };
38
+ var R18SiteNotation = {
39
+ [R18Site.Nocturne]: "\u30CE\u30AF\u30BF\u30FC\u30F3\u30CE\u30D9\u30EB\u30BA(\u7537\u6027\u5411\u3051)",
40
+ [R18Site.MoonLight]: "\u30E0\u30FC\u30F3\u30E9\u30A4\u30C8\u30CE\u30D9\u30EB\u30BA(\u5973\u6027\u5411\u3051)",
41
+ [R18Site.MoonLightBL]: "\u30E0\u30FC\u30F3\u30E9\u30A4\u30C8\u30CE\u30D9\u30EB\u30BA(BL)",
42
+ [R18Site.Midnight]: "\u30DF\u30C3\u30C9\u30CA\u30A4\u30C8\u30CE\u30D9\u30EB\u30BA(\u5927\u4EBA\u5411\u3051)"
43
+ };
44
+ var BigGenre = {
45
+ /** 恋愛 */
46
+ Renai: 1,
47
+ /** ファンタジー */
48
+ Fantasy: 2,
49
+ /** 文芸 */
50
+ Bungei: 3,
51
+ /** SF */
52
+ Sf: 4,
53
+ /** その他 */
54
+ Sonota: 99,
55
+ /** ノンジャンル */
56
+ NonGenre: 98
57
+ };
58
+ var BigGenreNotation = {
59
+ [BigGenre.Renai]: "\u604B\u611B",
60
+ [BigGenre.Fantasy]: "\u30D5\u30A1\u30F3\u30BF\u30B8\u30FC",
61
+ [BigGenre.Bungei]: "\u6587\u82B8",
62
+ [BigGenre.Sf]: "SF",
63
+ [BigGenre.Sonota]: "\u305D\u306E\u4ED6",
64
+ [BigGenre.NonGenre]: "\u30CE\u30F3\u30B8\u30E3\u30F3\u30EB"
65
+ };
66
+ var Genre = {
67
+ /** 異世界〔恋愛〕*/
68
+ RenaiIsekai: 101,
69
+ /** 現実世界〔恋愛〕*/
70
+ RenaiGenjitsusekai: 102,
71
+ /** ハイファンタジー〔ファンタジー〕*/
72
+ FantasyHigh: 201,
73
+ /** ローファンタジー〔ファンタジー〕*/
74
+ FantasyLow: 202,
75
+ /** 純文学〔文芸〕*/
76
+ BungeiJyunbungei: 301,
77
+ /** ヒューマンドラマ〔文芸〕*/
78
+ BungeiHumanDrama: 302,
79
+ /** 歴史〔文芸〕*/
80
+ BungeiHistory: 303,
81
+ /** 推理〔文芸〕*/
82
+ BungeiSuiri: 304,
83
+ /** ホラー〔文芸〕*/
84
+ BungeiHorror: 305,
85
+ /** アクション〔文芸〕*/
86
+ BungeiAction: 306,
87
+ /** コメディー〔文芸〕*/
88
+ BungeiComedy: 307,
89
+ /** VRゲーム〔SF〕*/
90
+ SfVrgame: 401,
91
+ /** 宇宙〔SF〕*/
92
+ SfSpace: 402,
93
+ /** 空想科学〔SF〕*/
94
+ SfKuusoukagaku: 403,
95
+ /** パニック〔SF〕*/
96
+ SfPanic: 404,
97
+ /** 童話〔その他〕*/
98
+ SonotaDouwa: 9901,
99
+ /** 詩〔その他〕*/
100
+ SonotaShi: 9902,
101
+ /** エッセイ〔その他〕*/
102
+ SonotaEssei: 9903,
103
+ /** リプレイ〔その他〕*/
104
+ SonotaReplay: 9904,
105
+ /** その他〔その他〕 */
106
+ SonotaSonota: 9999,
107
+ /** ノンジャンル〔ノンジャンル〕*/
108
+ NonGenre: 9801
109
+ };
110
+ var GenreNotation = {
111
+ [Genre.RenaiIsekai]: "\u7570\u4E16\u754C\u3014\u604B\u611B\u3015",
112
+ [Genre.RenaiGenjitsusekai]: "\u73FE\u5B9F\u4E16\u754C\u3014\u604B\u611B\u3015",
113
+ [Genre.FantasyHigh]: "\u30CF\u30A4\u30D5\u30A1\u30F3\u30BF\u30B8\u30FC\u3014\u30D5\u30A1\u30F3\u30BF\u30B8\u30FC\u3015",
114
+ [Genre.FantasyLow]: "\u30ED\u30FC\u30D5\u30A1\u30F3\u30BF\u30B8\u30FC\u3014\u30D5\u30A1\u30F3\u30BF\u30B8\u30FC\u3015",
115
+ [Genre.BungeiJyunbungei]: "\u7D14\u6587\u5B66\u3014\u6587\u82B8\u3015",
116
+ [Genre.BungeiHumanDrama]: "\u30D2\u30E5\u30FC\u30DE\u30F3\u30C9\u30E9\u30DE\u3014\u6587\u82B8\u3015",
117
+ [Genre.BungeiHistory]: "\u6B74\u53F2\u3014\u6587\u82B8\u3015",
118
+ [Genre.BungeiSuiri]: "\u63A8\u7406\u3014\u6587\u82B8\u3015",
119
+ [Genre.BungeiHorror]: "\u30DB\u30E9\u30FC\u3014\u6587\u82B8\u3015",
120
+ [Genre.BungeiAction]: "\u30A2\u30AF\u30B7\u30E7\u30F3\u3014\u6587\u82B8\u3015",
121
+ [Genre.BungeiComedy]: "\u30B3\u30E1\u30C7\u30A3\u30FC\u3014\u6587\u82B8\u3015",
122
+ [Genre.SfVrgame]: "VR\u30B2\u30FC\u30E0\u3014SF\u3015",
123
+ [Genre.SfSpace]: "\u5B87\u5B99\u3014SF\u3015",
124
+ [Genre.SfKuusoukagaku]: "\u7A7A\u60F3\u79D1\u5B66\u3014SF\u3015",
125
+ [Genre.SfPanic]: "\u30D1\u30CB\u30C3\u30AF\u3014SF\u3015",
126
+ [Genre.SonotaDouwa]: "\u7AE5\u8A71\u3014\u305D\u306E\u4ED6\u3015",
127
+ [Genre.SonotaShi]: "\u8A69\u3014\u305D\u306E\u4ED6\u3015",
128
+ [Genre.SonotaEssei]: "\u30A8\u30C3\u30BB\u30A4\u3014\u305D\u306E\u4ED6\u3015",
129
+ [Genre.SonotaReplay]: "\u30EA\u30D7\u30EC\u30A4\u3014\u305D\u306E\u4ED6\u3015",
130
+ [Genre.SonotaSonota]: "\u305D\u306E\u4ED6\u3014\u305D\u306E\u4ED6\u3015",
131
+ [Genre.NonGenre]: "\u30CE\u30F3\u30B8\u30E3\u30F3\u30EB\u3014\u30CE\u30F3\u30B8\u30E3\u30F3\u30EB\u3015"
132
+ };
133
+
134
+ // src/search-builder.ts
135
+ var SearchBuilderBase = class {
136
+ /**
137
+ * constructor
138
+ * @private
139
+ */
140
+ constructor(params = {}, api) {
141
+ this.params = params;
142
+ this.api = api;
143
+ }
144
+ static distinct(array) {
145
+ return Array.from(new Set(array));
146
+ }
147
+ static array2string(n) {
148
+ if (Array.isArray(n)) {
149
+ return this.distinct(n).join("-");
150
+ } else {
151
+ return n.toString();
152
+ }
153
+ }
154
+ /**
155
+ *
156
+ * @return {SearchBuilder} this
157
+ */
158
+ limit(num) {
159
+ this.set({ lim: num });
160
+ return this;
161
+ }
162
+ /**
163
+ *
164
+ * @return {SearchBuilder} this
165
+ */
166
+ start(num) {
167
+ this.set({ st: num });
168
+ return this;
169
+ }
170
+ /**
171
+ *
172
+ * @return {SearchBuilder} this
173
+ */
174
+ page(no, count = 20) {
175
+ return this.limit(count).start(no * count);
176
+ }
177
+ /**
178
+ * 出力順序を指定する。指定しない場合は新着順となります。
179
+ * old 古い順
180
+ * @param {TOrder} order 出力順序
181
+ * @return {SearchBuilder} this
182
+ */
183
+ order(order) {
184
+ this.set({ order });
185
+ return this;
186
+ }
187
+ /**
188
+ * gzip圧縮する。
189
+ *
190
+ * 転送量上限を減らすためにも推奨
191
+ * @param {GzipLevel} level gzip圧縮レベル(1~5)
192
+ * @return {SearchBuilder} this
193
+ */
194
+ gzip(level) {
195
+ this.set({ gzip: level });
196
+ return this;
197
+ }
198
+ /**
199
+ * クエリパラメータをセットする
200
+ * @private
201
+ * @return {SearchBuilder} this
202
+ */
203
+ set(obj) {
204
+ this.params = { ...this.params, ...obj };
205
+ return this;
206
+ }
207
+ /**
208
+ * クエリパラメータを削除する
209
+ */
210
+ unset(key) {
211
+ delete this.params[key];
212
+ return this;
213
+ }
214
+ };
215
+
216
+ // src/user-search.ts
217
+ var UserSearchBuilder = class _UserSearchBuilder extends SearchBuilderBase {
218
+ /**
219
+ * 単語を指定できます。
220
+ * 半角または全角スペースで区切るとAND抽出になります。
221
+ * 部分一致でHITします。検索の対象はユーザ名とユーザ名のフリガナです。
222
+ */
223
+ word(word) {
224
+ this.set({ word });
225
+ return this;
226
+ }
227
+ /**
228
+ * 含みたくない単語を指定できます。
229
+ * スペースで区切ることにより含ませない単語を増やせます。部分一致で除外されます。
230
+ * 除外の対象はユーザ名とユーザ名のフリガナです。
231
+ */
232
+ notWord(notword) {
233
+ this.set({ notword });
234
+ return this;
235
+ }
236
+ /**
237
+ * ユーザIDで抽出可能。
238
+ */
239
+ userId(userid) {
240
+ this.set({ userid });
241
+ return this;
242
+ }
243
+ /**
244
+ * 抽出するユーザのユーザ名のフリガナの頭文字を指定できます。
245
+ * 頭文字はユーザ名のフリガナをひらがなに変換し、最初の1文字が「ぁ」~「ん」の場合に対象となります。
246
+ * 「ぱ」や「ば」等の半濁音や濁音は清音として扱われます。
247
+ * 漢字や英数字が頭文字のユーザは対象外です。
248
+ */
249
+ name1st(name1st) {
250
+ this.set({ name1st });
251
+ return this;
252
+ }
253
+ /**
254
+ * 抽出するユーザの小説投稿数の下限を指定できます。
255
+ * 小説投稿件数が指定された数値以上のユーザを抽出します。
256
+ */
257
+ minNovel(minnovel) {
258
+ this.set({ minnovel });
259
+ return this;
260
+ }
261
+ /**
262
+ * 抽出するユーザの小説投稿数の上限を指定できます。
263
+ * 小説投稿件数が指定された数値以下のユーザを抽出します。
264
+ */
265
+ maxNovel(maxnovel) {
266
+ this.set({ maxnovel });
267
+ return this;
268
+ }
269
+ /**
270
+ * 抽出するユーザのレビュー投稿数の下限を指定できます。
271
+ * レビュー投稿件数が指定された数値以上のユーザを抽出します。
272
+ */
273
+ minReview(minreview) {
274
+ this.set({ minreview });
275
+ return this;
276
+ }
277
+ /**
278
+ * 抽出するユーザのレビュー投稿数の上限を指定できます。
279
+ * レビュー投稿件数が指定された数値以下のユーザを抽出します。
280
+ */
281
+ maxReview(maxreview) {
282
+ this.set({ maxreview });
283
+ return this;
284
+ }
285
+ /**
286
+ * 出力する項目を個別に指定できます。未指定時は全項目出力されます。転送量軽減のため、このパラメータの使用が推奨されます。
287
+ * @return {SearchBuilder} this
288
+ */
289
+ fields(fields) {
290
+ this.set({ of: _UserSearchBuilder.array2string(fields) });
291
+ return this;
292
+ }
293
+ /**
294
+ * なろう小説APIへのリクエストを実行する
295
+ * @returns ランキング
296
+ */
297
+ execute() {
298
+ return this.api.executeUserSearch(this.params);
299
+ }
300
+ };
@@ -1,94 +1,66 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const search_builder_1 = require("./search-builder");
1
+ import { s as UserSearchResult, U as UserSearchParams, p as UserOrder, f as UserFields, x as UserSearchResultFields, N as NarouSearchResults } from './narou-search-results-6727b1ce.js';
2
+ import { c as SearchBuilderBase } from './narou-98ededc8.js';
3
+ import './util/type.cjs';
4
+ import './ranking-history.cjs';
5
+
4
6
  /**
5
7
  * なろうユーザ検索API
6
8
  * @class UserSearch
7
9
  */
8
- class UserSearchBuilder extends search_builder_1.SearchBuilderBase {
10
+ declare class UserSearchBuilder<TField extends keyof UserSearchResult = keyof UserSearchResult> extends SearchBuilderBase<UserSearchParams, UserOrder> {
9
11
  /**
10
12
  * 単語を指定できます。
11
13
  * 半角または全角スペースで区切るとAND抽出になります。
12
14
  * 部分一致でHITします。検索の対象はユーザ名とユーザ名のフリガナです。
13
15
  */
14
- word(word) {
15
- this.set({ word });
16
- return this;
17
- }
16
+ word(word: string): this;
18
17
  /**
19
18
  * 含みたくない単語を指定できます。
20
19
  * スペースで区切ることにより含ませない単語を増やせます。部分一致で除外されます。
21
20
  * 除外の対象はユーザ名とユーザ名のフリガナです。
22
21
  */
23
- notWord(notword) {
24
- this.set({ notword });
25
- return this;
26
- }
22
+ notWord(notword: string): this;
27
23
  /**
28
24
  * ユーザIDで抽出可能。
29
25
  */
30
- userId(userid) {
31
- this.set({ userid });
32
- return this;
33
- }
26
+ userId(userid: number): this;
34
27
  /**
35
28
  * 抽出するユーザのユーザ名のフリガナの頭文字を指定できます。
36
29
  * 頭文字はユーザ名のフリガナをひらがなに変換し、最初の1文字が「ぁ」~「ん」の場合に対象となります。
37
30
  * 「ぱ」や「ば」等の半濁音や濁音は清音として扱われます。
38
31
  * 漢字や英数字が頭文字のユーザは対象外です。
39
32
  */
40
- name1st(name1st) {
41
- this.set({ name1st });
42
- return this;
43
- }
33
+ name1st(name1st: string): this;
44
34
  /**
45
35
  * 抽出するユーザの小説投稿数の下限を指定できます。
46
36
  * 小説投稿件数が指定された数値以上のユーザを抽出します。
47
37
  */
48
- minNovel(minnovel) {
49
- this.set({ minnovel });
50
- return this;
51
- }
38
+ minNovel(minnovel: number): this;
52
39
  /**
53
40
  * 抽出するユーザの小説投稿数の上限を指定できます。
54
41
  * 小説投稿件数が指定された数値以下のユーザを抽出します。
55
42
  */
56
- maxNovel(maxnovel) {
57
- this.set({ maxnovel });
58
- return this;
59
- }
43
+ maxNovel(maxnovel: number): this;
60
44
  /**
61
45
  * 抽出するユーザのレビュー投稿数の下限を指定できます。
62
46
  * レビュー投稿件数が指定された数値以上のユーザを抽出します。
63
47
  */
64
- minReview(minreview) {
65
- this.set({ minreview });
66
- return this;
67
- }
48
+ minReview(minreview: number): this;
68
49
  /**
69
50
  * 抽出するユーザのレビュー投稿数の上限を指定できます。
70
51
  * レビュー投稿件数が指定された数値以下のユーザを抽出します。
71
52
  */
72
- maxReview(maxreview) {
73
- this.set({ maxreview });
74
- return this;
75
- }
53
+ maxReview(maxreview: number): this;
76
54
  /**
77
55
  * 出力する項目を個別に指定できます。未指定時は全項目出力されます。転送量軽減のため、このパラメータの使用が推奨されます。
78
56
  * @return {SearchBuilder} this
79
57
  */
80
- fields(fields) {
81
- this.set({ of: UserSearchBuilder.array2string(fields) });
82
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
83
- return this;
84
- }
58
+ fields<TFields extends UserFields>(fields: TFields | readonly TFields[]): UserSearchBuilder<UserSearchResultFields<TFields>>;
85
59
  /**
86
60
  * なろう小説APIへのリクエストを実行する
87
61
  * @returns ランキング
88
62
  */
89
- execute() {
90
- return this.api.executeUserSearch(this.params);
91
- }
63
+ execute(): Promise<NarouSearchResults<UserSearchResult, TField>>;
92
64
  }
93
- exports.default = UserSearchBuilder;
94
- //# sourceMappingURL=user-search.js.map
65
+
66
+ export { UserSearchBuilder as default };
@@ -1,11 +1,13 @@
1
- import NarouSearchResults, { UserSearchResult, UserSearchResultFields } from "./narou-search-results";
2
- import { UserFields, UserOrder, UserSearchParams } from "./params";
3
- import { SearchBuilderBase } from "./search-builder";
1
+ import { s as UserSearchResult, U as UserSearchParams, p as UserOrder, f as UserFields, x as UserSearchResultFields, N as NarouSearchResults } from './narou-search-results-b7c10db0.js';
2
+ import { c as SearchBuilderBase } from './narou-61329eea.js';
3
+ import './util/type.js';
4
+ import './ranking-history.js';
5
+
4
6
  /**
5
7
  * なろうユーザ検索API
6
8
  * @class UserSearch
7
9
  */
8
- export default class UserSearchBuilder<TField extends keyof UserSearchResult = keyof UserSearchResult> extends SearchBuilderBase<UserSearchParams, UserOrder> {
10
+ declare class UserSearchBuilder<TField extends keyof UserSearchResult = keyof UserSearchResult> extends SearchBuilderBase<UserSearchParams, UserOrder> {
9
11
  /**
10
12
  * 単語を指定できます。
11
13
  * 半角または全角スペースで区切るとAND抽出になります。
@@ -60,4 +62,5 @@ export default class UserSearchBuilder<TField extends keyof UserSearchResult = k
60
62
  */
61
63
  execute(): Promise<NarouSearchResults<UserSearchResult, TField>>;
62
64
  }
63
- //# sourceMappingURL=user-search.d.ts.map
65
+
66
+ export { UserSearchBuilder as default };
@@ -1,94 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const search_builder_1 = require("./search-builder");
4
- /**
5
- * なろうユーザ検索API
6
- * @class UserSearch
7
- */
8
- class UserSearchBuilder extends search_builder_1.SearchBuilderBase {
9
- /**
10
- * 単語を指定できます。
11
- * 半角または全角スペースで区切るとAND抽出になります。
12
- * 部分一致でHITします。検索の対象はユーザ名とユーザ名のフリガナです。
13
- */
14
- word(word) {
15
- this.set({ word });
16
- return this;
17
- }
18
- /**
19
- * 含みたくない単語を指定できます。
20
- * スペースで区切ることにより含ませない単語を増やせます。部分一致で除外されます。
21
- * 除外の対象はユーザ名とユーザ名のフリガナです。
22
- */
23
- notWord(notword) {
24
- this.set({ notword });
25
- return this;
26
- }
27
- /**
28
- * ユーザIDで抽出可能。
29
- */
30
- userId(userid) {
31
- this.set({ userid });
32
- return this;
33
- }
34
- /**
35
- * 抽出するユーザのユーザ名のフリガナの頭文字を指定できます。
36
- * 頭文字はユーザ名のフリガナをひらがなに変換し、最初の1文字が「ぁ」~「ん」の場合に対象となります。
37
- * 「ぱ」や「ば」等の半濁音や濁音は清音として扱われます。
38
- * 漢字や英数字が頭文字のユーザは対象外です。
39
- */
40
- name1st(name1st) {
41
- this.set({ name1st });
42
- return this;
43
- }
44
- /**
45
- * 抽出するユーザの小説投稿数の下限を指定できます。
46
- * 小説投稿件数が指定された数値以上のユーザを抽出します。
47
- */
48
- minNovel(minnovel) {
49
- this.set({ minnovel });
50
- return this;
51
- }
52
- /**
53
- * 抽出するユーザの小説投稿数の上限を指定できます。
54
- * 小説投稿件数が指定された数値以下のユーザを抽出します。
55
- */
56
- maxNovel(maxnovel) {
57
- this.set({ maxnovel });
58
- return this;
59
- }
60
- /**
61
- * 抽出するユーザのレビュー投稿数の下限を指定できます。
62
- * レビュー投稿件数が指定された数値以上のユーザを抽出します。
63
- */
64
- minReview(minreview) {
65
- this.set({ minreview });
66
- return this;
67
- }
68
- /**
69
- * 抽出するユーザのレビュー投稿数の上限を指定できます。
70
- * レビュー投稿件数が指定された数値以下のユーザを抽出します。
71
- */
72
- maxReview(maxreview) {
73
- this.set({ maxreview });
74
- return this;
75
- }
76
- /**
77
- * 出力する項目を個別に指定できます。未指定時は全項目出力されます。転送量軽減のため、このパラメータの使用が推奨されます。
78
- * @return {SearchBuilder} this
79
- */
80
- fields(fields) {
81
- this.set({ of: UserSearchBuilder.array2string(fields) });
82
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
83
- return this;
84
- }
85
- /**
86
- * なろう小説APIへのリクエストを実行する
87
- * @returns ランキング
88
- */
89
- execute() {
90
- return this.api.executeUserSearch(this.params);
91
- }
92
- }
93
- exports.default = UserSearchBuilder;
94
- //# sourceMappingURL=user-search.js.map
1
+ import {
2
+ UserSearchBuilder
3
+ } from "./chunk-JS5XPNGB.js";
4
+ import "./chunk-IVQKYEQQ.js";
5
+ import "./chunk-U3H4E2XZ.js";
6
+ import "./chunk-IKR7OZGM.js";
7
+ export {
8
+ UserSearchBuilder as default
9
+ };
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/util/jsonp.ts
21
+ var jsonp_exports = {};
22
+ __export(jsonp_exports, {
23
+ jsonp: () => jsonp
24
+ });
25
+ module.exports = __toCommonJS(jsonp_exports);
26
+ var count = 0;
27
+ var noop = function() {
28
+ };
29
+ function jsonp(url, { prefix = "__jp", param = "callback", timeout = 15e3 } = {}) {
30
+ return new Promise(function(resolve, reject) {
31
+ const targetChild = document.getElementsByTagName("script").item(0);
32
+ const target = targetChild?.parentNode ?? document.head;
33
+ const id = `${prefix}${count++}`;
34
+ const cleanup = function() {
35
+ if (script && script.parentNode) {
36
+ script.parentNode.removeChild(script);
37
+ }
38
+ window[id] = noop;
39
+ if (timer) {
40
+ clearTimeout(timer);
41
+ }
42
+ };
43
+ const timer = timeout > 0 ? setTimeout(() => {
44
+ cleanup();
45
+ reject(new Error("Timeout"));
46
+ }, timeout) : void 0;
47
+ const callback = (data) => {
48
+ cleanup();
49
+ resolve(data);
50
+ };
51
+ window[id] = callback;
52
+ const script = document.createElement("script");
53
+ const urlObj = new URL(url);
54
+ urlObj.searchParams.set(param, id);
55
+ script.setAttribute("src", urlObj.toString());
56
+ target.insertBefore(script, targetChild);
57
+ });
58
+ }
59
+ // Annotate the CommonJS export names for ESM import in node:
60
+ 0 && (module.exports = {
61
+ jsonp
62
+ });
@@ -0,0 +1,13 @@
1
+ declare global {
2
+ interface Window {
3
+ [key: CallbackId]: (data: any) => void;
4
+ }
5
+ }
6
+ type JsonpOption = {
7
+ prefix?: string;
8
+ param?: string;
9
+ timeout?: number;
10
+ };
11
+ declare function jsonp<T>(url: string, { prefix, param, timeout }?: JsonpOption): Promise<T>;
12
+
13
+ export { JsonpOption, jsonp };
@@ -1,17 +1,13 @@
1
- /**
2
- * MIT license
3
- */
4
- declare type CallbackId<Prefix extends string = string> = `${Prefix}${number}`;
5
1
  declare global {
6
2
  interface Window {
7
3
  [key: CallbackId]: (data: any) => void;
8
4
  }
9
5
  }
10
- export declare type JsonpOption = {
6
+ type JsonpOption = {
11
7
  prefix?: string;
12
8
  param?: string;
13
9
  timeout?: number;
14
10
  };
15
- export declare function jsonp<T>(url: string, { prefix, param, timeout }?: JsonpOption): Promise<T>;
16
- export {};
17
- //# sourceMappingURL=jsonp.d.ts.map
11
+ declare function jsonp<T>(url: string, { prefix, param, timeout }?: JsonpOption): Promise<T>;
12
+
13
+ export { JsonpOption, jsonp };