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.
- package/dist/chunk-3UZPHZZH.js +43 -0
- package/dist/chunk-46WN4HIZ.js +25 -0
- package/dist/chunk-55V5YY6H.js +71 -0
- package/dist/chunk-5OZA6DNS.js +14 -0
- package/dist/chunk-67BSHN66.js +82 -0
- package/dist/chunk-6SHYBHWX.js +0 -0
- package/dist/chunk-AIRK7Y7G.js +0 -0
- package/dist/chunk-C54MSVRN.js +3064 -0
- package/dist/chunk-EQL67JCA.js +38 -0
- package/dist/chunk-IKR7OZGM.js +49 -0
- package/dist/chunk-IVQKYEQQ.js +371 -0
- package/dist/chunk-JFVJBECE.js +36 -0
- package/dist/chunk-JS5XPNGB.js +93 -0
- package/dist/chunk-OVGZ6RWT.js +23 -0
- package/dist/chunk-U3H4E2XZ.js +396 -0
- package/dist/index.browser.cjs +1221 -0
- package/dist/index.browser.d.cts +40 -0
- package/dist/index.browser.d.ts +40 -36
- package/dist/index.browser.js +127 -83
- package/dist/index.cjs +4305 -0
- package/dist/index.common.cjs +1032 -0
- package/dist/index.common.d.cts +6 -0
- package/dist/index.common.d.ts +6 -15
- package/dist/index.common.js +74 -35
- package/dist/index.d.cts +47 -0
- package/dist/index.d.ts +47 -43
- package/dist/index.js +132 -91
- package/dist/narou-61329eea.d.ts +298 -0
- package/dist/narou-98ededc8.d.ts +298 -0
- package/dist/narou-fetch.cjs +3190 -0
- package/dist/narou-fetch.d.cts +16 -0
- package/dist/narou-fetch.d.ts +16 -13
- package/dist/narou-fetch.js +10 -46
- package/dist/narou-jsonp.cjs +158 -0
- package/dist/narou-jsonp.d.cts +13 -0
- package/dist/narou-jsonp.d.ts +13 -10
- package/dist/narou-jsonp.js +10 -24
- package/dist/narou-ranking-results.cjs +18 -0
- package/dist/narou-ranking-results.d.cts +4 -0
- package/dist/narou-ranking-results.d.ts +4 -10
- package/dist/narou-ranking-results.js +1 -3
- package/dist/narou-search-results-6727b1ce.d.ts +716 -0
- package/dist/narou-search-results-b7c10db0.d.ts +716 -0
- package/dist/narou-search-results.cjs +61 -0
- package/dist/narou-search-results.d.cts +2 -0
- package/dist/narou-search-results.d.ts +2 -131
- package/dist/narou-search-results.js +11 -63
- package/dist/narou.cjs +108 -0
- package/dist/narou.d.cts +4 -0
- package/dist/narou.d.ts +4 -26
- package/dist/narou.js +8 -30
- package/dist/params.cjs +436 -0
- package/dist/params.d.cts +2 -0
- package/dist/params.d.ts +2 -324
- package/dist/params.js +39 -247
- package/dist/ranking-history.cjs +38 -0
- package/dist/ranking-history.d.cts +17 -0
- package/dist/ranking-history.d.ts +17 -14
- package/dist/ranking-history.js +7 -14
- package/dist/ranking.cjs +659 -0
- package/dist/ranking.d.cts +47 -0
- package/dist/ranking.d.ts +47 -46
- package/dist/ranking.js +9 -87
- package/dist/search-builder-r18.cjs +473 -0
- package/dist/search-builder-r18.d.cts +32 -0
- package/dist/search-builder-r18.d.ts +32 -29
- package/dist/search-builder-r18.js +9 -45
- package/dist/search-builder.cjs +510 -0
- package/dist/search-builder.d.cts +4 -0
- package/dist/search-builder.d.ts +4 -220
- package/dist/search-builder.js +12 -381
- package/dist/user-search.cjs +300 -0
- package/dist/user-search.d.cts +66 -0
- package/dist/user-search.d.ts +66 -63
- package/dist/user-search.js +9 -94
- package/dist/util/jsonp.cjs +62 -0
- package/dist/util/jsonp.d.cts +13 -0
- package/dist/util/jsonp.d.ts +13 -17
- package/dist/util/jsonp.js +7 -46
- package/dist/util/type.cjs +18 -0
- package/dist/util/type.d.cts +4 -0
- package/dist/util/type.d.ts +4 -4
- package/dist/util/type.js +0 -3
- package/dist/util/unzipp.cjs +47 -0
- package/dist/util/unzipp.d.cts +3 -0
- package/dist/util/unzipp.d.ts +3 -4
- package/dist/util/unzipp.js +7 -12
- package/package.json +35 -33
- package/src/narou-fetch.ts +6 -16
- package/src/narou-jsonp.ts +0 -2
- package/src/narou-ranking-results.ts +10 -0
- package/src/narou-search-results.ts +118 -63
- package/src/narou.ts +42 -3
- package/src/params.ts +220 -61
- package/src/user-search.ts +109 -109
- package/src/util/unzipp.ts +13 -3
- package/dist/index.browser.d.ts.map +0 -1
- package/dist/index.browser.js.map +0 -1
- package/dist/index.common.d.ts.map +0 -1
- package/dist/index.common.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/narou-fetch.d.ts.map +0 -1
- package/dist/narou-fetch.js.map +0 -1
- package/dist/narou-jsonp.d.ts.map +0 -1
- package/dist/narou-jsonp.js.map +0 -1
- package/dist/narou-ranking-results.d.ts.map +0 -1
- package/dist/narou-ranking-results.js.map +0 -1
- package/dist/narou-search-results.d.ts.map +0 -1
- package/dist/narou-search-results.js.map +0 -1
- package/dist/narou.d.ts.map +0 -1
- package/dist/narou.js.map +0 -1
- package/dist/params.d.ts.map +0 -1
- package/dist/params.js.map +0 -1
- package/dist/ranking-history.d.ts.map +0 -1
- package/dist/ranking-history.js.map +0 -1
- package/dist/ranking.d.ts.map +0 -1
- package/dist/ranking.js.map +0 -1
- package/dist/search-builder-r18.d.ts.map +0 -1
- package/dist/search-builder-r18.js.map +0 -1
- package/dist/search-builder.d.ts.map +0 -1
- package/dist/search-builder.js.map +0 -1
- package/dist/user-search.d.ts.map +0 -1
- package/dist/user-search.js.map +0 -1
- package/dist/util/jsonp.d.ts.map +0 -1
- package/dist/util/jsonp.js.map +0 -1
- package/dist/util/type.d.ts.map +0 -1
- package/dist/util/type.js.map +0 -1
- package/dist/util/unzipp.d.ts.map +0 -1
- package/dist/util/unzipp.js.map +0 -1
|
@@ -0,0 +1,61 @@
|
|
|
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/narou-search-results.ts
|
|
21
|
+
var narou_search_results_exports = {};
|
|
22
|
+
__export(narou_search_results_exports, {
|
|
23
|
+
End: () => End,
|
|
24
|
+
NovelType: () => NovelType,
|
|
25
|
+
default: () => NarouSearchResults
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(narou_search_results_exports);
|
|
28
|
+
var NarouSearchResults = class {
|
|
29
|
+
/**
|
|
30
|
+
* @constractor
|
|
31
|
+
* @private
|
|
32
|
+
*/
|
|
33
|
+
constructor([header, ...result], params) {
|
|
34
|
+
const count = header.allcount;
|
|
35
|
+
const limit = params.lim ?? 20;
|
|
36
|
+
const start = params.st ?? 0;
|
|
37
|
+
this.allcount = count;
|
|
38
|
+
this.limit = limit;
|
|
39
|
+
this.start = start;
|
|
40
|
+
this.page = start / limit;
|
|
41
|
+
this.length = result.length;
|
|
42
|
+
this.values = result;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var NovelType = {
|
|
46
|
+
/** 連載 */
|
|
47
|
+
Rensai: 1,
|
|
48
|
+
/** 短編 */
|
|
49
|
+
Tanpen: 2
|
|
50
|
+
};
|
|
51
|
+
var End = {
|
|
52
|
+
/** 短編小説と完結済小説 */
|
|
53
|
+
KanketsuOrTanpen: 0,
|
|
54
|
+
/** 連載中 */
|
|
55
|
+
Rensai: 1
|
|
56
|
+
};
|
|
57
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
+
0 && (module.exports = {
|
|
59
|
+
End,
|
|
60
|
+
NovelType
|
|
61
|
+
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { E as End, r as NarouSearchResult, t as NovelType, y as PickedNarouSearchResult, u as SearchResultFields, v as SearchResultOptionalFields, w as SearchResultR18Fields, s as UserSearchResult, x as UserSearchResultFields, N as default } from './narou-search-results-6727b1ce.js';
|
|
2
|
+
import './util/type.cjs';
|
|
@@ -1,131 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* なろう小説API検索結果
|
|
4
|
-
* @class NarouSearchResults
|
|
5
|
-
*/
|
|
6
|
-
export default class NarouSearchResults<T, TKey extends keyof T> {
|
|
7
|
-
allcount: number;
|
|
8
|
-
limit: number;
|
|
9
|
-
start: number;
|
|
10
|
-
page: number;
|
|
11
|
-
length: number;
|
|
12
|
-
values: readonly Pick<T, TKey>[];
|
|
13
|
-
/**
|
|
14
|
-
* @constractor
|
|
15
|
-
* @private
|
|
16
|
-
*/
|
|
17
|
-
constructor([header, ...result]: [{
|
|
18
|
-
allcount: number;
|
|
19
|
-
}, ...Pick<T, TKey>[]], params: SearchParams);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* @typedef {Object} NarouSearchResult
|
|
23
|
-
* @property {number} title 小説名
|
|
24
|
-
* @property {string} ncode Nコード
|
|
25
|
-
* @property {number} userid 作者のユーザID(数値)
|
|
26
|
-
* @property {string} writer 作者名
|
|
27
|
-
* @property {string} story 小説のあらすじ
|
|
28
|
-
* @property {number} genre ジャンル
|
|
29
|
-
* @property {string} keyword キーワード
|
|
30
|
-
* @property {string} general_firstup 初回掲載日 YYYY-MM-DD HH:MM:SSの形式
|
|
31
|
-
* @property {string} general_lastup 最終掲載日 YYYY-MM-DD HH:MM:SSの形式
|
|
32
|
-
* @property {number} noveltype 連載の場合は1、短編の場合は2
|
|
33
|
-
* @property {number} end 短編小説と完結済小説は0となっています。連載中は1です。
|
|
34
|
-
* @property {number} general_all_no 全掲載話数です。短編の場合は1です。
|
|
35
|
-
* @property {number} length 全掲載話数です。短編の場合は1です。
|
|
36
|
-
* @property {number} time 読了時間(分単位)です。読了時間は小説文字数÷500を切り上げした数値です。
|
|
37
|
-
* @property {number} isstop 長期連載中は1、それ以外は0です。
|
|
38
|
-
* @property {number} pc_or_k 1はケータイのみ、2はPCのみ、3はPCとケータイで投稿された作品です。対象は投稿と次話投稿時のみで、どの端末で執筆されたかを表すものではありません。
|
|
39
|
-
* @property {number} global_point 総合得点(=(ブックマーク数×2)+評価点)
|
|
40
|
-
* @property {number} fav_novel_cnt ブックマーク数
|
|
41
|
-
* @property {number} review_cnt レビュー数
|
|
42
|
-
* @property {number} all_point 評価点
|
|
43
|
-
* @property {number} all_hyoka_cnt 評価者数
|
|
44
|
-
* @property {number} sasie_cnt 挿絵の数
|
|
45
|
-
* @property {number} kaiwaritu 会話率
|
|
46
|
-
* @property {number} novelupdated_at 小説の更新日時
|
|
47
|
-
* @property {number} updated_at 最終更新日時(注意:システム用で小説更新時とは関係ありません)
|
|
48
|
-
*/
|
|
49
|
-
export interface NarouSearchResult {
|
|
50
|
-
title: string;
|
|
51
|
-
ncode: string;
|
|
52
|
-
userid: number;
|
|
53
|
-
writer: string;
|
|
54
|
-
story: string;
|
|
55
|
-
nocgenre: R18Site;
|
|
56
|
-
biggenre: BigGenre;
|
|
57
|
-
genre: Genre;
|
|
58
|
-
keyword: string;
|
|
59
|
-
general_firstup: string;
|
|
60
|
-
general_lastup: string;
|
|
61
|
-
novel_type: number;
|
|
62
|
-
noveltype: NovelType;
|
|
63
|
-
end: End;
|
|
64
|
-
general_all_no: number;
|
|
65
|
-
length: number;
|
|
66
|
-
time: number;
|
|
67
|
-
isstop: BooleanNumber;
|
|
68
|
-
isr15: BooleanNumber;
|
|
69
|
-
isbl: BooleanNumber;
|
|
70
|
-
isgl: BooleanNumber;
|
|
71
|
-
iszankoku: BooleanNumber;
|
|
72
|
-
istensei: BooleanNumber;
|
|
73
|
-
istenni: BooleanNumber;
|
|
74
|
-
pc_or_k: PcOrK;
|
|
75
|
-
global_point: number;
|
|
76
|
-
daily_point: number;
|
|
77
|
-
weekly_point: number;
|
|
78
|
-
monthly_point: number;
|
|
79
|
-
quarter_point: number;
|
|
80
|
-
yearly_point: number;
|
|
81
|
-
fav_novel_cnt: number;
|
|
82
|
-
impression_cnt: number;
|
|
83
|
-
review_cnt: number;
|
|
84
|
-
all_point: number;
|
|
85
|
-
all_hyoka_cnt: number;
|
|
86
|
-
sasie_cnt: number;
|
|
87
|
-
kaiwaritu: number;
|
|
88
|
-
novelupdated_at: string;
|
|
89
|
-
updated_at: string;
|
|
90
|
-
weekly_unique: number;
|
|
91
|
-
}
|
|
92
|
-
export interface UserSearchResult {
|
|
93
|
-
userid: number;
|
|
94
|
-
name: string;
|
|
95
|
-
yomikata: string;
|
|
96
|
-
name1st: string;
|
|
97
|
-
novel_cnt: number;
|
|
98
|
-
review_cnt: number;
|
|
99
|
-
novel_length: number;
|
|
100
|
-
sum_global_point: number;
|
|
101
|
-
}
|
|
102
|
-
export declare const PcOrK: {
|
|
103
|
-
readonly Ketai: 1;
|
|
104
|
-
readonly Pc: 2;
|
|
105
|
-
readonly PcAndKetai: 3;
|
|
106
|
-
};
|
|
107
|
-
export declare type PcOrK = typeof PcOrK[keyof typeof PcOrK];
|
|
108
|
-
export declare const NovelType: {
|
|
109
|
-
readonly Rensai: 1;
|
|
110
|
-
readonly Tanpen: 2;
|
|
111
|
-
};
|
|
112
|
-
export declare type NovelType = typeof NovelType[keyof typeof NovelType];
|
|
113
|
-
export declare const End: {
|
|
114
|
-
readonly KanketsuOrTanpen: 0;
|
|
115
|
-
readonly Rensai: 1;
|
|
116
|
-
};
|
|
117
|
-
export declare type End = typeof End[keyof typeof End];
|
|
118
|
-
export declare type SearchResultFields<T extends Fields> = {
|
|
119
|
-
[K in keyof typeof Fields]: typeof Fields[K] extends T ? K : never;
|
|
120
|
-
}[keyof typeof Fields];
|
|
121
|
-
export declare type SearchResultOptionalFields<T extends OptionalFields> = {
|
|
122
|
-
[K in keyof typeof OptionalFields]: typeof OptionalFields[K] extends T ? K : never;
|
|
123
|
-
}[keyof typeof OptionalFields];
|
|
124
|
-
export declare type SearchResultR18Fields<T extends R18Fields> = {
|
|
125
|
-
[K in keyof typeof R18Fields]: typeof R18Fields[K] extends T ? K : never;
|
|
126
|
-
}[keyof typeof R18Fields];
|
|
127
|
-
export declare type UserSearchResultFields<T extends UserFields> = {
|
|
128
|
-
[K in keyof typeof UserFields]: typeof UserFields[K] extends T ? K : never;
|
|
129
|
-
}[keyof typeof UserFields];
|
|
130
|
-
export declare type PickedNarouSearchResult<T extends keyof NarouSearchResult> = Pick<NarouSearchResult, T>;
|
|
131
|
-
//# sourceMappingURL=narou-search-results.d.ts.map
|
|
1
|
+
export { E as End, r as NarouSearchResult, t as NovelType, y as PickedNarouSearchResult, u as SearchResultFields, v as SearchResultOptionalFields, w as SearchResultR18Fields, s as UserSearchResult, x as UserSearchResultFields, N as default } from './narou-search-results-b7c10db0.js';
|
|
2
|
+
import './util/type.js';
|
|
@@ -1,63 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*/
|
|
13
|
-
constructor([header, ...result], params) {
|
|
14
|
-
const count = header.allcount;
|
|
15
|
-
const limit = params.lim ?? 20;
|
|
16
|
-
const start = params.st ?? 0;
|
|
17
|
-
/**
|
|
18
|
-
* 検索結果数
|
|
19
|
-
* @type {number}
|
|
20
|
-
*/
|
|
21
|
-
this.allcount = count;
|
|
22
|
-
/**
|
|
23
|
-
* 結果表示上限数
|
|
24
|
-
* @type {number}
|
|
25
|
-
*/
|
|
26
|
-
this.limit = limit;
|
|
27
|
-
/**
|
|
28
|
-
* 結果表示開始数
|
|
29
|
-
* @type {number}
|
|
30
|
-
*/
|
|
31
|
-
this.start = start;
|
|
32
|
-
/**
|
|
33
|
-
* 結果表示ページ数
|
|
34
|
-
* @type {number}
|
|
35
|
-
*/
|
|
36
|
-
this.page = start / limit;
|
|
37
|
-
/**
|
|
38
|
-
* 結果数
|
|
39
|
-
* @type {number}
|
|
40
|
-
*/
|
|
41
|
-
this.length = result.length;
|
|
42
|
-
/**
|
|
43
|
-
* 検索結果
|
|
44
|
-
* @type {PickedNarouSearchResult<T>[]}
|
|
45
|
-
*/
|
|
46
|
-
this.values = result;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
exports.default = NarouSearchResults;
|
|
50
|
-
exports.PcOrK = {
|
|
51
|
-
Ketai: 1,
|
|
52
|
-
Pc: 2,
|
|
53
|
-
PcAndKetai: 3,
|
|
54
|
-
};
|
|
55
|
-
exports.NovelType = {
|
|
56
|
-
Rensai: 1,
|
|
57
|
-
Tanpen: 2,
|
|
58
|
-
};
|
|
59
|
-
exports.End = {
|
|
60
|
-
KanketsuOrTanpen: 0,
|
|
61
|
-
Rensai: 1,
|
|
62
|
-
};
|
|
63
|
-
//# sourceMappingURL=narou-search-results.js.map
|
|
1
|
+
import {
|
|
2
|
+
End,
|
|
3
|
+
NarouSearchResults,
|
|
4
|
+
NovelType
|
|
5
|
+
} from "./chunk-JFVJBECE.js";
|
|
6
|
+
import "./chunk-IKR7OZGM.js";
|
|
7
|
+
export {
|
|
8
|
+
End,
|
|
9
|
+
NovelType,
|
|
10
|
+
NarouSearchResults as default
|
|
11
|
+
};
|
package/dist/narou.cjs
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
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/narou.ts
|
|
21
|
+
var narou_exports = {};
|
|
22
|
+
__export(narou_exports, {
|
|
23
|
+
default: () => NarouNovel
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(narou_exports);
|
|
26
|
+
|
|
27
|
+
// src/narou-search-results.ts
|
|
28
|
+
var NarouSearchResults = class {
|
|
29
|
+
/**
|
|
30
|
+
* @constractor
|
|
31
|
+
* @private
|
|
32
|
+
*/
|
|
33
|
+
constructor([header, ...result], params) {
|
|
34
|
+
const count = header.allcount;
|
|
35
|
+
const limit = params.lim ?? 20;
|
|
36
|
+
const start = params.st ?? 0;
|
|
37
|
+
this.allcount = count;
|
|
38
|
+
this.limit = limit;
|
|
39
|
+
this.start = start;
|
|
40
|
+
this.page = start / limit;
|
|
41
|
+
this.length = result.length;
|
|
42
|
+
this.values = result;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// src/narou.ts
|
|
47
|
+
var NarouNovel = class {
|
|
48
|
+
/**
|
|
49
|
+
* APIへの検索リクエストを実行する
|
|
50
|
+
* @param params クエリパラメータ
|
|
51
|
+
* @param endpoint APIエンドポイント
|
|
52
|
+
* @returns 検索結果
|
|
53
|
+
*/
|
|
54
|
+
async executeSearch(params, endpoint = "https://api.syosetu.com/novelapi/api/") {
|
|
55
|
+
return new NarouSearchResults(await this.execute(params, endpoint), params);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 小説APIへの検索リクエストを実行する
|
|
59
|
+
* @param params クエリパラメータ
|
|
60
|
+
* @returns 検索結果
|
|
61
|
+
* @see https://dev.syosetu.com/man/api/
|
|
62
|
+
*/
|
|
63
|
+
async executeNovel(params) {
|
|
64
|
+
return await this.executeSearch(
|
|
65
|
+
params,
|
|
66
|
+
"https://api.syosetu.com/novelapi/api/"
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* R18小説APIへの検索リクエストを実行する
|
|
71
|
+
* @param params クエリパラメータ
|
|
72
|
+
* @returns 検索結果
|
|
73
|
+
* @see https://dev.syosetu.com/xman/api/
|
|
74
|
+
*/
|
|
75
|
+
async executeNovel18(params) {
|
|
76
|
+
return await this.executeSearch(
|
|
77
|
+
params,
|
|
78
|
+
"https://api.syosetu.com/novel18api/api/"
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* ランキングAPIへのリクエストを実行する
|
|
83
|
+
* @param params クエリパラメータ
|
|
84
|
+
* @returns ランキング結果
|
|
85
|
+
* @see https://dev.syosetu.com/man/rankapi/
|
|
86
|
+
*/
|
|
87
|
+
async executeRanking(params) {
|
|
88
|
+
return await this.execute(params, "https://api.syosetu.com/rank/rankget/");
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* 殿堂入りAPiへのリクエストを実行する
|
|
92
|
+
* @param params クエリパラメータ
|
|
93
|
+
* @returns ランキング履歴結果
|
|
94
|
+
* @see https://dev.syosetu.com/man/rankinapi/
|
|
95
|
+
*/
|
|
96
|
+
async executeRankingHistory(params) {
|
|
97
|
+
return await this.execute(params, "https://api.syosetu.com/rank/rankin/");
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* ユーザー検索APIへのリクエストを実行する
|
|
101
|
+
* @param params クエリパラメータ
|
|
102
|
+
* @returns 検索結果
|
|
103
|
+
* @see https://dev.syosetu.com/man/userapi/
|
|
104
|
+
*/
|
|
105
|
+
async executeUserSearch(params) {
|
|
106
|
+
return await this.execute(params, "https://api.syosetu.com/userapi/api/");
|
|
107
|
+
}
|
|
108
|
+
};
|
package/dist/narou.d.cts
ADDED
package/dist/narou.d.ts
CHANGED
|
@@ -1,26 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
export declare type NarouParams = SearchParams | RankingParams | RankingHistoryParams | UserSearchParams;
|
|
6
|
-
/**
|
|
7
|
-
* なろう小説APIへのリクエストを実行する
|
|
8
|
-
* @class NarouNovel
|
|
9
|
-
* @private
|
|
10
|
-
*/
|
|
11
|
-
export default abstract class NarouNovel {
|
|
12
|
-
/**
|
|
13
|
-
* なろう小説APIへの検索リクエストを実行する
|
|
14
|
-
* @param params クエリパラメータ
|
|
15
|
-
* @param endpoint APIエンドポイント
|
|
16
|
-
* @returns {Promise<NarouSearchResults>} 検索結果
|
|
17
|
-
*/
|
|
18
|
-
protected abstract execute<T>(params: NarouParams, endpoint: string): Promise<T>;
|
|
19
|
-
executeSearch<T extends keyof NarouSearchResult>(params: SearchParams, endpoint?: string): Promise<NarouSearchResults<NarouSearchResult, T>>;
|
|
20
|
-
executeNovel<T extends keyof NarouSearchResult>(params: SearchParams): Promise<NarouSearchResults<NarouSearchResult, T>>;
|
|
21
|
-
executeNovel18<T extends keyof NarouSearchResult>(params: SearchParams): Promise<NarouSearchResults<NarouSearchResult, T>>;
|
|
22
|
-
executeRanking(params: RankingParams): Promise<NarouRankingResult[]>;
|
|
23
|
-
executeRankingHistory(params: RankingHistoryParams): Promise<RankingHistoryRawResult[]>;
|
|
24
|
-
executeUserSearch<T extends keyof UserSearchResult>(params: UserSearchParams): Promise<NarouSearchResults<UserSearchResult, T>>;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=narou.d.ts.map
|
|
1
|
+
export { a as NarouParams, N as default } from './narou-61329eea.js';
|
|
2
|
+
import './narou-search-results-b7c10db0.js';
|
|
3
|
+
import './ranking-history.js';
|
|
4
|
+
import './util/type.js';
|
package/dist/narou.js
CHANGED
|
@@ -1,30 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class NarouNovel {
|
|
10
|
-
async executeSearch(params, endpoint = "https://api.syosetu.com/novelapi/api/") {
|
|
11
|
-
return new narou_search_results_1.default(await this.execute(params, endpoint), params);
|
|
12
|
-
}
|
|
13
|
-
async executeNovel(params) {
|
|
14
|
-
return await this.executeSearch(params, "https://api.syosetu.com/novelapi/api/");
|
|
15
|
-
}
|
|
16
|
-
async executeNovel18(params) {
|
|
17
|
-
return await this.executeSearch(params, "https://api.syosetu.com/novel18api/api/");
|
|
18
|
-
}
|
|
19
|
-
async executeRanking(params) {
|
|
20
|
-
return await this.execute(params, "https://api.syosetu.com/rank/rankget/");
|
|
21
|
-
}
|
|
22
|
-
async executeRankingHistory(params) {
|
|
23
|
-
return await this.execute(params, "https://api.syosetu.com/rank/rankin/");
|
|
24
|
-
}
|
|
25
|
-
async executeUserSearch(params) {
|
|
26
|
-
return await this.execute(params, "https://api.syosetu.com/userapi/api/");
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.default = NarouNovel;
|
|
30
|
-
//# sourceMappingURL=narou.js.map
|
|
1
|
+
import {
|
|
2
|
+
NarouNovel
|
|
3
|
+
} from "./chunk-55V5YY6H.js";
|
|
4
|
+
import "./chunk-JFVJBECE.js";
|
|
5
|
+
import "./chunk-IKR7OZGM.js";
|
|
6
|
+
export {
|
|
7
|
+
NarouNovel as default
|
|
8
|
+
};
|