narou 0.8.0 → 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 (130) 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 +40 -36
  19. package/dist/index.browser.js +127 -83
  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 +74 -35
  25. package/dist/index.d.cts +47 -0
  26. package/dist/index.d.ts +47 -43
  27. package/dist/index.js +132 -91
  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 +16 -13
  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 +13 -10
  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 +11 -63
  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 +39 -247
  56. package/dist/ranking-history.cjs +38 -0
  57. package/dist/ranking-history.d.cts +17 -0
  58. package/dist/ranking-history.d.ts +17 -14
  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 +47 -46
  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 +32 -29
  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/user-search.d.cts +66 -0
  74. package/dist/user-search.d.ts +66 -63
  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 +13 -17
  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/user-search.ts +109 -109
  96. package/src/util/unzipp.ts +13 -3
  97. package/dist/index.browser.d.ts.map +0 -1
  98. package/dist/index.browser.js.map +0 -1
  99. package/dist/index.common.d.ts.map +0 -1
  100. package/dist/index.common.js.map +0 -1
  101. package/dist/index.d.ts.map +0 -1
  102. package/dist/index.js.map +0 -1
  103. package/dist/narou-fetch.d.ts.map +0 -1
  104. package/dist/narou-fetch.js.map +0 -1
  105. package/dist/narou-jsonp.d.ts.map +0 -1
  106. package/dist/narou-jsonp.js.map +0 -1
  107. package/dist/narou-ranking-results.d.ts.map +0 -1
  108. package/dist/narou-ranking-results.js.map +0 -1
  109. package/dist/narou-search-results.d.ts.map +0 -1
  110. package/dist/narou-search-results.js.map +0 -1
  111. package/dist/narou.d.ts.map +0 -1
  112. package/dist/narou.js.map +0 -1
  113. package/dist/params.d.ts.map +0 -1
  114. package/dist/params.js.map +0 -1
  115. package/dist/ranking-history.d.ts.map +0 -1
  116. package/dist/ranking-history.js.map +0 -1
  117. package/dist/ranking.d.ts.map +0 -1
  118. package/dist/ranking.js.map +0 -1
  119. package/dist/search-builder-r18.d.ts.map +0 -1
  120. package/dist/search-builder-r18.js.map +0 -1
  121. package/dist/search-builder.d.ts.map +0 -1
  122. package/dist/search-builder.js.map +0 -1
  123. package/dist/user-search.d.ts.map +0 -1
  124. package/dist/user-search.js.map +0 -1
  125. package/dist/util/jsonp.d.ts.map +0 -1
  126. package/dist/util/jsonp.js.map +0 -1
  127. package/dist/util/type.d.ts.map +0 -1
  128. package/dist/util/type.js.map +0 -1
  129. package/dist/util/unzipp.d.ts.map +0 -1
  130. package/dist/util/unzipp.js.map +0 -1
@@ -0,0 +1,47 @@
1
+ import { N as NarouNovel, b as NarouRankingResult, R as RankingResult, D as DefaultSearchResultFields } from './narou-98ededc8.js';
2
+ import { b as RankingParams, R as RankingType, q as GzipLevel, F as Fields, u as SearchResultFields, O as OptionalFields } from './narou-search-results-6727b1ce.js';
3
+ import './ranking-history.cjs';
4
+ import './util/type.cjs';
5
+
6
+ /**
7
+ * ランキングヘルパー
8
+ * @class Ranking
9
+ */
10
+ declare class RankingBuilder {
11
+ protected params: Partial<RankingParams>;
12
+ protected api: NarouNovel;
13
+ protected date$: Date;
14
+ protected type$: RankingType;
15
+ /**
16
+ * constructor
17
+ * @private
18
+ */
19
+ constructor(params: Partial<RankingParams>, api: NarouNovel);
20
+ date(date: Date): this;
21
+ type(type: RankingType): this;
22
+ /**
23
+ * gzip圧縮する。
24
+ *
25
+ * 転送量上限を減らすためにも推奨
26
+ * @param {GzipLevel} level gzip圧縮レベル(1~5)
27
+ * @return {RankingBuilder} this
28
+ */
29
+ gzip(level: GzipLevel): this;
30
+ /**
31
+ * クエリパラメータをセットする
32
+ * @private
33
+ * @return {RankingBuilder} this
34
+ */
35
+ protected set(obj: Partial<RankingParams>): this;
36
+ /**
37
+ * なろう小説APIへのリクエストを実行する
38
+ * @returns ランキング
39
+ */
40
+ execute(): Promise<NarouRankingResult[]>;
41
+ executeWithFields(): Promise<RankingResult<DefaultSearchResultFields>[]>;
42
+ executeWithFields<TFields extends Fields>(fields: TFields | TFields[]): Promise<RankingResult<SearchResultFields<TFields>>[]>;
43
+ executeWithFields(fields: never[], opt: OptionalFields | OptionalFields[]): Promise<RankingResult<DefaultSearchResultFields | "weekly_unique">[]>;
44
+ executeWithFields<TFields extends Fields>(fields: TFields | TFields[], opt: OptionalFields | OptionalFields[]): Promise<RankingResult<SearchResultFields<TFields> | "weekly_unique">[]>;
45
+ }
46
+
47
+ export { RankingBuilder as default };
package/dist/ranking.d.ts CHANGED
@@ -1,46 +1,47 @@
1
- import { NarouRankingResult, RankingResult } from "./narou-ranking-results";
2
- import { DefaultSearchResultFields } from "./search-builder";
3
- import { Fields, GzipLevel, OptionalFields, RankingParams, RankingType } from "./params";
4
- import NarouNovel from "./narou";
5
- import { SearchResultFields } from "./narou-search-results";
6
- /**
7
- * ランキングヘルパー
8
- * @class Ranking
9
- */
10
- export default class RankingBuilder {
11
- protected params: Partial<RankingParams>;
12
- protected api: NarouNovel;
13
- protected date$: Date;
14
- protected type$: RankingType;
15
- /**
16
- * constructor
17
- * @private
18
- */
19
- constructor(params: Partial<RankingParams>, api: NarouNovel);
20
- date(date: Date): this;
21
- type(type: RankingType): this;
22
- /**
23
- * gzip圧縮する。
24
- *
25
- * 転送量上限を減らすためにも推奨
26
- * @param {GzipLevel} level gzip圧縮レベル(1~5)
27
- * @return {RankingBuilder} this
28
- */
29
- gzip(level: GzipLevel): this;
30
- /**
31
- * クエリパラメータをセットする
32
- * @private
33
- * @return {RankingBuilder} this
34
- */
35
- protected set(obj: Partial<RankingParams>): this;
36
- /**
37
- * なろう小説APIへのリクエストを実行する
38
- * @returns ランキング
39
- */
40
- execute(): Promise<NarouRankingResult[]>;
41
- executeWithFields(): Promise<RankingResult<DefaultSearchResultFields>[]>;
42
- executeWithFields<TFields extends Fields>(fields: TFields | TFields[]): Promise<RankingResult<SearchResultFields<TFields>>[]>;
43
- executeWithFields(fields: never[], opt: OptionalFields | OptionalFields[]): Promise<RankingResult<DefaultSearchResultFields | "weekly_unique">[]>;
44
- executeWithFields<TFields extends Fields>(fields: TFields | TFields[], opt: OptionalFields | OptionalFields[]): Promise<RankingResult<SearchResultFields<TFields> | "weekly_unique">[]>;
45
- }
46
- //# sourceMappingURL=ranking.d.ts.map
1
+ import { N as NarouNovel, b as NarouRankingResult, R as RankingResult, D as DefaultSearchResultFields } from './narou-61329eea.js';
2
+ import { b as RankingParams, R as RankingType, q as GzipLevel, F as Fields, u as SearchResultFields, O as OptionalFields } from './narou-search-results-b7c10db0.js';
3
+ import './ranking-history.js';
4
+ import './util/type.js';
5
+
6
+ /**
7
+ * ランキングヘルパー
8
+ * @class Ranking
9
+ */
10
+ declare class RankingBuilder {
11
+ protected params: Partial<RankingParams>;
12
+ protected api: NarouNovel;
13
+ protected date$: Date;
14
+ protected type$: RankingType;
15
+ /**
16
+ * constructor
17
+ * @private
18
+ */
19
+ constructor(params: Partial<RankingParams>, api: NarouNovel);
20
+ date(date: Date): this;
21
+ type(type: RankingType): this;
22
+ /**
23
+ * gzip圧縮する。
24
+ *
25
+ * 転送量上限を減らすためにも推奨
26
+ * @param {GzipLevel} level gzip圧縮レベル(1~5)
27
+ * @return {RankingBuilder} this
28
+ */
29
+ gzip(level: GzipLevel): this;
30
+ /**
31
+ * クエリパラメータをセットする
32
+ * @private
33
+ * @return {RankingBuilder} this
34
+ */
35
+ protected set(obj: Partial<RankingParams>): this;
36
+ /**
37
+ * なろう小説APIへのリクエストを実行する
38
+ * @returns ランキング
39
+ */
40
+ execute(): Promise<NarouRankingResult[]>;
41
+ executeWithFields(): Promise<RankingResult<DefaultSearchResultFields>[]>;
42
+ executeWithFields<TFields extends Fields>(fields: TFields | TFields[]): Promise<RankingResult<SearchResultFields<TFields>>[]>;
43
+ executeWithFields(fields: never[], opt: OptionalFields | OptionalFields[]): Promise<RankingResult<DefaultSearchResultFields | "weekly_unique">[]>;
44
+ executeWithFields<TFields extends Fields>(fields: TFields | TFields[], opt: OptionalFields | OptionalFields[]): Promise<RankingResult<SearchResultFields<TFields> | "weekly_unique">[]>;
45
+ }
46
+
47
+ export { RankingBuilder as default };
package/dist/ranking.js CHANGED
@@ -1,87 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const search_builder_1 = require("./search-builder");
4
- const date_fns_1 = require("date-fns");
5
- const params_1 = require("./params");
6
- const dateFormat = "yyyyMMdd";
7
- /**
8
- * ランキングヘルパー
9
- * @class Ranking
10
- */
11
- class RankingBuilder {
12
- /**
13
- * constructor
14
- * @private
15
- */
16
- constructor(params = {}, api) {
17
- this.params = params;
18
- this.api = api;
19
- /**
20
- * クエリパラメータ
21
- * @protected
22
- */
23
- this.date$ = (0, date_fns_1.addDays)(Date.now(), -1);
24
- this.type$ = params_1.RankingType.Daily;
25
- }
26
- date(date) {
27
- this.date$ = date;
28
- return this;
29
- }
30
- type(type) {
31
- this.type$ = type;
32
- return this;
33
- }
34
- /**
35
- * gzip圧縮する。
36
- *
37
- * 転送量上限を減らすためにも推奨
38
- * @param {GzipLevel} level gzip圧縮レベル(1~5)
39
- * @return {RankingBuilder} this
40
- */
41
- gzip(level) {
42
- this.set({ gzip: level });
43
- return this;
44
- }
45
- /**
46
- * クエリパラメータをセットする
47
- * @private
48
- * @return {RankingBuilder} this
49
- */
50
- set(obj) {
51
- Object.assign(this.params, obj);
52
- return this;
53
- }
54
- /**
55
- * なろう小説APIへのリクエストを実行する
56
- * @returns ランキング
57
- */
58
- execute() {
59
- const date = (0, date_fns_1.format)(this.date$, dateFormat);
60
- this.set({ rtype: `${date}-${this.type$}` });
61
- return this.api.executeRanking(this.params);
62
- }
63
- async executeWithFields(fields = [], opt) {
64
- const ranking = await this.execute();
65
- const fields$ = Array.isArray(fields)
66
- ? fields.length == 0
67
- ? []
68
- : [...fields, params_1.Fields.ncode]
69
- : [fields, params_1.Fields.ncode];
70
- const rankingNcodes = ranking.map(({ ncode }) => ncode);
71
- const builder = new search_builder_1.default({}, this.api);
72
- builder.fields(fields$);
73
- if (opt) {
74
- builder.opt(opt);
75
- }
76
- builder.ncode(rankingNcodes);
77
- builder.limit(ranking.length);
78
- const result = await builder.execute();
79
- return ranking.map((r) => ({
80
- ...r,
81
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
82
- ...result.values.find((novel) => novel.ncode == r.ncode),
83
- }));
84
- }
85
- }
86
- exports.default = RankingBuilder;
87
- //# sourceMappingURL=ranking.js.map
1
+ import {
2
+ RankingBuilder
3
+ } from "./chunk-67BSHN66.js";
4
+ import "./chunk-IVQKYEQQ.js";
5
+ import "./chunk-U3H4E2XZ.js";
6
+ import "./chunk-IKR7OZGM.js";
7
+ export {
8
+ RankingBuilder as default
9
+ };
@@ -0,0 +1,473 @@
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/search-builder-r18.ts
21
+ var search_builder_r18_exports = {};
22
+ __export(search_builder_r18_exports, {
23
+ default: () => SearchBuilderR18
24
+ });
25
+ module.exports = __toCommonJS(search_builder_r18_exports);
26
+
27
+ // src/params.ts
28
+ var BooleanNumber = {
29
+ True: 1,
30
+ False: 0
31
+ };
32
+ var R18Site = {
33
+ /** ノクターンノベルズ(男性向け) */
34
+ Nocturne: 1,
35
+ /** ムーンライトノベルズ(女性向け) */
36
+ MoonLight: 2,
37
+ /** ムーンライトノベルズ(BL) */
38
+ MoonLightBL: 3,
39
+ /** ミッドナイトノベルズ(大人向け) */
40
+ Midnight: 4
41
+ };
42
+ var R18SiteNotation = {
43
+ [R18Site.Nocturne]: "\u30CE\u30AF\u30BF\u30FC\u30F3\u30CE\u30D9\u30EB\u30BA(\u7537\u6027\u5411\u3051)",
44
+ [R18Site.MoonLight]: "\u30E0\u30FC\u30F3\u30E9\u30A4\u30C8\u30CE\u30D9\u30EB\u30BA(\u5973\u6027\u5411\u3051)",
45
+ [R18Site.MoonLightBL]: "\u30E0\u30FC\u30F3\u30E9\u30A4\u30C8\u30CE\u30D9\u30EB\u30BA(BL)",
46
+ [R18Site.Midnight]: "\u30DF\u30C3\u30C9\u30CA\u30A4\u30C8\u30CE\u30D9\u30EB\u30BA(\u5927\u4EBA\u5411\u3051)"
47
+ };
48
+ var BigGenre = {
49
+ /** 恋愛 */
50
+ Renai: 1,
51
+ /** ファンタジー */
52
+ Fantasy: 2,
53
+ /** 文芸 */
54
+ Bungei: 3,
55
+ /** SF */
56
+ Sf: 4,
57
+ /** その他 */
58
+ Sonota: 99,
59
+ /** ノンジャンル */
60
+ NonGenre: 98
61
+ };
62
+ var BigGenreNotation = {
63
+ [BigGenre.Renai]: "\u604B\u611B",
64
+ [BigGenre.Fantasy]: "\u30D5\u30A1\u30F3\u30BF\u30B8\u30FC",
65
+ [BigGenre.Bungei]: "\u6587\u82B8",
66
+ [BigGenre.Sf]: "SF",
67
+ [BigGenre.Sonota]: "\u305D\u306E\u4ED6",
68
+ [BigGenre.NonGenre]: "\u30CE\u30F3\u30B8\u30E3\u30F3\u30EB"
69
+ };
70
+ var Genre = {
71
+ /** 異世界〔恋愛〕*/
72
+ RenaiIsekai: 101,
73
+ /** 現実世界〔恋愛〕*/
74
+ RenaiGenjitsusekai: 102,
75
+ /** ハイファンタジー〔ファンタジー〕*/
76
+ FantasyHigh: 201,
77
+ /** ローファンタジー〔ファンタジー〕*/
78
+ FantasyLow: 202,
79
+ /** 純文学〔文芸〕*/
80
+ BungeiJyunbungei: 301,
81
+ /** ヒューマンドラマ〔文芸〕*/
82
+ BungeiHumanDrama: 302,
83
+ /** 歴史〔文芸〕*/
84
+ BungeiHistory: 303,
85
+ /** 推理〔文芸〕*/
86
+ BungeiSuiri: 304,
87
+ /** ホラー〔文芸〕*/
88
+ BungeiHorror: 305,
89
+ /** アクション〔文芸〕*/
90
+ BungeiAction: 306,
91
+ /** コメディー〔文芸〕*/
92
+ BungeiComedy: 307,
93
+ /** VRゲーム〔SF〕*/
94
+ SfVrgame: 401,
95
+ /** 宇宙〔SF〕*/
96
+ SfSpace: 402,
97
+ /** 空想科学〔SF〕*/
98
+ SfKuusoukagaku: 403,
99
+ /** パニック〔SF〕*/
100
+ SfPanic: 404,
101
+ /** 童話〔その他〕*/
102
+ SonotaDouwa: 9901,
103
+ /** 詩〔その他〕*/
104
+ SonotaShi: 9902,
105
+ /** エッセイ〔その他〕*/
106
+ SonotaEssei: 9903,
107
+ /** リプレイ〔その他〕*/
108
+ SonotaReplay: 9904,
109
+ /** その他〔その他〕 */
110
+ SonotaSonota: 9999,
111
+ /** ノンジャンル〔ノンジャンル〕*/
112
+ NonGenre: 9801
113
+ };
114
+ var GenreNotation = {
115
+ [Genre.RenaiIsekai]: "\u7570\u4E16\u754C\u3014\u604B\u611B\u3015",
116
+ [Genre.RenaiGenjitsusekai]: "\u73FE\u5B9F\u4E16\u754C\u3014\u604B\u611B\u3015",
117
+ [Genre.FantasyHigh]: "\u30CF\u30A4\u30D5\u30A1\u30F3\u30BF\u30B8\u30FC\u3014\u30D5\u30A1\u30F3\u30BF\u30B8\u30FC\u3015",
118
+ [Genre.FantasyLow]: "\u30ED\u30FC\u30D5\u30A1\u30F3\u30BF\u30B8\u30FC\u3014\u30D5\u30A1\u30F3\u30BF\u30B8\u30FC\u3015",
119
+ [Genre.BungeiJyunbungei]: "\u7D14\u6587\u5B66\u3014\u6587\u82B8\u3015",
120
+ [Genre.BungeiHumanDrama]: "\u30D2\u30E5\u30FC\u30DE\u30F3\u30C9\u30E9\u30DE\u3014\u6587\u82B8\u3015",
121
+ [Genre.BungeiHistory]: "\u6B74\u53F2\u3014\u6587\u82B8\u3015",
122
+ [Genre.BungeiSuiri]: "\u63A8\u7406\u3014\u6587\u82B8\u3015",
123
+ [Genre.BungeiHorror]: "\u30DB\u30E9\u30FC\u3014\u6587\u82B8\u3015",
124
+ [Genre.BungeiAction]: "\u30A2\u30AF\u30B7\u30E7\u30F3\u3014\u6587\u82B8\u3015",
125
+ [Genre.BungeiComedy]: "\u30B3\u30E1\u30C7\u30A3\u30FC\u3014\u6587\u82B8\u3015",
126
+ [Genre.SfVrgame]: "VR\u30B2\u30FC\u30E0\u3014SF\u3015",
127
+ [Genre.SfSpace]: "\u5B87\u5B99\u3014SF\u3015",
128
+ [Genre.SfKuusoukagaku]: "\u7A7A\u60F3\u79D1\u5B66\u3014SF\u3015",
129
+ [Genre.SfPanic]: "\u30D1\u30CB\u30C3\u30AF\u3014SF\u3015",
130
+ [Genre.SonotaDouwa]: "\u7AE5\u8A71\u3014\u305D\u306E\u4ED6\u3015",
131
+ [Genre.SonotaShi]: "\u8A69\u3014\u305D\u306E\u4ED6\u3015",
132
+ [Genre.SonotaEssei]: "\u30A8\u30C3\u30BB\u30A4\u3014\u305D\u306E\u4ED6\u3015",
133
+ [Genre.SonotaReplay]: "\u30EA\u30D7\u30EC\u30A4\u3014\u305D\u306E\u4ED6\u3015",
134
+ [Genre.SonotaSonota]: "\u305D\u306E\u4ED6\u3014\u305D\u306E\u4ED6\u3015",
135
+ [Genre.NonGenre]: "\u30CE\u30F3\u30B8\u30E3\u30F3\u30EB\u3014\u30CE\u30F3\u30B8\u30E3\u30F3\u30EB\u3015"
136
+ };
137
+ var StopParam = {
138
+ /** 長期連載停止中を除きます */
139
+ NoStopping: 1,
140
+ /** 長期連載停止中のみ取得します */
141
+ Stopping: 2
142
+ };
143
+
144
+ // src/search-builder.ts
145
+ var SearchBuilderBase = class {
146
+ /**
147
+ * constructor
148
+ * @private
149
+ */
150
+ constructor(params = {}, api) {
151
+ this.params = params;
152
+ this.api = api;
153
+ }
154
+ static distinct(array) {
155
+ return Array.from(new Set(array));
156
+ }
157
+ static array2string(n) {
158
+ if (Array.isArray(n)) {
159
+ return this.distinct(n).join("-");
160
+ } else {
161
+ return n.toString();
162
+ }
163
+ }
164
+ /**
165
+ *
166
+ * @return {SearchBuilder} this
167
+ */
168
+ limit(num) {
169
+ this.set({ lim: num });
170
+ return this;
171
+ }
172
+ /**
173
+ *
174
+ * @return {SearchBuilder} this
175
+ */
176
+ start(num) {
177
+ this.set({ st: num });
178
+ return this;
179
+ }
180
+ /**
181
+ *
182
+ * @return {SearchBuilder} this
183
+ */
184
+ page(no, count = 20) {
185
+ return this.limit(count).start(no * count);
186
+ }
187
+ /**
188
+ * 出力順序を指定する。指定しない場合は新着順となります。
189
+ * old 古い順
190
+ * @param {TOrder} order 出力順序
191
+ * @return {SearchBuilder} this
192
+ */
193
+ order(order) {
194
+ this.set({ order });
195
+ return this;
196
+ }
197
+ /**
198
+ * gzip圧縮する。
199
+ *
200
+ * 転送量上限を減らすためにも推奨
201
+ * @param {GzipLevel} level gzip圧縮レベル(1~5)
202
+ * @return {SearchBuilder} this
203
+ */
204
+ gzip(level) {
205
+ this.set({ gzip: level });
206
+ return this;
207
+ }
208
+ /**
209
+ * クエリパラメータをセットする
210
+ * @private
211
+ * @return {SearchBuilder} this
212
+ */
213
+ set(obj) {
214
+ this.params = { ...this.params, ...obj };
215
+ return this;
216
+ }
217
+ /**
218
+ * クエリパラメータを削除する
219
+ */
220
+ unset(key) {
221
+ delete this.params[key];
222
+ return this;
223
+ }
224
+ };
225
+ var NovelSearchBuilderBase = class _NovelSearchBuilderBase extends SearchBuilderBase {
226
+ /**
227
+ * a
228
+ * @return {SearchBuilder} this
229
+ */
230
+ word(word) {
231
+ this.set({ word });
232
+ return this;
233
+ }
234
+ /**
235
+ *
236
+ * @return {SearchBuilder} this
237
+ */
238
+ notWord(word) {
239
+ this.set({ notword: word });
240
+ return this;
241
+ }
242
+ /**
243
+ *
244
+ * @return {SearchBuilder} this
245
+ */
246
+ byTitle(bool = true) {
247
+ this.set({ title: bool ? BooleanNumber.True : BooleanNumber.False });
248
+ return this;
249
+ }
250
+ /**
251
+ *
252
+ * @return {SearchBuilder} this
253
+ */
254
+ byOutline(bool = true) {
255
+ this.set({ ex: bool ? BooleanNumber.True : BooleanNumber.False });
256
+ return this;
257
+ }
258
+ /**
259
+ *
260
+ * @return {SearchBuilder} this
261
+ */
262
+ byKeyword(bool = true) {
263
+ this.set({ keyword: bool ? BooleanNumber.True : BooleanNumber.False });
264
+ return this;
265
+ }
266
+ /**
267
+ *
268
+ * @return {SearchBuilder} this
269
+ */
270
+ byAuthor(bool = true) {
271
+ this.set({ wname: bool ? BooleanNumber.True : BooleanNumber.False });
272
+ return this;
273
+ }
274
+ /**
275
+ *
276
+ * @return {SearchBuilder} this
277
+ */
278
+ isBL(bool = true) {
279
+ if (bool) {
280
+ this.set({ isbl: BooleanNumber.True });
281
+ } else {
282
+ this.set({ notbl: BooleanNumber.True });
283
+ }
284
+ return this;
285
+ }
286
+ /**
287
+ *
288
+ * @return {SearchBuilder} this
289
+ */
290
+ isGL(bool = true) {
291
+ if (bool) {
292
+ this.set({ isgl: BooleanNumber.True });
293
+ } else {
294
+ this.set({ notgl: BooleanNumber.True });
295
+ }
296
+ return this;
297
+ }
298
+ /**
299
+ *
300
+ * @return {SearchBuilder} this
301
+ */
302
+ isZankoku(bool = true) {
303
+ if (bool) {
304
+ this.set({ iszankoku: BooleanNumber.True });
305
+ } else {
306
+ this.set({ notzankoku: BooleanNumber.True });
307
+ }
308
+ return this;
309
+ }
310
+ /**
311
+ *
312
+ * @return {SearchBuilder} this
313
+ */
314
+ isTensei(bool = true) {
315
+ if (bool) {
316
+ this.set({ istensei: BooleanNumber.True });
317
+ } else {
318
+ this.set({ nottensei: BooleanNumber.True });
319
+ }
320
+ return this;
321
+ }
322
+ /**
323
+ *
324
+ * @return {SearchBuilder} this
325
+ */
326
+ isTenni(bool = true) {
327
+ if (bool) {
328
+ this.set({ istenni: BooleanNumber.True });
329
+ } else {
330
+ this.set({ nottenni: BooleanNumber.True });
331
+ }
332
+ return this;
333
+ }
334
+ /**
335
+ *
336
+ * @return {SearchBuilder} this
337
+ */
338
+ isTT() {
339
+ this.set({ istt: BooleanNumber.True });
340
+ return this;
341
+ }
342
+ /**
343
+ *
344
+ * @return {SearchBuilder} this
345
+ */
346
+ length(length) {
347
+ this.set({ length: _NovelSearchBuilderBase.array2string(length) });
348
+ return this;
349
+ }
350
+ kaiwaritu(min, max) {
351
+ let n;
352
+ if (max != null) {
353
+ n = `${min}-${max}`;
354
+ } else {
355
+ n = min;
356
+ }
357
+ this.set({ kaiwaritu: n });
358
+ return this;
359
+ }
360
+ /**
361
+ *
362
+ * @return {SearchBuilder} this
363
+ */
364
+ sasie(num) {
365
+ this.set({ sasie: _NovelSearchBuilderBase.array2string(num) });
366
+ return this;
367
+ }
368
+ /**
369
+ *
370
+ * @return {SearchBuilder} this
371
+ */
372
+ time(num) {
373
+ this.set({ time: _NovelSearchBuilderBase.array2string(num) });
374
+ return this;
375
+ }
376
+ /**
377
+ *
378
+ * @return {SearchBuilder} this
379
+ */
380
+ ncode(ncodes) {
381
+ this.set({ ncode: _NovelSearchBuilderBase.array2string(ncodes) });
382
+ return this;
383
+ }
384
+ /**
385
+ *
386
+ * @return {SearchBuilder} this
387
+ */
388
+ type(type) {
389
+ this.set({ type });
390
+ return this;
391
+ }
392
+ /**
393
+ *
394
+ * @return {SearchBuilder} this
395
+ */
396
+ buntai(buntai) {
397
+ this.set({ buntai: _NovelSearchBuilderBase.array2string(buntai) });
398
+ return this;
399
+ }
400
+ /**
401
+ *
402
+ * @return {SearchBuilder} this
403
+ */
404
+ isStop(bool = true) {
405
+ this.set({ stop: bool ? StopParam.Stopping : StopParam.NoStopping });
406
+ return this;
407
+ }
408
+ /**
409
+ *
410
+ * @return {SearchBuilder} this
411
+ */
412
+ isPickup(bool = true) {
413
+ this.set({ ispickup: bool ? BooleanNumber.True : BooleanNumber.False });
414
+ return this;
415
+ }
416
+ lastUpdate(x, y) {
417
+ let date;
418
+ if (typeof x == "string") {
419
+ date = x;
420
+ } else if (x instanceof Date && y instanceof Date) {
421
+ date = `${Math.floor(x.getTime() / 1e3)}-${Math.floor(
422
+ x.getTime() / 1e3
423
+ )}`;
424
+ } else {
425
+ date = `${x}-${y}`;
426
+ }
427
+ this.set({ lastup: date });
428
+ return this;
429
+ }
430
+ /**
431
+ * なろう小説APIへの検索リクエストを実行する
432
+ * @returns {Promise<NarouSearchResults>} 検索結果
433
+ */
434
+ execute() {
435
+ return this.api.executeNovel(this.params);
436
+ }
437
+ };
438
+
439
+ // src/search-builder-r18.ts
440
+ var SearchBuilderR18 = class extends NovelSearchBuilderBase {
441
+ /**
442
+ * なろう小説APIへの検索リクエストを実行する
443
+ * @override
444
+ * @returns {Promise<NarouSearchResults>} 検索結果
445
+ */
446
+ execute() {
447
+ return this.api.executeNovel18(this.params);
448
+ }
449
+ r18Site(sites) {
450
+ this.set({ nocgenre: NovelSearchBuilderBase.array2string(sites) });
451
+ return this;
452
+ }
453
+ /**
454
+ *
455
+ * @return {SearchBuilder} this
456
+ */
457
+ xid(ids) {
458
+ this.set({ xid: NovelSearchBuilderBase.array2string(ids) });
459
+ return this;
460
+ }
461
+ /**
462
+ *
463
+ * @return {SearchBuilder} this
464
+ */
465
+ fields(fields) {
466
+ this.set({ of: NovelSearchBuilderBase.array2string(fields) });
467
+ return this;
468
+ }
469
+ opt(option) {
470
+ this.set({ opt: NovelSearchBuilderBase.array2string(option) });
471
+ return this;
472
+ }
473
+ };