narou 0.7.7 → 0.8.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/index.browser.d.ts +7 -1
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +37 -77
- package/dist/index.browser.js.map +1 -1
- package/dist/index.common.d.ts +12 -7
- package/dist/index.common.d.ts.map +1 -1
- package/dist/index.common.js +30 -20
- package/dist/index.common.js.map +1 -1
- package/dist/index.d.ts +15 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -80
- package/dist/index.js.map +1 -1
- package/dist/narou-fetch.js +35 -118
- package/dist/narou-fetch.js.map +1 -1
- package/dist/narou-jsonp.js +14 -91
- package/dist/narou-jsonp.js.map +1 -1
- package/dist/narou-search-results.d.ts +20 -10
- package/dist/narou-search-results.d.ts.map +1 -1
- package/dist/narou-search-results.js +6 -9
- package/dist/narou-search-results.js.map +1 -1
- package/dist/narou.d.ts +7 -6
- package/dist/narou.d.ts.map +1 -1
- package/dist/narou.js +20 -95
- package/dist/narou.js.map +1 -1
- package/dist/params.d.ts +55 -14
- package/dist/params.d.ts.map +1 -1
- package/dist/params.js +56 -39
- package/dist/params.js.map +1 -1
- package/dist/ranking-history.js +7 -7
- package/dist/ranking-history.js.map +1 -1
- package/dist/ranking.js +41 -110
- package/dist/ranking.js.map +1 -1
- package/dist/search-builder-r18.d.ts +5 -5
- package/dist/search-builder-r18.d.ts.map +1 -1
- package/dist/search-builder-r18.js +17 -37
- package/dist/search-builder-r18.js.map +1 -1
- package/dist/search-builder.d.ts +50 -65
- package/dist/search-builder.d.ts.map +1 -1
- package/dist/search-builder.js +155 -215
- package/dist/search-builder.js.map +1 -1
- package/dist/user-search.d.ts +63 -0
- package/dist/user-search.d.ts.map +1 -0
- package/dist/user-search.js +94 -0
- package/dist/user-search.js.map +1 -0
- package/dist/util/jsonp.js +12 -14
- package/dist/util/jsonp.js.map +1 -1
- package/dist/util/unzipp.js +6 -51
- package/dist/util/unzipp.js.map +1 -1
- package/package.json +18 -8
- package/src/index.browser.ts +12 -1
- package/src/index.common.ts +18 -29
- package/src/index.ts +20 -3
- package/src/narou-search-results.ts +20 -7
- package/src/narou.ts +26 -11
- package/src/params.ts +60 -15
- package/src/search-builder-r18.ts +9 -9
- package/src/search-builder.ts +96 -102
- package/src/user-search.ts +109 -0
package/dist/index.browser.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import SearchBuilder from "./search-builder";
|
|
|
4
4
|
import SearchBuilderR18 from "./search-builder-r18";
|
|
5
5
|
import RankingBuilder from "./ranking";
|
|
6
6
|
import { RankingHistoryResult } from "./ranking-history";
|
|
7
|
+
import UserSearchBuilder from "./user-search";
|
|
7
8
|
export * from "./index.common";
|
|
8
9
|
export { NarouNovelJsonp };
|
|
9
10
|
/**
|
|
@@ -18,12 +19,17 @@ export declare function search(word?: string, api?: NarouNovel): SearchBuilder;
|
|
|
18
19
|
* @returns {SearchBuilder}
|
|
19
20
|
*/
|
|
20
21
|
export declare function searchR18(word?: string, api?: NarouNovel): SearchBuilderR18;
|
|
22
|
+
/**
|
|
23
|
+
* ユーザ検索
|
|
24
|
+
*/
|
|
25
|
+
export declare function searchUser(word?: string, api?: NarouNovel): UserSearchBuilder<keyof import("./narou-search-results").UserSearchResult>;
|
|
21
26
|
export declare function ranking(api?: NarouNovel): RankingBuilder;
|
|
22
27
|
export declare function rankingHistory(ncode: string, api?: NarouNovel): Promise<RankingHistoryResult[]>;
|
|
23
28
|
declare const _default: {
|
|
24
29
|
search: typeof search;
|
|
25
|
-
ranking: typeof ranking;
|
|
26
30
|
searchR18: typeof searchR18;
|
|
31
|
+
searchUser: typeof searchUser;
|
|
32
|
+
ranking: typeof ranking;
|
|
27
33
|
rankingHistory: typeof rankingHistory;
|
|
28
34
|
};
|
|
29
35
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,eAAe,CAAC;AAC5C,OAAO,UAAU,MAAM,SAAS,CAAC;AACjC,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,cAAc,MAAM,WAAW,CAAC;AACvC,OAAO,EAAwB,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,eAAe,CAAC;AAC5C,OAAO,UAAU,MAAM,SAAS,CAAC;AACjC,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,cAAc,MAAM,WAAW,CAAC;AACvC,OAAO,EAAwB,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,iBAAiB,MAAM,eAAe,CAAC;AAE9C,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,CAAC;AAI3B;;;;GAIG;AACH,wBAAgB,MAAM,CACpB,IAAI,SAAK,EACT,GAAG,GAAE,UAA4B,GAChC,aAAa,CAIf;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CACvB,IAAI,SAAK,EACT,GAAG,GAAE,UAA4B,GAChC,gBAAgB,CAIlB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,SAAK,EAAE,GAAG,GAAE,UAA4B,8EAItE;AAED,wBAAgB,OAAO,CAAC,GAAG,GAAE,UAA4B,GAAG,cAAc,CAGzE;AAED,wBAAsB,cAAc,CAClC,KAAK,EAAE,MAAM,EACb,GAAG,GAAE,UAA4B,GAChC,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAOjC;;;;;;;;AAED,wBAME"}
|
package/dist/index.browser.js
CHANGED
|
@@ -13,61 +13,24 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
27
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
-
function step(op) {
|
|
30
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
-
while (_) try {
|
|
32
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
-
switch (op[0]) {
|
|
35
|
-
case 0: case 1: t = op; break;
|
|
36
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
-
default:
|
|
40
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
-
if (t[2]) _.ops.pop();
|
|
45
|
-
_.trys.pop(); continue;
|
|
46
|
-
}
|
|
47
|
-
op = body.call(thisArg, _);
|
|
48
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
-
exports.rankingHistory = exports.ranking = exports.searchR18 = exports.search = exports.NarouNovelJsonp = void 0;
|
|
54
|
-
|
|
17
|
+
exports.rankingHistory = exports.ranking = exports.searchUser = exports.searchR18 = exports.search = exports.NarouNovelJsonp = void 0;
|
|
18
|
+
const narou_jsonp_1 = require("./narou-jsonp");
|
|
55
19
|
exports.NarouNovelJsonp = narou_jsonp_1.default;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
20
|
+
const search_builder_1 = require("./search-builder");
|
|
21
|
+
const search_builder_r18_1 = require("./search-builder-r18");
|
|
22
|
+
const ranking_1 = require("./ranking");
|
|
23
|
+
const ranking_history_1 = require("./ranking-history");
|
|
24
|
+
const user_search_1 = require("./user-search");
|
|
60
25
|
__exportStar(require("./index.common"), exports);
|
|
61
|
-
|
|
26
|
+
const narouNovelJsonp = new narou_jsonp_1.default();
|
|
62
27
|
/**
|
|
63
28
|
* 検索
|
|
64
29
|
* @param {string} [word] - 検索ワード
|
|
65
30
|
* @returns {SearchBuilder}
|
|
66
31
|
*/
|
|
67
|
-
function search(word, api) {
|
|
68
|
-
|
|
69
|
-
if (api === void 0) { api = narouNovelJsonp; }
|
|
70
|
-
var builder = new search_builder_1.default({}, api);
|
|
32
|
+
function search(word = "", api = narouNovelJsonp) {
|
|
33
|
+
const builder = new search_builder_1.default({}, api);
|
|
71
34
|
if (word != "")
|
|
72
35
|
builder.word(word);
|
|
73
36
|
return builder;
|
|
@@ -78,46 +41,43 @@ exports.search = search;
|
|
|
78
41
|
* @param {string} [word] - 検索ワード
|
|
79
42
|
* @returns {SearchBuilder}
|
|
80
43
|
*/
|
|
81
|
-
function searchR18(word, api) {
|
|
82
|
-
|
|
83
|
-
if (api === void 0) { api = narouNovelJsonp; }
|
|
84
|
-
var builder = new search_builder_r18_1.default({}, api);
|
|
44
|
+
function searchR18(word = "", api = narouNovelJsonp) {
|
|
45
|
+
const builder = new search_builder_r18_1.default({}, api);
|
|
85
46
|
if (word != "")
|
|
86
47
|
builder.word(word);
|
|
87
48
|
return builder;
|
|
88
49
|
}
|
|
89
50
|
exports.searchR18 = searchR18;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
51
|
+
/**
|
|
52
|
+
* ユーザ検索
|
|
53
|
+
*/
|
|
54
|
+
function searchUser(word = "", api = narouNovelJsonp) {
|
|
55
|
+
const builder = new user_search_1.default({}, api);
|
|
56
|
+
if (word != "")
|
|
57
|
+
builder.word(word);
|
|
58
|
+
return builder;
|
|
59
|
+
}
|
|
60
|
+
exports.searchUser = searchUser;
|
|
61
|
+
function ranking(api = narouNovelJsonp) {
|
|
62
|
+
const builder = new ranking_1.default({}, api);
|
|
93
63
|
return builder;
|
|
94
64
|
}
|
|
95
65
|
exports.ranking = ranking;
|
|
96
|
-
function rankingHistory(ncode, api) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
result = _a.sent();
|
|
105
|
-
if (Array.isArray(result)) {
|
|
106
|
-
return [2 /*return*/, result.map(ranking_history_1.formatRankingHistory)];
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
throw new Error(result);
|
|
110
|
-
}
|
|
111
|
-
return [2 /*return*/];
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
});
|
|
66
|
+
async function rankingHistory(ncode, api = narouNovelJsonp) {
|
|
67
|
+
const result = await api.executeRankingHistory({ ncode });
|
|
68
|
+
if (Array.isArray(result)) {
|
|
69
|
+
return result.map(ranking_history_1.formatRankingHistory);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
throw new Error(result);
|
|
73
|
+
}
|
|
115
74
|
}
|
|
116
75
|
exports.rankingHistory = rankingHistory;
|
|
117
76
|
exports.default = {
|
|
118
|
-
search
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
77
|
+
search,
|
|
78
|
+
searchR18,
|
|
79
|
+
searchUser,
|
|
80
|
+
ranking,
|
|
81
|
+
rankingHistory,
|
|
122
82
|
};
|
|
123
83
|
//# sourceMappingURL=index.browser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+CAA4C;AASnC,0BATF,qBAAe,CASE;AAPxB,qDAA6C;AAC7C,6DAAoD;AACpD,uCAAuC;AACvC,uDAA+E;AAC/E,+CAA8C;AAE9C,iDAA+B;AAG/B,MAAM,eAAe,GAAG,IAAI,qBAAe,EAAE,CAAC;AAE9C;;;;GAIG;AACH,SAAgB,MAAM,CACpB,IAAI,GAAG,EAAE,EACT,MAAkB,eAAe;IAEjC,MAAM,OAAO,GAAG,IAAI,wBAAa,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC3C,IAAI,IAAI,IAAI,EAAE;QAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnC,OAAO,OAAO,CAAC;AACjB,CAAC;AAPD,wBAOC;AAED;;;;GAIG;AACH,SAAgB,SAAS,CACvB,IAAI,GAAG,EAAE,EACT,MAAkB,eAAe;IAEjC,MAAM,OAAO,GAAG,IAAI,4BAAgB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC9C,IAAI,IAAI,IAAI,EAAE;QAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnC,OAAO,OAAO,CAAC;AACjB,CAAC;AAPD,8BAOC;AAED;;GAEG;AACH,SAAgB,UAAU,CAAC,IAAI,GAAG,EAAE,EAAE,MAAkB,eAAe;IACrE,MAAM,OAAO,GAAG,IAAI,qBAAiB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC/C,IAAI,IAAI,IAAI,EAAE;QAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnC,OAAO,OAAO,CAAC;AACjB,CAAC;AAJD,gCAIC;AAED,SAAgB,OAAO,CAAC,MAAkB,eAAe;IACvD,MAAM,OAAO,GAAG,IAAI,iBAAc,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC5C,OAAO,OAAO,CAAC;AACjB,CAAC;AAHD,0BAGC;AAEM,KAAK,UAAU,cAAc,CAClC,KAAa,EACb,MAAkB,eAAe;IAEjC,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,qBAAqB,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1D,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACzB,OAAO,MAAM,CAAC,GAAG,CAAC,sCAAoB,CAAC,CAAC;KACzC;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;KACzB;AACH,CAAC;AAVD,wCAUC;AAED,kBAAe;IACb,MAAM;IACN,SAAS;IACT,UAAU;IACV,OAAO;IACP,cAAc;CACf,CAAC"}
|
package/dist/index.common.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import NarouNovel from "./narou";
|
|
2
2
|
import NarouSearchResults from "./narou-search-results";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export {
|
|
3
|
+
import SearchBuilder from "./search-builder";
|
|
4
|
+
import SearchBuilderR18 from "./search-builder-r18";
|
|
5
|
+
import RankingBuilder from "./ranking";
|
|
6
|
+
export { NarouNovel, NarouSearchResults, SearchBuilder, SearchBuilderR18, RankingBuilder, };
|
|
7
|
+
export * from "./ranking-history";
|
|
8
|
+
export * from "./params";
|
|
9
|
+
export { NarouParams } from "./narou";
|
|
10
|
+
export * from "./narou-search-results";
|
|
11
|
+
export * from "./narou-ranking-results";
|
|
12
|
+
export * from "./search-builder";
|
|
13
|
+
export * from "./search-builder-r18";
|
|
14
|
+
export * from "./user-search";
|
|
10
15
|
//# sourceMappingURL=index.common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.common.d.ts","sourceRoot":"","sources":["../src/index.common.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,SAAS,CAAC;AACjC,OAAO,kBAAkB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.common.d.ts","sourceRoot":"","sources":["../src/index.common.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,SAAS,CAAC;AACjC,OAAO,kBAAkB,MAAM,wBAAwB,CAAC;AACxD,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,cAAc,MAAM,WAAW,CAAC;AAEvC,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,cAAc,GACf,CAAC;AAEF,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC"}
|
package/dist/index.common.js
CHANGED
|
@@ -1,25 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
17
|
+
exports.RankingBuilder = exports.SearchBuilderR18 = exports.SearchBuilder = exports.NarouSearchResults = exports.NarouNovel = void 0;
|
|
18
|
+
const narou_1 = require("./narou");
|
|
5
19
|
exports.NarouNovel = narou_1.default;
|
|
6
|
-
|
|
20
|
+
const narou_search_results_1 = require("./narou-search-results");
|
|
7
21
|
exports.NarouSearchResults = narou_search_results_1.default;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var narou_search_results_2 = require("./narou-search-results");
|
|
22
|
-
Object.defineProperty(exports, "PcOrK", { enumerable: true, get: function () { return narou_search_results_2.PcOrK; } });
|
|
23
|
-
Object.defineProperty(exports, "NovelType", { enumerable: true, get: function () { return narou_search_results_2.NovelType; } });
|
|
24
|
-
Object.defineProperty(exports, "End", { enumerable: true, get: function () { return narou_search_results_2.End; } });
|
|
22
|
+
const search_builder_1 = require("./search-builder");
|
|
23
|
+
exports.SearchBuilder = search_builder_1.default;
|
|
24
|
+
const search_builder_r18_1 = require("./search-builder-r18");
|
|
25
|
+
exports.SearchBuilderR18 = search_builder_r18_1.default;
|
|
26
|
+
const ranking_1 = require("./ranking");
|
|
27
|
+
exports.RankingBuilder = ranking_1.default;
|
|
28
|
+
__exportStar(require("./ranking-history"), exports);
|
|
29
|
+
__exportStar(require("./params"), exports);
|
|
30
|
+
__exportStar(require("./narou-search-results"), exports);
|
|
31
|
+
__exportStar(require("./narou-ranking-results"), exports);
|
|
32
|
+
__exportStar(require("./search-builder"), exports);
|
|
33
|
+
__exportStar(require("./search-builder-r18"), exports);
|
|
34
|
+
__exportStar(require("./user-search"), exports);
|
|
25
35
|
//# sourceMappingURL=index.common.js.map
|
package/dist/index.common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.common.js","sourceRoot":"","sources":["../src/index.common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.common.js","sourceRoot":"","sources":["../src/index.common.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mCAAiC;AAO/B,qBAPK,eAAU,CAOL;AANZ,iEAAwD;AAOtD,6BAPK,8BAAkB,CAOL;AANpB,qDAA6C;AAO3C,wBAPK,wBAAa,CAOL;AANf,6DAAoD;AAOlD,2BAPK,4BAAgB,CAOL;AANlB,uCAAuC;AAOrC,yBAPK,iBAAc,CAOL;AAGhB,oDAAkC;AAClC,2CAAyB;AAEzB,yDAAuC;AACvC,0DAAwC;AACxC,mDAAiC;AACjC,uDAAqC;AACrC,gDAA8B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,26 +5,38 @@ import RankingBuilder from "./ranking";
|
|
|
5
5
|
import { RankingHistoryResult } from "./ranking-history";
|
|
6
6
|
import SearchBuilder from "./search-builder";
|
|
7
7
|
import SearchBuilderR18 from "./search-builder-r18";
|
|
8
|
+
import UserSearchBuilder from "./user-search";
|
|
8
9
|
export * from "./index.common";
|
|
9
10
|
export { NarouNovelFetch, NarouNovelJsonp };
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* なろう小説 API で小説を検索する
|
|
12
13
|
* @param {string} [word] - 検索ワード
|
|
13
14
|
* @returns {SearchBuilder}
|
|
14
15
|
*/
|
|
15
16
|
export declare function search(word?: string, api?: NarouNovel): SearchBuilder;
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
+
* 18禁小説 API で小説を検索する
|
|
18
19
|
* @param {string} [word] - 検索ワード
|
|
19
20
|
* @returns {SearchBuilder}
|
|
20
21
|
*/
|
|
21
22
|
export declare function searchR18(word?: string, api?: NarouNovel): SearchBuilderR18;
|
|
23
|
+
/**
|
|
24
|
+
* なろうユーザ検索 API でユーザを検索する
|
|
25
|
+
*/
|
|
26
|
+
export declare function searchUser(word?: string, api?: NarouNovel): UserSearchBuilder<keyof import("./narou-search-results").UserSearchResult>;
|
|
27
|
+
/**
|
|
28
|
+
* なろう小説ランキング API でランキングを取得する
|
|
29
|
+
*/
|
|
22
30
|
export declare function ranking(api?: NarouNovel): RankingBuilder;
|
|
31
|
+
/**
|
|
32
|
+
* なろう殿堂入り API でランキング履歴を取得する
|
|
33
|
+
*/
|
|
23
34
|
export declare function rankingHistory(ncode: string, api?: NarouNovel): Promise<RankingHistoryResult[]>;
|
|
24
35
|
declare const _default: {
|
|
25
36
|
search: typeof search;
|
|
26
|
-
ranking: typeof ranking;
|
|
27
37
|
searchR18: typeof searchR18;
|
|
38
|
+
searchUser: typeof searchUser;
|
|
39
|
+
ranking: typeof ranking;
|
|
28
40
|
rankingHistory: typeof rankingHistory;
|
|
29
41
|
};
|
|
30
42
|
export default _default;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,SAAS,CAAC;AACjC,OAAO,eAAe,MAAM,eAAe,CAAC;AAC5C,OAAO,eAAe,MAAM,eAAe,CAAC;AAC5C,OAAO,cAAc,MAAM,WAAW,CAAC;AACvC,OAAO,EAAwB,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,SAAS,CAAC;AACjC,OAAO,eAAe,MAAM,eAAe,CAAC;AAC5C,OAAO,eAAe,MAAM,eAAe,CAAC;AAC5C,OAAO,cAAc,MAAM,WAAW,CAAC;AACvC,OAAO,EAAwB,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,iBAAiB,MAAM,eAAe,CAAC;AAE9C,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,CAAC;AAI5C;;;;GAIG;AACH,wBAAgB,MAAM,CACpB,IAAI,SAAK,EACT,GAAG,GAAE,UAA4B,GAChC,aAAa,CAIf;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CACvB,IAAI,SAAK,EACT,GAAG,GAAE,UAA4B,GAChC,gBAAgB,CAIlB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,SAAK,EAAE,GAAG,GAAE,UAA4B,8EAItE;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,GAAG,GAAE,UAA4B,GAAG,cAAc,CAGzE;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,KAAK,EAAE,MAAM,EACb,GAAG,GAAE,UAA4B,GAChC,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAOjC;;;;;;;;AAED,wBAME"}
|
package/dist/index.js
CHANGED
|
@@ -13,113 +13,79 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
27
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
-
function step(op) {
|
|
30
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
-
while (_) try {
|
|
32
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
-
switch (op[0]) {
|
|
35
|
-
case 0: case 1: t = op; break;
|
|
36
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
-
default:
|
|
40
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
-
if (t[2]) _.ops.pop();
|
|
45
|
-
_.trys.pop(); continue;
|
|
46
|
-
}
|
|
47
|
-
op = body.call(thisArg, _);
|
|
48
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
-
exports.rankingHistory = exports.ranking = exports.searchR18 = exports.search = exports.NarouNovelJsonp = exports.NarouNovelFetch = void 0;
|
|
54
|
-
|
|
17
|
+
exports.rankingHistory = exports.ranking = exports.searchUser = exports.searchR18 = exports.search = exports.NarouNovelJsonp = exports.NarouNovelFetch = void 0;
|
|
18
|
+
const narou_fetch_1 = require("./narou-fetch");
|
|
55
19
|
exports.NarouNovelFetch = narou_fetch_1.default;
|
|
56
|
-
|
|
20
|
+
const narou_jsonp_1 = require("./narou-jsonp");
|
|
57
21
|
exports.NarouNovelJsonp = narou_jsonp_1.default;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
22
|
+
const ranking_1 = require("./ranking");
|
|
23
|
+
const ranking_history_1 = require("./ranking-history");
|
|
24
|
+
const search_builder_1 = require("./search-builder");
|
|
25
|
+
const search_builder_r18_1 = require("./search-builder-r18");
|
|
26
|
+
const user_search_1 = require("./user-search");
|
|
62
27
|
__exportStar(require("./index.common"), exports);
|
|
63
|
-
|
|
28
|
+
const narouNovelFetch = new narou_fetch_1.default();
|
|
64
29
|
/**
|
|
65
|
-
*
|
|
30
|
+
* なろう小説 API で小説を検索する
|
|
66
31
|
* @param {string} [word] - 検索ワード
|
|
67
32
|
* @returns {SearchBuilder}
|
|
68
33
|
*/
|
|
69
|
-
function search(word, api) {
|
|
70
|
-
|
|
71
|
-
if (api === void 0) { api = narouNovelFetch; }
|
|
72
|
-
var builder = new search_builder_1.default({}, api);
|
|
34
|
+
function search(word = "", api = narouNovelFetch) {
|
|
35
|
+
const builder = new search_builder_1.default({}, api);
|
|
73
36
|
if (word != "")
|
|
74
37
|
builder.word(word);
|
|
75
38
|
return builder;
|
|
76
39
|
}
|
|
77
40
|
exports.search = search;
|
|
78
41
|
/**
|
|
79
|
-
*
|
|
42
|
+
* 18禁小説 API で小説を検索する
|
|
80
43
|
* @param {string} [word] - 検索ワード
|
|
81
44
|
* @returns {SearchBuilder}
|
|
82
45
|
*/
|
|
83
|
-
function searchR18(word, api) {
|
|
84
|
-
|
|
85
|
-
if (api === void 0) { api = narouNovelFetch; }
|
|
86
|
-
var builder = new search_builder_r18_1.default({}, api);
|
|
46
|
+
function searchR18(word = "", api = narouNovelFetch) {
|
|
47
|
+
const builder = new search_builder_r18_1.default({}, api);
|
|
87
48
|
if (word != "")
|
|
88
49
|
builder.word(word);
|
|
89
50
|
return builder;
|
|
90
51
|
}
|
|
91
52
|
exports.searchR18 = searchR18;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
53
|
+
/**
|
|
54
|
+
* なろうユーザ検索 API でユーザを検索する
|
|
55
|
+
*/
|
|
56
|
+
function searchUser(word = "", api = narouNovelFetch) {
|
|
57
|
+
const builder = new user_search_1.default({}, api);
|
|
58
|
+
if (word != "")
|
|
59
|
+
builder.word(word);
|
|
60
|
+
return builder;
|
|
61
|
+
}
|
|
62
|
+
exports.searchUser = searchUser;
|
|
63
|
+
/**
|
|
64
|
+
* なろう小説ランキング API でランキングを取得する
|
|
65
|
+
*/
|
|
66
|
+
function ranking(api = narouNovelFetch) {
|
|
67
|
+
const builder = new ranking_1.default({}, api);
|
|
95
68
|
return builder;
|
|
96
69
|
}
|
|
97
70
|
exports.ranking = ranking;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
throw new Error(result);
|
|
112
|
-
}
|
|
113
|
-
return [2 /*return*/];
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
});
|
|
71
|
+
/**
|
|
72
|
+
* なろう殿堂入り API でランキング履歴を取得する
|
|
73
|
+
*/
|
|
74
|
+
async function rankingHistory(ncode, api = narouNovelFetch) {
|
|
75
|
+
const result = await api.executeRankingHistory({ ncode });
|
|
76
|
+
if (Array.isArray(result)) {
|
|
77
|
+
return result.map(ranking_history_1.formatRankingHistory);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
throw new Error(result);
|
|
81
|
+
}
|
|
117
82
|
}
|
|
118
83
|
exports.rankingHistory = rankingHistory;
|
|
119
84
|
exports.default = {
|
|
120
|
-
search
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
85
|
+
search,
|
|
86
|
+
searchR18,
|
|
87
|
+
searchUser,
|
|
88
|
+
ranking,
|
|
89
|
+
rankingHistory,
|
|
124
90
|
};
|
|
125
91
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,+CAA4C;AASnC,0BATF,qBAAe,CASE;AARxB,+CAA4C;AAQlB,0BARnB,qBAAe,CAQmB;AAPzC,uCAAuC;AACvC,uDAA+E;AAC/E,qDAA6C;AAC7C,6DAAoD;AACpD,+CAA8C;AAE9C,iDAA+B;AAG/B,MAAM,eAAe,GAAG,IAAI,qBAAe,EAAE,CAAC;AAE9C;;;;GAIG;AACH,SAAgB,MAAM,CACpB,IAAI,GAAG,EAAE,EACT,MAAkB,eAAe;IAEjC,MAAM,OAAO,GAAG,IAAI,wBAAa,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC3C,IAAI,IAAI,IAAI,EAAE;QAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnC,OAAO,OAAO,CAAC;AACjB,CAAC;AAPD,wBAOC;AAED;;;;GAIG;AACH,SAAgB,SAAS,CACvB,IAAI,GAAG,EAAE,EACT,MAAkB,eAAe;IAEjC,MAAM,OAAO,GAAG,IAAI,4BAAgB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC9C,IAAI,IAAI,IAAI,EAAE;QAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnC,OAAO,OAAO,CAAC;AACjB,CAAC;AAPD,8BAOC;AAED;;GAEG;AACH,SAAgB,UAAU,CAAC,IAAI,GAAG,EAAE,EAAE,MAAkB,eAAe;IACrE,MAAM,OAAO,GAAG,IAAI,qBAAiB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC/C,IAAI,IAAI,IAAI,EAAE;QAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnC,OAAO,OAAO,CAAC;AACjB,CAAC;AAJD,gCAIC;AAED;;GAEG;AACH,SAAgB,OAAO,CAAC,MAAkB,eAAe;IACvD,MAAM,OAAO,GAAG,IAAI,iBAAc,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC5C,OAAO,OAAO,CAAC;AACjB,CAAC;AAHD,0BAGC;AAED;;GAEG;AACI,KAAK,UAAU,cAAc,CAClC,KAAa,EACb,MAAkB,eAAe;IAEjC,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,qBAAqB,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1D,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACzB,OAAO,MAAM,CAAC,GAAG,CAAC,sCAAoB,CAAC,CAAC;KACzC;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;KACzB;AACH,CAAC;AAVD,wCAUC;AAED,kBAAe;IACb,MAAM;IACN,SAAS;IACT,UAAU;IACV,OAAO;IACP,cAAc;CACf,CAAC"}
|