narou 1.1.0 → 2.0.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 (164) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +78 -35
  3. package/dist/index.browser.cjs +87 -1230
  4. package/dist/index.browser.cjs.map +1 -1
  5. package/dist/index.browser.d.cts +31 -24
  6. package/dist/index.browser.d.mts +47 -0
  7. package/dist/index.browser.mjs +66 -0
  8. package/dist/index.browser.mjs.map +1 -0
  9. package/dist/index.cjs +147 -1281
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.common-8lS2K_1Y.mjs +1166 -0
  12. package/dist/index.common-8lS2K_1Y.mjs.map +1 -0
  13. package/dist/index.common-CYj0n0aU.cjs +1346 -0
  14. package/dist/index.common-CYj0n0aU.cjs.map +1 -0
  15. package/dist/index.d.cts +39 -23
  16. package/dist/index.d.mts +63 -0
  17. package/dist/index.mjs +128 -0
  18. package/dist/index.mjs.map +1 -0
  19. package/dist/user-search-BY6FdEe7.d.cts +1394 -0
  20. package/dist/user-search-Besgk-Hx.d.mts +1394 -0
  21. package/package.json +34 -45
  22. package/pnpm-lock.yaml +2523 -2175
  23. package/src/index.browser.ts +21 -5
  24. package/src/index.ts +16 -3
  25. package/src/narou-fetch.ts +4 -3
  26. package/src/narou-jsonp.ts +4 -2
  27. package/src/narou-search-results.ts +2 -1
  28. package/src/narou.ts +53 -13
  29. package/src/params.ts +2 -2
  30. package/src/ranking-history.ts +13 -4
  31. package/src/ranking.ts +99 -26
  32. package/src/search-builder-r18.ts +23 -6
  33. package/src/search-builder.ts +183 -76
  34. package/src/user-search.ts +9 -2
  35. package/src/util/date.ts +38 -0
  36. package/src/util/jsonp.ts +61 -6
  37. package/src/util/type.ts +23 -0
  38. package/src/util/unzipp.ts +9 -0
  39. package/dist/chunk-4VC3246A.js +0 -83
  40. package/dist/chunk-4VC3246A.js.map +0 -1
  41. package/dist/chunk-4ZP5YNWI.js +0 -1
  42. package/dist/chunk-4ZP5YNWI.js.map +0 -1
  43. package/dist/chunk-AZT2OXBZ.js +0 -26
  44. package/dist/chunk-AZT2OXBZ.js.map +0 -1
  45. package/dist/chunk-CDOBNSCL.js +0 -407
  46. package/dist/chunk-CDOBNSCL.js.map +0 -1
  47. package/dist/chunk-K22KVNAH.js +0 -94
  48. package/dist/chunk-K22KVNAH.js.map +0 -1
  49. package/dist/chunk-NVMUSXA5.js +0 -23
  50. package/dist/chunk-NVMUSXA5.js.map +0 -1
  51. package/dist/chunk-P7QOZBII.js +0 -386
  52. package/dist/chunk-P7QOZBII.js.map +0 -1
  53. package/dist/chunk-RITMMCZE.js +0 -37
  54. package/dist/chunk-RITMMCZE.js.map +0 -1
  55. package/dist/chunk-SNPBEVCY.js +0 -44
  56. package/dist/chunk-SNPBEVCY.js.map +0 -1
  57. package/dist/chunk-UN3W2CT3.js +0 -72
  58. package/dist/chunk-UN3W2CT3.js.map +0 -1
  59. package/dist/chunk-WYSPGQ3S.js +0 -44
  60. package/dist/chunk-WYSPGQ3S.js.map +0 -1
  61. package/dist/chunk-XAUB42TO.js +0 -15
  62. package/dist/chunk-XAUB42TO.js.map +0 -1
  63. package/dist/chunk-XVH2CU2Q.js +0 -39
  64. package/dist/chunk-XVH2CU2Q.js.map +0 -1
  65. package/dist/index.browser.d.ts +0 -40
  66. package/dist/index.browser.js +0 -125
  67. package/dist/index.browser.js.map +0 -1
  68. package/dist/index.common.cjs +0 -1058
  69. package/dist/index.common.cjs.map +0 -1
  70. package/dist/index.common.d.cts +0 -6
  71. package/dist/index.common.d.ts +0 -6
  72. package/dist/index.common.js +0 -75
  73. package/dist/index.common.js.map +0 -1
  74. package/dist/index.d.ts +0 -47
  75. package/dist/index.js +0 -130
  76. package/dist/index.js.map +0 -1
  77. package/dist/narou-CatW_TC9.d.cts +0 -301
  78. package/dist/narou-fH9osIoh.d.ts +0 -301
  79. package/dist/narou-fetch.cjs +0 -161
  80. package/dist/narou-fetch.cjs.map +0 -1
  81. package/dist/narou-fetch.d.cts +0 -20
  82. package/dist/narou-fetch.d.ts +0 -20
  83. package/dist/narou-fetch.js +0 -10
  84. package/dist/narou-fetch.js.map +0 -1
  85. package/dist/narou-jsonp.cjs +0 -159
  86. package/dist/narou-jsonp.cjs.map +0 -1
  87. package/dist/narou-jsonp.d.cts +0 -13
  88. package/dist/narou-jsonp.d.ts +0 -13
  89. package/dist/narou-jsonp.js +0 -10
  90. package/dist/narou-jsonp.js.map +0 -1
  91. package/dist/narou-ranking-results.cjs +0 -19
  92. package/dist/narou-ranking-results.cjs.map +0 -1
  93. package/dist/narou-ranking-results.d.cts +0 -4
  94. package/dist/narou-ranking-results.d.ts +0 -4
  95. package/dist/narou-ranking-results.js +0 -1
  96. package/dist/narou-ranking-results.js.map +0 -1
  97. package/dist/narou-search-results-D5yqPRZ7.d.ts +0 -727
  98. package/dist/narou-search-results-DWCJWTC5.d.cts +0 -727
  99. package/dist/narou-search-results.cjs +0 -62
  100. package/dist/narou-search-results.cjs.map +0 -1
  101. package/dist/narou-search-results.d.cts +0 -2
  102. package/dist/narou-search-results.d.ts +0 -2
  103. package/dist/narou-search-results.js +0 -11
  104. package/dist/narou-search-results.js.map +0 -1
  105. package/dist/narou.cjs +0 -109
  106. package/dist/narou.cjs.map +0 -1
  107. package/dist/narou.d.cts +0 -4
  108. package/dist/narou.d.ts +0 -4
  109. package/dist/narou.js +0 -8
  110. package/dist/narou.js.map +0 -1
  111. package/dist/params.cjs +0 -448
  112. package/dist/params.cjs.map +0 -1
  113. package/dist/params.d.cts +0 -2
  114. package/dist/params.d.ts +0 -2
  115. package/dist/params.js +0 -41
  116. package/dist/params.js.map +0 -1
  117. package/dist/ranking-history.cjs +0 -39
  118. package/dist/ranking-history.cjs.map +0 -1
  119. package/dist/ranking-history.d.cts +0 -17
  120. package/dist/ranking-history.d.ts +0 -17
  121. package/dist/ranking-history.js +0 -7
  122. package/dist/ranking-history.js.map +0 -1
  123. package/dist/ranking.cjs +0 -674
  124. package/dist/ranking.cjs.map +0 -1
  125. package/dist/ranking.d.cts +0 -47
  126. package/dist/ranking.d.ts +0 -47
  127. package/dist/ranking.js +0 -9
  128. package/dist/ranking.js.map +0 -1
  129. package/dist/search-builder-r18.cjs +0 -488
  130. package/dist/search-builder-r18.cjs.map +0 -1
  131. package/dist/search-builder-r18.d.cts +0 -32
  132. package/dist/search-builder-r18.d.ts +0 -32
  133. package/dist/search-builder-r18.js +0 -9
  134. package/dist/search-builder-r18.js.map +0 -1
  135. package/dist/search-builder.cjs +0 -525
  136. package/dist/search-builder.cjs.map +0 -1
  137. package/dist/search-builder.d.cts +0 -4
  138. package/dist/search-builder.d.ts +0 -4
  139. package/dist/search-builder.js +0 -12
  140. package/dist/search-builder.js.map +0 -1
  141. package/dist/user-search.cjs +0 -301
  142. package/dist/user-search.cjs.map +0 -1
  143. package/dist/user-search.d.cts +0 -66
  144. package/dist/user-search.d.ts +0 -66
  145. package/dist/user-search.js +0 -9
  146. package/dist/user-search.js.map +0 -1
  147. package/dist/util/jsonp.cjs +0 -63
  148. package/dist/util/jsonp.cjs.map +0 -1
  149. package/dist/util/jsonp.d.cts +0 -13
  150. package/dist/util/jsonp.d.ts +0 -13
  151. package/dist/util/jsonp.js +0 -7
  152. package/dist/util/jsonp.js.map +0 -1
  153. package/dist/util/type.cjs +0 -19
  154. package/dist/util/type.cjs.map +0 -1
  155. package/dist/util/type.d.cts +0 -4
  156. package/dist/util/type.d.ts +0 -4
  157. package/dist/util/type.js +0 -1
  158. package/dist/util/type.js.map +0 -1
  159. package/dist/util/unzipp.cjs +0 -47
  160. package/dist/util/unzipp.cjs.map +0 -1
  161. package/dist/util/unzipp.d.cts +0 -3
  162. package/dist/util/unzipp.d.ts +0 -3
  163. package/dist/util/unzipp.js +0 -7
  164. package/dist/util/unzipp.js.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2015 deflis
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,34 +1,74 @@
1
- # node-narou
1
+ # 📚 node-narou
2
2
 
3
- [なろうデベロッパー](https://dev.syosetu.com/)の API を fluent interface で利用できるラッパーライブラリです。
4
- ブラウザでの JSONP の利用も可能です。
3
+ [![npm version](https://badge.fury.io/js/narou.svg)](https://badge.fury.io/js/narou)
4
+ [![Node.js CI](https://github.com/deflis/node-narou/actions/workflows/nodejs-test.yml/badge.svg)](https://github.com/deflis/node-narou/actions/workflows/nodejs-test.yml)
5
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/deflis/node-narou)
5
6
 
6
- 以下の API をラップしています。
7
+ [なろうデベロッパー](https://dev.syosetu.com/)の API を fluent interface で利用できる TypeScript ライブラリです。
8
+ A TypeScript wrapper library for Narou Developer APIs with fluent interface.
7
9
 
8
- - [なろう小説 API](https://dev.syosetu.com/man/api/)
9
- - [なろう小説ランキング API](https://dev.syosetu.com/man/rankapi/)
10
- - [なろう殿堂入り API](https://dev.syosetu.com/man/rankinapi/)
11
- - [なろう R18 小説 API](https://dev.syosetu.com/xman/api/)
10
+ ## 特徴
12
11
 
13
- ## Installation
12
+ - 🔗 **メソッドチェーン対応**: 直感的な fluent interface で API を操作
13
+ - 🌐 **マルチ環境対応**: Node.js とブラウザの両方で動作
14
+ - 📝 **TypeScript 完全対応**: 型安全性と IntelliSense サポート
15
+ - 🔀 **デュアル実装**: fetch (Node.js) と JSONP (ブラウザ) を自動選択
16
+ - 📚 **全 API カバー**: なろうデベロッパーの全 API に対応
14
17
 
15
- 以下のコマンドでインストールできます。
18
+ ## 🚀 対応 API
16
19
 
17
- ```
20
+ | API | 説明 | 関数 |
21
+ |-----|------|------|
22
+ | [なろう小説 API](https://dev.syosetu.com/man/api/) | 小説の検索・絞り込み | `search()` |
23
+ | [なろう小説ランキング API](https://dev.syosetu.com/man/rankapi/) | ランキング取得 | `ranking()` |
24
+ | [なろう殿堂入り API](https://dev.syosetu.com/man/rankinapi/) | ランキング履歴取得 | `rankingHistory()` |
25
+ | [なろう R18 小説 API](https://dev.syosetu.com/xman/api/) | 18禁小説検索 | `searchR18()` |
26
+ | [なろうユーザ検索 API](https://dev.syosetu.com/man/userapi/) | ユーザー検索 | `searchUser()` |
27
+
28
+ ## 📦 インストール
29
+
30
+ ```bash
31
+ # 推奨: pnpm
32
+ pnpm add narou
33
+
34
+ # または
18
35
  npm install narou
36
+ yarn add narou
37
+ ```
38
+
39
+ ## 🚀 クイックスタート
40
+
41
+ ### Node.js での使用
42
+
43
+ ```typescript
44
+ import { search, ranking } from "narou";
45
+ import { Genre, Order, RankingType } from "narou";
46
+
47
+ // 異世界恋愛小説を検索
48
+ const result = await search("異世界")
49
+ .genre(Genre.RenaiIsekai)
50
+ .order(Order.FavoriteNovelCount)
51
+ .limit(10)
52
+ .execute();
53
+
54
+ console.log(`${result.allcount}件の小説が見つかりました`);
19
55
  ```
20
56
 
21
- ## Usage - API
57
+ ### ブラウザでの使用
22
58
 
23
- https://deflis.github.io/node-narou/ を参照してください。
59
+ ```typescript
60
+ // ブラウザでは専用のインポートを使用(JSONP対応)
61
+ import { search } from "narou/browser";
24
62
 
25
- ブラウザで利用したい場合 `narou/browser` をimportしてください。こちらを利用することで自動的にfetch(nodejs)への依存がなくなり、JSONPを利用するようになります。
63
+ const result = await search("魔法").execute();
64
+ ```
26
65
 
27
- すでにサポート終了していますがfetchをサポートしないNode.jsバージョンで利用する場合は `NarouNovelFetch` にfetchのNode.js実装を渡してください。
28
- なお、その場合の動作は確認していないので動かなければIssueを立ててください。
66
+ ## 📖 詳細な API ドキュメント
29
67
 
68
+ - **🔗 [完全な API ドキュメント](https://deflis.github.io/node-narou/)** - TypeDoc で生成された詳細なドキュメント
69
+ - **🤖 [LLM 向けドキュメント](https://deflis.github.io/node-narou/llms.txt)** - AI/LLM が理解しやすい形式のドキュメント(TypeDoc JSON から自動生成)
30
70
 
31
- ## Example
71
+ ## 📝 使用例
32
72
 
33
73
  ```typescript
34
74
  import { search, ranking, rankingHistory, searchR18 } from "narou";
@@ -108,32 +148,35 @@ for (const novel of searchR18Result.values) {
108
148
  }
109
149
  ```
110
150
 
111
- ## Development
112
-
113
- ```
114
-
115
- # watch
151
+ ## 🛠️ 開発
116
152
 
117
- npm run watch
153
+ このプロジェクトでは pnpm を使用しています。
118
154
 
119
- # build
155
+ ```bash
156
+ # 依存関係のインストール
157
+ pnpm install
120
158
 
121
- npm run build
159
+ # ビルド
160
+ pnpm run build
122
161
 
123
- # test
162
+ # テスト実行
163
+ pnpm run test
124
164
 
125
- npm run test
165
+ # 型チェック
166
+ pnpm run check
126
167
 
168
+ # ドキュメント生成(TypeDoc + llms.txt)
169
+ pnpm run docs
127
170
  ```
128
171
 
129
- ## Contributing
172
+ ## 🤝 コントリビューション
130
173
 
131
- 1. Fork it!
132
- 2. Create your feature branch: `git checkout -b my-new-feature`
133
- 3. Commit your changes: `git commit -am 'Add some feature'`
134
- 4. Push to the branch: `git push origin my-new-feature`
135
- 5. Submit a pull request :D
174
+ 1. このリポジトリをフォーク
175
+ 2. フィーチャーブランチを作成: `git checkout -b my-new-feature`
176
+ 3. 変更をコミット: `git commit -am 'Add some feature'`
177
+ 4. ブランチにプッシュ: `git push origin my-new-feature`
178
+ 5. プルリクエストを作成
136
179
 
137
- ## License
180
+ ## 📄 ライセンス
138
181
 
139
- MIT
182
+ MIT License - 詳細は [LICENSE](LICENSE) ファイルを参照してください。