Comparing version 0.0.3 to 0.1.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [0.1.0](https://github.com/TomokiMiyauci/sitemap-pinger/compare/v0.0.3...v0.1.0) (2020-11-04) | ||
### Features | ||
* **sitemaping/*:** add core feature ([07de716](https://github.com/TomokiMiyauci/sitemap-pinger/commit/07de7165178948991772976c96f32532b7bd583a)) | ||
## [0.0.3](https://github.com/TomokiMiyauci/sitemap-pinger/compare/v0.0.2...v0.0.3) (2020-11-03) | ||
@@ -8,0 +19,0 @@ |
import SearchEngine from './search-engine'; | ||
export declare class Google implements SearchEngine { | ||
sitemapUrl: string; | ||
baseUrl: string; | ||
constructor(); | ||
ping: () => Promise<number>; | ||
export declare class Google extends SearchEngine { | ||
private sitemapUrl; | ||
constructor(sitemapUrl?: string); | ||
ping: (sitemapUrl?: string | undefined) => Promise<number | never>; | ||
} |
@@ -6,22 +6,28 @@ "use strict"; | ||
var got_1 = tslib_1.__importDefault(require("got")); | ||
var constrans_1 = require("./constrans"); | ||
var constant_1 = require("./constant"); | ||
var search_engine_1 = tslib_1.__importDefault(require("./search-engine")); | ||
var http = got_1["default"].extend({ | ||
prefixUrl: constrans_1.BASE_URL_GOOGLE | ||
prefixUrl: constant_1.BASE_URL_GOOGLE | ||
}); | ||
var Google = /** @class */ (function () { | ||
function Google() { | ||
var _this = this; | ||
this.baseUrl = ''; | ||
this.ping = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () { | ||
var result; | ||
var Google = /** @class */ (function (_super) { | ||
tslib_1.__extends(Google, _super); | ||
function Google(sitemapUrl) { | ||
var _this = _super.call(this) || this; | ||
_this.ping = function (sitemapUrl) { return tslib_1.__awaiter(_this, void 0, void 0, function () { | ||
var url, result; | ||
return tslib_1.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, http.get('', { | ||
searchParams: { | ||
sitemap: 'https://sjfosif.dev/sitemap.xml' | ||
} | ||
})]; | ||
case 0: | ||
url = sitemapUrl || this.sitemapUrl; | ||
if (!url) { | ||
throw Error('Argument error'); | ||
} | ||
return [4 /*yield*/, http.get('', { | ||
searchParams: { | ||
sitemap: url | ||
} | ||
})]; | ||
case 1: | ||
result = _a.sent(); | ||
console.log(result.statusCode); | ||
console.log(result); | ||
return [2 /*return*/, result.statusCode]; | ||
@@ -31,6 +37,7 @@ } | ||
}); }; | ||
this.sitemapUrl = ''; | ||
_this.sitemapUrl = sitemapUrl || ''; | ||
return _this; | ||
} | ||
return Google; | ||
}()); | ||
}(search_engine_1["default"])); | ||
exports.Google = Google; |
export declare abstract class SearchEngine { | ||
sitemapUrl: string; | ||
constructor(sitemapUrl: string); | ||
abstract ping: () => void; | ||
abstract ping(): Promise<number | never>; | ||
} | ||
export default SearchEngine; |
@@ -5,5 +5,3 @@ "use strict"; | ||
var SearchEngine = /** @class */ (function () { | ||
function SearchEngine(sitemapUrl) { | ||
this.ping = function () { }; | ||
this.sitemapUrl = sitemapUrl; | ||
function SearchEngine() { | ||
} | ||
@@ -10,0 +8,0 @@ return SearchEngine; |
{ | ||
"name": "sitemaping", | ||
"version": "0.0.3", | ||
"version": "0.1.0", | ||
"description": "Sitemap ping requester", | ||
@@ -21,3 +21,5 @@ "author": "TomokiMiyauci <development.operation.6.6.6@gmail.com>", | ||
"devDependencies": { | ||
"jest": "^26.6.1", | ||
"@types/jest": "^26.0.15", | ||
"jest": "^26.6.3", | ||
"ts-jest": "^26.4.3", | ||
"ts-node": "^9.0.0" | ||
@@ -33,3 +35,3 @@ }, | ||
}, | ||
"gitHead": "ece51b5ff7769eb3272dc4b767b9c0e81dceedbe" | ||
"gitHead": "e31b1817579d441c558604b778ec772d74c1ff86" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4604
80
4