narou 0.5.0 → 0.6.2

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 (131) hide show
  1. package/dist/index.browser.d.ts +30 -0
  2. package/dist/index.browser.d.ts.map +1 -0
  3. package/dist/index.browser.js +119 -0
  4. package/dist/index.browser.js.map +1 -0
  5. package/dist/index.common.d.ts +8 -0
  6. package/dist/index.common.d.ts.map +1 -0
  7. package/dist/index.common.js +17 -0
  8. package/dist/index.common.js.map +1 -0
  9. package/dist/index.d.ts +30 -31
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +120 -113
  12. package/dist/index.js.map +1 -1
  13. package/dist/narou-fetch.d.ts +13 -0
  14. package/dist/narou-fetch.d.ts.map +1 -0
  15. package/dist/narou-fetch.js +130 -0
  16. package/dist/narou-fetch.js.map +1 -0
  17. package/dist/narou-jsonp.d.ts +10 -0
  18. package/dist/narou-jsonp.d.ts.map +1 -0
  19. package/dist/narou-jsonp.js +102 -0
  20. package/dist/narou-jsonp.js.map +1 -0
  21. package/dist/narou-ranking-results.d.ts +8 -8
  22. package/dist/narou-ranking-results.js +2 -2
  23. package/dist/narou-search-results.d.ts +90 -89
  24. package/dist/narou-search-results.d.ts.map +1 -1
  25. package/dist/narou-search-results.js +51 -51
  26. package/dist/narou-search-results.js.map +1 -1
  27. package/dist/narou.d.ts +24 -25
  28. package/dist/narou.d.ts.map +1 -1
  29. package/dist/narou.js +104 -142
  30. package/dist/narou.js.map +1 -1
  31. package/dist/params.d.ts +230 -230
  32. package/dist/params.js +173 -173
  33. package/dist/ranking-history.d.ts +13 -13
  34. package/dist/ranking-history.js +13 -13
  35. package/dist/ranking-history.js.map +1 -1
  36. package/dist/ranking.d.ts +47 -45
  37. package/dist/ranking.d.ts.map +1 -1
  38. package/dist/ranking.js +167 -165
  39. package/dist/ranking.js.map +1 -1
  40. package/dist/search-builder-r18.d.ts +21 -21
  41. package/dist/search-builder-r18.d.ts.map +1 -1
  42. package/dist/search-builder-r18.js +64 -63
  43. package/dist/search-builder-r18.js.map +1 -1
  44. package/dist/search-builder.d.ts +228 -226
  45. package/dist/search-builder.d.ts.map +1 -1
  46. package/dist/search-builder.js +412 -412
  47. package/dist/search-builder.js.map +1 -1
  48. package/dist/util/jsonp.d.ts +14 -0
  49. package/dist/util/jsonp.d.ts.map +1 -0
  50. package/dist/util/jsonp.js +48 -0
  51. package/dist/util/jsonp.js.map +1 -0
  52. package/dist/util/unzipp.d.ts +3 -3
  53. package/dist/util/unzipp.js +56 -56
  54. package/dist/util/unzipp.js.map +1 -1
  55. package/dist/util/url.d.ts +10 -0
  56. package/dist/util/url.d.ts.map +1 -0
  57. package/dist/util/url.js +9 -0
  58. package/dist/util/url.js.map +1 -0
  59. package/dist.es2015/index.browser.js +50 -0
  60. package/dist.es2015/index.browser.js.map +1 -0
  61. package/dist.es2015/index.common.js +5 -0
  62. package/dist.es2015/index.common.js.map +1 -0
  63. package/dist.es2015/index.js +50 -49
  64. package/dist.es2015/index.js.map +1 -1
  65. package/dist.es2015/narou-fetch.js +44 -0
  66. package/dist.es2015/narou-fetch.js.map +1 -0
  67. package/dist.es2015/narou-jsonp.js +22 -0
  68. package/dist.es2015/narou-jsonp.js.map +1 -0
  69. package/dist.es2015/narou-ranking-results.js +1 -1
  70. package/dist.es2015/narou-search-results.js +46 -46
  71. package/dist.es2015/narou-search-results.js.map +1 -1
  72. package/dist.es2015/narou.js +23 -60
  73. package/dist.es2015/narou.js.map +1 -1
  74. package/dist.es2015/params.js +170 -170
  75. package/dist.es2015/ranking-history.js +9 -9
  76. package/dist.es2015/ranking.js +90 -90
  77. package/dist.es2015/ranking.js.map +1 -1
  78. package/dist.es2015/search-builder-r18.js +41 -42
  79. package/dist.es2015/search-builder-r18.js.map +1 -1
  80. package/dist.es2015/search-builder.js +383 -383
  81. package/dist.es2015/search-builder.js.map +1 -1
  82. package/dist.es2015/util/jsonp.js +43 -0
  83. package/dist.es2015/util/jsonp.js.map +1 -0
  84. package/dist.es2015/util/unzipp.js +7 -7
  85. package/dist.es2015/util/url.js +7 -0
  86. package/dist.es2015/util/url.js.map +1 -0
  87. package/dist.esm/index.browser.js +102 -0
  88. package/dist.esm/index.browser.js.map +1 -0
  89. package/dist.esm/index.common.js +5 -0
  90. package/dist.esm/index.common.js.map +1 -0
  91. package/dist.esm/index.js +102 -97
  92. package/dist.esm/index.js.map +1 -1
  93. package/dist.esm/narou-fetch.js +128 -0
  94. package/dist.esm/narou-fetch.js.map +1 -0
  95. package/dist.esm/narou-jsonp.js +100 -0
  96. package/dist.esm/narou-jsonp.js.map +1 -0
  97. package/dist.esm/narou-ranking-results.js +1 -1
  98. package/dist.esm/narou-search-results.js +49 -49
  99. package/dist.esm/narou-search-results.js.map +1 -1
  100. package/dist.esm/narou.js +102 -140
  101. package/dist.esm/narou.js.map +1 -1
  102. package/dist.esm/params.js +170 -170
  103. package/dist.esm/ranking-history.js +9 -9
  104. package/dist.esm/ranking.js +164 -162
  105. package/dist.esm/ranking.js.map +1 -1
  106. package/dist.esm/search-builder-r18.js +62 -61
  107. package/dist.esm/search-builder-r18.js.map +1 -1
  108. package/dist.esm/search-builder.js +410 -410
  109. package/dist.esm/search-builder.js.map +1 -1
  110. package/dist.esm/util/jsonp.js +44 -0
  111. package/dist.esm/util/jsonp.js.map +1 -0
  112. package/dist.esm/util/unzipp.js +52 -52
  113. package/dist.esm/util/url.js +7 -0
  114. package/dist.esm/util/url.js.map +1 -0
  115. package/package-lock.json +3328 -4289
  116. package/package.json +8 -9
  117. package/src/index.browser.ts +63 -0
  118. package/src/index.common.ts +17 -0
  119. package/src/index.ts +22 -23
  120. package/src/narou-fetch.ts +51 -0
  121. package/src/narou-jsonp.ts +29 -0
  122. package/src/narou-ranking-results.ts +9 -9
  123. package/src/narou-search-results.ts +11 -10
  124. package/src/narou.ts +21 -49
  125. package/src/params.ts +280 -280
  126. package/src/ranking.ts +111 -107
  127. package/src/search-builder-r18.ts +1 -2
  128. package/src/search-builder.ts +5 -3
  129. package/src/util/jsonp.ts +66 -0
  130. package/src/util/unzipp.ts +9 -9
  131. package/src/util/url.ts +7 -0
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
28
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
+ return new (P || (P = Promise))(function (resolve, reject) {
31
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
35
+ });
36
+ };
37
+ var __generator = (this && this.__generator) || function (thisArg, body) {
38
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
39
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
40
+ function verb(n) { return function (v) { return step([n, v]); }; }
41
+ function step(op) {
42
+ if (f) throw new TypeError("Generator is already executing.");
43
+ while (_) try {
44
+ 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;
45
+ if (y = 0, t) op = [op[0] & 2, t.value];
46
+ switch (op[0]) {
47
+ case 0: case 1: t = op; break;
48
+ case 4: _.label++; return { value: op[1], done: false };
49
+ case 5: _.label++; y = op[1]; op = [0]; continue;
50
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
51
+ default:
52
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
53
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
54
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
55
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
56
+ if (t[2]) _.ops.pop();
57
+ _.trys.pop(); continue;
58
+ }
59
+ op = body.call(thisArg, _);
60
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
61
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
62
+ }
63
+ };
64
+ Object.defineProperty(exports, "__esModule", { value: true });
65
+ var node_fetch_1 = require("node-fetch");
66
+ var url_1 = require("./util/url");
67
+ var unzipp_1 = require("./util/unzipp");
68
+ var narou_1 = require("./narou");
69
+ /**
70
+ * なろう小説APIへのリクエストを実行する
71
+ * @class NarouNovel
72
+ * @private
73
+ */
74
+ var NarouNovelFetch = /** @class */ (function (_super) {
75
+ __extends(NarouNovelFetch, _super);
76
+ function NarouNovelFetch(fetch) {
77
+ if (fetch === void 0) { fetch = node_fetch_1.default; }
78
+ var _this = _super.call(this) || this;
79
+ _this.fetch = fetch;
80
+ return _this;
81
+ }
82
+ NarouNovelFetch.prototype.execute = function (params, endpoint) {
83
+ return __awaiter(this, void 0, void 0, function () {
84
+ var query, url, res, buffer, _a;
85
+ return __generator(this, function (_b) {
86
+ switch (_b.label) {
87
+ case 0:
88
+ query = __assign(__assign({}, params), { out: "json" });
89
+ if (query.gzip === undefined) {
90
+ query.gzip = 5;
91
+ }
92
+ url = new url_1.default(endpoint);
93
+ Object.entries(query).forEach(function (_a) {
94
+ var key = _a[0], value = _a[1];
95
+ if (value) {
96
+ url.searchParams.append(key, value.toString());
97
+ }
98
+ });
99
+ return [4 /*yield*/, this.fetch(url)];
100
+ case 1:
101
+ res = _b.sent();
102
+ if (!(query.gzip === 0)) return [3 /*break*/, 3];
103
+ return [4 /*yield*/, res.json()];
104
+ case 2: return [2 /*return*/, _b.sent()];
105
+ case 3: return [4 /*yield*/, res.buffer()];
106
+ case 4:
107
+ buffer = _b.sent();
108
+ _b.label = 5;
109
+ case 5:
110
+ _b.trys.push([5, 7, , 8]);
111
+ return [4 /*yield*/, (0, unzipp_1.unzipp)(buffer)];
112
+ case 6: return [2 /*return*/, _b.sent()];
113
+ case 7:
114
+ _a = _b.sent();
115
+ try {
116
+ throw JSON.stringify(buffer.toString());
117
+ }
118
+ catch (_c) {
119
+ throw buffer.toString();
120
+ }
121
+ return [3 /*break*/, 8];
122
+ case 8: return [2 /*return*/];
123
+ }
124
+ });
125
+ });
126
+ };
127
+ return NarouNovelFetch;
128
+ }(narou_1.default));
129
+ exports.default = NarouNovelFetch;
130
+ //# sourceMappingURL=narou-fetch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"narou-fetch.js","sourceRoot":"","sources":["../src/narou-fetch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAmC;AACnC,kCAAiC;AAEjC,wCAAuC;AACvC,iCAAkD;AA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;;KAEJ;IACH,sBAAC;AAAD,CAAC,AAvCD,CAA6C,eAAU,GAuCtD"}
@@ -0,0 +1,10 @@
1
+ import NarouNovel, { NarouParams } from "./narou";
2
+ /**
3
+ * なろう小説APIへのリクエストを実行する
4
+ * @class NarouNovel
5
+ * @private
6
+ */
7
+ export default class NarouNovelJsonp extends NarouNovel {
8
+ protected execute<T>(params: NarouParams, endpoint: string): Promise<T>;
9
+ }
10
+ //# sourceMappingURL=narou-jsonp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"narou-jsonp.d.ts","sourceRoot":"","sources":["../src/narou-jsonp.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,EAAE,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGlD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU;cACrC,OAAO,CAAC,CAAC,EACvB,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,CAAC,CAAC;CAcd"}
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
28
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
+ return new (P || (P = Promise))(function (resolve, reject) {
31
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
35
+ });
36
+ };
37
+ var __generator = (this && this.__generator) || function (thisArg, body) {
38
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
39
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
40
+ function verb(n) { return function (v) { return step([n, v]); }; }
41
+ function step(op) {
42
+ if (f) throw new TypeError("Generator is already executing.");
43
+ while (_) try {
44
+ 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;
45
+ if (y = 0, t) op = [op[0] & 2, t.value];
46
+ switch (op[0]) {
47
+ case 0: case 1: t = op; break;
48
+ case 4: _.label++; return { value: op[1], done: false };
49
+ case 5: _.label++; y = op[1]; op = [0]; continue;
50
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
51
+ default:
52
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
53
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
54
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
55
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
56
+ if (t[2]) _.ops.pop();
57
+ _.trys.pop(); continue;
58
+ }
59
+ op = body.call(thisArg, _);
60
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
61
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
62
+ }
63
+ };
64
+ Object.defineProperty(exports, "__esModule", { value: true });
65
+ var url_1 = require("./util/url");
66
+ var narou_1 = require("./narou");
67
+ var jsonp_1 = require("./util/jsonp");
68
+ /**
69
+ * なろう小説APIへのリクエストを実行する
70
+ * @class NarouNovel
71
+ * @private
72
+ */
73
+ var NarouNovelJsonp = /** @class */ (function (_super) {
74
+ __extends(NarouNovelJsonp, _super);
75
+ function NarouNovelJsonp() {
76
+ return _super !== null && _super.apply(this, arguments) || this;
77
+ }
78
+ NarouNovelJsonp.prototype.execute = function (params, endpoint) {
79
+ return __awaiter(this, void 0, void 0, function () {
80
+ var query, url;
81
+ return __generator(this, function (_a) {
82
+ switch (_a.label) {
83
+ case 0:
84
+ query = __assign(__assign({}, params), { out: "jsonp" });
85
+ query.gzip = 0;
86
+ url = new url_1.default(endpoint);
87
+ Object.entries(query).forEach(function (_a) {
88
+ var key = _a[0], value = _a[1];
89
+ if (value) {
90
+ url.searchParams.append(key, value.toString());
91
+ }
92
+ });
93
+ return [4 /*yield*/, (0, jsonp_1.jsonp)(url.toString())];
94
+ case 1: return [2 /*return*/, _a.sent()];
95
+ }
96
+ });
97
+ });
98
+ };
99
+ return NarouNovelJsonp;
100
+ }(narou_1.default));
101
+ exports.default = NarouNovelJsonp;
102
+ //# sourceMappingURL=narou-jsonp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"narou-jsonp.js","sourceRoot":"","sources":["../src/narou-jsonp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kCAAiC;AAEjC,iCAAkD;AAClD,sCAAqC;AAErC;;;;GAIG;AACH;IAA6C,mCAAU;IAAvD;;IAkBA,CAAC;IAjBiB,iCAAO,GAAvB,UACE,MAAmB,EACnB,QAAgB;;;;;;wBAEV,KAAK,yBAAQ,MAAM,KAAE,GAAG,EAAE,OAAO,GAAE,CAAC;wBAC1C,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;wBAET,GAAG,GAAG,IAAI,aAAO,CAAC,QAAQ,CAAC,CAAC;wBAElC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,UAAC,EAAY;gCAAX,GAAG,QAAA,EAAE,KAAK,QAAA;4BACxC,IAAI,KAAK,EAAE;gCACT,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;6BAChD;wBACH,CAAC,CAAC,CAAC;wBAEI,qBAAM,IAAA,aAAK,EAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,EAAA;4BAAlC,sBAAO,SAA2B,EAAC;;;;KACpC;IACH,sBAAC;AAAD,CAAC,AAlBD,CAA6C,eAAU,GAkBtD"}
@@ -1,9 +1,9 @@
1
- import { NarouSearchResult } from "./narou-search-results";
2
- export interface NarouRankingResult {
3
- ncode: string;
4
- rank: number;
5
- pt: number;
6
- }
7
- export interface RankingResult extends NarouSearchResult, NarouRankingResult {
8
- }
1
+ import { NarouSearchResult } from "./narou-search-results";
2
+ export interface NarouRankingResult {
3
+ ncode: string;
4
+ rank: number;
5
+ pt: number;
6
+ }
7
+ export interface RankingResult extends NarouSearchResult, NarouRankingResult {
8
+ }
9
9
  //# sourceMappingURL=narou-ranking-results.d.ts.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=narou-ranking-results.js.map
@@ -1,90 +1,91 @@
1
- /**
2
- * なろう小説API検索結果
3
- * @class NarouSearchResults
4
- */
5
- import { SearchParams } from "./params";
6
- export default class NarouSearchResults {
7
- allcount: number;
8
- limit: number;
9
- start: number;
10
- page: number;
11
- length: number;
12
- values: NarouSearchResult[];
13
- /**
14
- * @constractor
15
- * @private
16
- */
17
- constructor([header, ...result]: [{
18
- allcount: number;
19
- }, ...NarouSearchResult[]], 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 連載の場合は1、短編の場合は2
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
- genre: number;
56
- keyword: string;
57
- general_firstup: string;
58
- general_lastup: string;
59
- novel_type: number;
60
- noveltype: number;
61
- end: number;
62
- general_all_no: number;
63
- length: number;
64
- time: number;
65
- isstop: number;
66
- isr15: number;
67
- isbl: number;
68
- isgl: number;
69
- iszankoku: number;
70
- istensei: number;
71
- istenni: number;
72
- pc_or_k: number;
73
- global_point: number;
74
- daily_point: number;
75
- weekly_point: number;
76
- monthly_point: number;
77
- quarter_point: number;
78
- yearly_point: number;
79
- fav_novel_cnt: number;
80
- impression_cnt: number;
81
- review_cnt: number;
82
- all_point: number;
83
- all_hyoka_cnt: number;
84
- sasie_cnt: number;
85
- kaiwaritu: number;
86
- novelupdated_at: number;
87
- update_at: number;
88
- weekly_unique: number;
89
- }
1
+ /**
2
+ * なろう小説API検索結果
3
+ * @class NarouSearchResults
4
+ */
5
+ import { booleanNumber, Genre, R18Site, SearchParams } from "./params";
6
+ export default class NarouSearchResults {
7
+ allcount: number;
8
+ limit: number;
9
+ start: number;
10
+ page: number;
11
+ length: number;
12
+ values: NarouSearchResult[];
13
+ /**
14
+ * @constractor
15
+ * @private
16
+ */
17
+ constructor([header, ...result]: [{
18
+ allcount: number;
19
+ }, ...NarouSearchResult[]], 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 連載の場合は1、短編の場合は2
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
+ genre: Genre;
57
+ keyword: string;
58
+ general_firstup: string;
59
+ general_lastup: string;
60
+ novel_type: number;
61
+ noveltype: number;
62
+ end: booleanNumber;
63
+ general_all_no: number;
64
+ length: number;
65
+ time: number;
66
+ isstop: booleanNumber;
67
+ isr15: booleanNumber;
68
+ isbl: booleanNumber;
69
+ isgl: booleanNumber;
70
+ iszankoku: booleanNumber;
71
+ istensei: booleanNumber;
72
+ istenni: booleanNumber;
73
+ pc_or_k: number;
74
+ global_point: number;
75
+ daily_point: number;
76
+ weekly_point: number;
77
+ monthly_point: number;
78
+ quarter_point: number;
79
+ yearly_point: number;
80
+ fav_novel_cnt: number;
81
+ impression_cnt: number;
82
+ review_cnt: number;
83
+ all_point: number;
84
+ all_hyoka_cnt: number;
85
+ sasie_cnt: number;
86
+ kaiwaritu: number;
87
+ novelupdated_at: number;
88
+ update_at: number;
89
+ weekly_unique: number;
90
+ }
90
91
  //# sourceMappingURL=narou-search-results.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"narou-search-results.d.ts","sourceRoot":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IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,aAAa,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,EAAE,aAAa,CAAC;IACzB,QAAQ,EAAE,aAAa,CAAC;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB"}
@@ -1,52 +1,52 @@
1
- "use strict";
2
- /**
3
- * なろう小説API検索結果
4
- * @class NarouSearchResults
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var NarouSearchResults = /** @class */ (function () {
8
- /**
9
- * @constractor
10
- * @private
11
- */
12
- function NarouSearchResults(_a, params) {
13
- var header = _a[0], result = _a.slice(1);
14
- var _b, _c;
15
- var count = header.allcount;
16
- var limit = (_b = params.lim) !== null && _b !== void 0 ? _b : 20;
17
- var start = (_c = params.st) !== null && _c !== void 0 ? _c : 0;
18
- /**
19
- * 検索結果数
20
- * @type {number}
21
- */
22
- this.allcount = count;
23
- /**
24
- * 結果表示上限数
25
- * @type {number}
26
- */
27
- this.limit = limit;
28
- /**
29
- * 結果表示開始数
30
- * @type {number}
31
- */
32
- this.start = start;
33
- /**
34
- * 結果表示ページ数
35
- * @type {number}
36
- */
37
- this.page = start / limit;
38
- /**
39
- * 結果数
40
- * @type {number}
41
- */
42
- this.length = result.length;
43
- /**
44
- * 検索結果
45
- * @type {NarouSearchResult[]}
46
- */
47
- this.values = result;
48
- }
49
- return NarouSearchResults;
50
- }());
51
- exports.default = NarouSearchResults;
1
+ "use strict";
2
+ /**
3
+ * なろう小説API検索結果
4
+ * @class NarouSearchResults
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ var NarouSearchResults = /** @class */ (function () {
8
+ /**
9
+ * @constractor
10
+ * @private
11
+ */
12
+ function NarouSearchResults(_a, params) {
13
+ var header = _a[0], result = _a.slice(1);
14
+ var _b, _c;
15
+ var count = header.allcount;
16
+ var limit = (_b = params.lim) !== null && _b !== void 0 ? _b : 20;
17
+ var start = (_c = params.st) !== null && _c !== void 0 ? _c : 0;
18
+ /**
19
+ * 検索結果数
20
+ * @type {number}
21
+ */
22
+ this.allcount = count;
23
+ /**
24
+ * 結果表示上限数
25
+ * @type {number}
26
+ */
27
+ this.limit = limit;
28
+ /**
29
+ * 結果表示開始数
30
+ * @type {number}
31
+ */
32
+ this.start = start;
33
+ /**
34
+ * 結果表示ページ数
35
+ * @type {number}
36
+ */
37
+ this.page = start / limit;
38
+ /**
39
+ * 結果数
40
+ * @type {number}
41
+ */
42
+ this.length = result.length;
43
+ /**
44
+ * 検索結果
45
+ * @type {NarouSearchResult[]}
46
+ */
47
+ this.values = result;
48
+ }
49
+ return NarouSearchResults;
50
+ }());
51
+ exports.default = NarouSearchResults;
52
52
  //# sourceMappingURL=narou-search-results.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"narou-search-results.js","sourceRoot":"","sources":["../src/narou-search-results.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAIH;IAQE;;;OAGG;IACH,4BACE,EAAmE,EACnE,MAAoB;YADnB,MAAM,QAAA,EAAK,MAAM,cAAA;;QAGlB,IAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC9B,IAAM,KAAK,SAAG,MAAM,CAAC,GAAG,mCAAI,EAAE,CAAC;QAC/B,IAAM,KAAK,SAAG,MAAM,CAAC,EAAE,mCAAI,CAAC,CAAC;QAE7B;;;WAGG;QACH,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB;;;WAGG;QACH,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB;;;WAGG;QACH,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB;;;WAGG;QACH,IAAI,CAAC,IAAI,GAAG,KAAK,GAAG,KAAK,CAAC;QAC1B;;;WAGG;QACH,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B;;;WAGG;QACH,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IACH,yBAAC;AAAD,CAAC,AAnDD,IAmDC"}
1
+ {"version":3,"file":"narou-search-results.js","sourceRoot":"","sources":["../src/narou-search-results.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAIH;IAQE;;;OAGG;IACH,4BACE,EAAmE,EACnE,MAAoB;YADnB,MAAM,QAAA,EAAK,MAAM,cAAA;;QAGlB,IAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC9B,IAAM,KAAK,GAAG,MAAA,MAAM,CAAC,GAAG,mCAAI,EAAE,CAAC;QAC/B,IAAM,KAAK,GAAG,MAAA,MAAM,CAAC,EAAE,mCAAI,CAAC,CAAC;QAE7B;;;WAGG;QACH,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB;;;WAGG;QACH,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB;;;WAGG;QACH,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB;;;WAGG;QACH,IAAI,CAAC,IAAI,GAAG,KAAK,GAAG,KAAK,CAAC;QAC1B;;;WAGG;QACH,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B;;;WAGG;QACH,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IACH,yBAAC;AAAD,CAAC,AAnDD,IAmDC"}
package/dist/narou.d.ts CHANGED
@@ -1,26 +1,25 @@
1
- import { NarouRankingResult } from "./narou-ranking-results";
2
- import NarouSearchResults from "./narou-search-results";
3
- import { RankingHistoryParams, RankingParams, SearchParams } from "./params";
4
- import { RankingHistoryRawResult } from "./ranking-history";
5
- declare type NarouParams = SearchParams | RankingParams | RankingHistoryParams;
6
- /**
7
- * なろう小説APIへのリクエストを実行する
8
- * @class NarouNovel
9
- * @private
10
- */
11
- export default class NarouNovel {
12
- /**
13
- * なろう小説APIへの検索リクエストを実行する
14
- * @param params クエリパラメータ
15
- * @param endpoint APIエンドポイント
16
- * @returns {Promise<NarouSearchResults>} 検索結果
17
- */
18
- static execute(params: NarouParams, endpoint?: string): Promise<any>;
19
- static executeSearch(params: any, endpoint?: string): Promise<NarouSearchResults>;
20
- static executeNovel(params: SearchParams): Promise<NarouSearchResults>;
21
- static executeNovel18(params: SearchParams): Promise<NarouSearchResults>;
22
- static executeRanking(params: RankingParams): Promise<NarouRankingResult[]>;
23
- static executeRankingHistory(params: RankingHistoryParams): Promise<RankingHistoryRawResult[]>;
24
- }
25
- export {};
1
+ import { NarouRankingResult } from "./narou-ranking-results";
2
+ import NarouSearchResults from "./narou-search-results";
3
+ import { RankingHistoryParams, RankingParams, SearchParams } from "./params";
4
+ import { RankingHistoryRawResult } from "./ranking-history";
5
+ export declare type NarouParams = SearchParams | RankingParams | RankingHistoryParams;
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(params: NarouParams, endpoint?: string): Promise<NarouSearchResults>;
20
+ executeNovel(params: SearchParams): Promise<NarouSearchResults>;
21
+ executeNovel18(params: SearchParams): Promise<NarouSearchResults>;
22
+ executeRanking(params: RankingParams): Promise<NarouRankingResult[]>;
23
+ executeRankingHistory(params: RankingHistoryParams): Promise<RankingHistoryRawResult[]>;
24
+ }
26
25
  //# sourceMappingURL=narou.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"narou.d.ts","sourceRoot":"","sources":["../src/narou.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,kBAAkB,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,aAAK,WAAW,GAAG,YAAY,GAAG,aAAa,GAAG,oBAAoB,CAAC;AAEvE;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B;;;;;OAKG;WACU,OAAO,CAClB,MAAM,EAAE,WAAW,EACnB,QAAQ,SAAyC,GAChD,OAAO,CAAC,GAAG,CAAC;WAgCF,aAAa,CACxB,MAAM,EAAE,GAAG,EACX,QAAQ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