Comparing version 2.19.4 to 2.20.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.defaultConfig = void 0; | ||
var mappers_1 = require("./utils/mappers"); | ||
@@ -4,0 +5,0 @@ var https_1 = require("https"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.connectToScorebot = void 0; | ||
var io = require("socket.io-client"); | ||
@@ -4,0 +5,0 @@ var mappers_1 = require("../utils/mappers"); |
@@ -39,2 +39,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getEvent = void 0; | ||
var mappers_1 = require("../utils/mappers"); | ||
@@ -41,0 +42,0 @@ var parsing_1 = require("../utils/parsing"); |
@@ -39,2 +39,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getEvents = void 0; | ||
var mappers_1 = require("../utils/mappers"); | ||
@@ -41,0 +42,0 @@ var EventSize_1 = require("../enums/EventSize"); |
@@ -39,2 +39,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getMatch = void 0; | ||
var MatchStatus_1 = require("../enums/MatchStatus"); | ||
@@ -41,0 +42,0 @@ var parsing_1 = require("../utils/parsing"); |
@@ -46,2 +46,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getMatches = void 0; | ||
var parsing_1 = require("../utils/parsing"); | ||
@@ -56,29 +57,28 @@ var mappers_1 = require("../utils/mappers"); | ||
$ = _a.sent(); | ||
liveMatches = mappers_1.toArray($('.live-match .a-reset')).map(function (matchEl) { | ||
liveMatches = mappers_1.toArray($('.liveMatch .a-reset')).map(function (matchEl) { | ||
var id = Number(matchEl.attr('href').split('/')[2]); | ||
var teamEls = matchEl.find('img.logo'); | ||
var stars = matchEl.find('.stars i').length; | ||
var teamEls = matchEl.find('img.matchTeamLogo'); | ||
var stars = matchEl.find('.matchRating i').length; | ||
var team1 = { | ||
name: teamEls.first().attr('title'), | ||
id: Number(parsing_1.popSlashSource(teamEls.first())) || undefined | ||
id: Number(parsing_1.popSlashSource(teamEls.first())) || undefined, | ||
}; | ||
var team2 = { | ||
name: teamEls.last().attr('title'), | ||
id: Number(parsing_1.popSlashSource(teamEls.last())) || undefined | ||
id: Number(parsing_1.popSlashSource(teamEls.last())) || undefined, | ||
}; | ||
var format = matchEl.find('.bestof').text(); | ||
var maps = mappers_1.toArray(matchEl.find('.header .map')).map(parsing_1.text); | ||
var format = matchEl.find('.matchMeta').text(); | ||
var event = { | ||
name: matchEl.find('.event-logo').attr('title'), | ||
id: Number(parsing_1.popSlashSource(matchEl.find('.event-logo')).split('.')[0]) || undefined | ||
name: matchEl.find('.matchEventLogo').attr('title'), | ||
id: Number(parsing_1.popSlashSource(matchEl.find('.matchEventLogo')).split('.')[0]) || undefined, | ||
}; | ||
return { id: id, team1: team1, team2: team2, event: event, format: format, maps: maps, stars: stars, live: true }; | ||
return { id: id, team1: team1, team2: team2, event: event, format: format, stars: stars, live: true }; | ||
}); | ||
upcomingMatches = mappers_1.toArray($('.upcoming-match')).map(function (matchEl) { | ||
upcomingMatches = mappers_1.toArray($('.upcomingMatch ')).map(function (matchEl) { | ||
var link = matchEl.find('.a-reset'); | ||
var id = Number(link.attr('href').split('/')[2]); | ||
var date = Number(matchEl.find('div.time').attr('data-unix')) || undefined; | ||
var title = matchEl.find('.placeholder-text-cell').text() || undefined; | ||
var stars = matchEl.find('.stars i').length; | ||
var _a = mappers_1.getMatchFormatAndMap(matchEl.find('.map-text').text()), map = _a.map, format = _a.format; | ||
var date = Number(matchEl.find('.matchTime').attr('data-unix')) || undefined; | ||
var title = matchEl.find('.matchInfoEmpty').text() || undefined; | ||
var stars = matchEl.find('.matchRating i').length; | ||
var format = matchEl.find('.matchMeta').text(); | ||
var event; | ||
@@ -89,23 +89,17 @@ var team1; | ||
team1 = { | ||
name: matchEl | ||
.find('div.team') | ||
.first() | ||
.text(), | ||
id: Number(parsing_1.popSlashSource(matchEl.find('img.logo').first())) || undefined | ||
name: matchEl.find('.team1 .matchTeamName').text(), | ||
id: Number(parsing_1.popSlashSource(matchEl.find('.team1 .matchTeamLogo'))) || undefined, | ||
}; | ||
team2 = { | ||
name: matchEl | ||
.find('div.team') | ||
.last() | ||
.text(), | ||
id: matchEl.find('img.logo').get(1) | ||
? Number(parsing_1.popSlashSource($(matchEl.find('img.logo').last()))) | ||
: undefined | ||
name: matchEl.find('.team2 .matchTeamName').text() || matchEl.find('.team2 .team').text(), | ||
id: matchEl.find('.team2 .matchTeamLogo').length | ||
? Number(parsing_1.popSlashSource(matchEl.find('.team2 .matchTeamLogo'))) || undefined | ||
: undefined, | ||
}; | ||
event = { | ||
name: matchEl.find('.event-logo').attr('alt'), | ||
id: Number(parsing_1.popSlashSource(matchEl.find('img.event-logo')).split('.')[0]) || undefined | ||
name: matchEl.find('.matchEventLogo').attr('alt'), | ||
id: Number(parsing_1.popSlashSource(matchEl.find('.matchEventLogo')).split('.')[0]) || undefined, | ||
}; | ||
} | ||
return { id: id, date: date, team1: team1, team2: team2, format: format, map: map, title: title, event: event, stars: stars, live: false }; | ||
return { id: id, date: date, team1: team1, team2: team2, format: format, title: title, event: event, stars: stars, live: false }; | ||
}); | ||
@@ -112,0 +106,0 @@ return [2, __spreadArrays(liveMatches, upcomingMatches)]; |
@@ -46,2 +46,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getMatchesStats = void 0; | ||
var mappers_1 = require("../utils/mappers"); | ||
@@ -48,0 +49,0 @@ exports.getMatchesStats = function (config) { return function (_a) { |
@@ -50,2 +50,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getMatchMapStats = void 0; | ||
var parsing_1 = require("../utils/parsing"); | ||
@@ -52,0 +53,0 @@ var mappers_1 = require("../utils/mappers"); |
@@ -50,2 +50,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getMatchStats = void 0; | ||
var parsing_1 = require("../utils/parsing"); | ||
@@ -52,0 +53,0 @@ var mappers_1 = require("../utils/mappers"); |
@@ -39,2 +39,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getPlayer = void 0; | ||
var mappers_1 = require("../utils/mappers"); | ||
@@ -41,0 +42,0 @@ var parsing_1 = require("../utils/parsing"); |
@@ -39,2 +39,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getPlayerByName = void 0; | ||
var index_1 = require("../index"); | ||
@@ -41,0 +42,0 @@ exports.getPlayerByName = function (config) { return function (_a) { |
@@ -39,2 +39,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getPlayerRanking = void 0; | ||
var querystring_1 = require("querystring"); | ||
@@ -41,0 +42,0 @@ var mappers_1 = require("../utils/mappers"); |
@@ -39,2 +39,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getPlayerStats = void 0; | ||
var querystring_1 = require("querystring"); | ||
@@ -41,0 +42,0 @@ var mappers_1 = require("../utils/mappers"); |
@@ -39,2 +39,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getRecentThreads = void 0; | ||
var mappers_1 = require("../utils/mappers"); | ||
@@ -41,0 +42,0 @@ exports.getRecentThreads = function (config) { return function () { return __awaiter(void 0, void 0, void 0, function () { |
@@ -39,2 +39,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getResults = void 0; | ||
var parsing_1 = require("../utils/parsing"); | ||
@@ -41,0 +42,0 @@ var mappers_1 = require("../utils/mappers"); |
@@ -50,2 +50,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getStreams = void 0; | ||
var parsing_1 = require("../utils/parsing"); | ||
@@ -52,0 +53,0 @@ var mappers_1 = require("../utils/mappers"); |
@@ -39,2 +39,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getTeam = void 0; | ||
var mappers_1 = require("../utils/mappers"); | ||
@@ -41,0 +42,0 @@ var parsing_1 = require("../utils/parsing"); |
@@ -39,2 +39,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getTeamRanking = void 0; | ||
var mappers_1 = require("../utils/mappers"); | ||
@@ -41,0 +42,0 @@ var parsing_1 = require("../utils/parsing"); |
@@ -39,2 +39,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getTeamStats = void 0; | ||
var mappers_1 = require("../utils/mappers"); | ||
@@ -41,0 +42,0 @@ var parsing_1 = require("../utils/parsing"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ContentFilter = void 0; | ||
var ContentFilter; | ||
@@ -4,0 +5,0 @@ (function (ContentFilter) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.EventSize = void 0; | ||
var EventSize; | ||
@@ -4,0 +5,0 @@ (function (EventSize) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.EventType = void 0; | ||
var EventType; | ||
@@ -4,0 +5,0 @@ (function (EventType) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Map = void 0; | ||
var Map; | ||
@@ -4,0 +5,0 @@ (function (Map) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MapSlug = void 0; | ||
var MapSlug; | ||
@@ -4,0 +5,0 @@ (function (MapSlug) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MatchStatus = void 0; | ||
var MatchStatus; | ||
@@ -4,0 +5,0 @@ (function (MatchStatus) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MatchType = void 0; | ||
var MatchType; | ||
@@ -4,0 +5,0 @@ (function (MatchType) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.RankingFilter = void 0; | ||
var RankingFilter; | ||
@@ -4,0 +5,0 @@ (function (RankingFilter) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.StreamCategory = void 0; | ||
var StreamCategory; | ||
@@ -4,0 +5,0 @@ (function (StreamCategory) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ThreadCategory = void 0; | ||
var ThreadCategory; | ||
@@ -4,0 +5,0 @@ (function (ThreadCategory) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.WinType = void 0; | ||
var WinType; | ||
@@ -4,0 +5,0 @@ (function (WinType) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ContentFilter = exports.EventSize = exports.WinType = exports.ThreadCategory = exports.StreamCategory = exports.RankingFilter = exports.MatchType = exports.Map = exports.MapSlug = exports.HLTV = exports.HLTVFactory = void 0; | ||
var config_1 = require("./config"); | ||
@@ -22,19 +23,19 @@ var connectToScorebot_1 = require("./endpoints/connectToScorebot"); | ||
var MapSlug_1 = require("./enums/MapSlug"); | ||
exports.MapSlug = MapSlug_1.MapSlug; | ||
Object.defineProperty(exports, "MapSlug", { enumerable: true, get: function () { return MapSlug_1.MapSlug; } }); | ||
var Map_1 = require("./enums/Map"); | ||
exports.Map = Map_1.Map; | ||
Object.defineProperty(exports, "Map", { enumerable: true, get: function () { return Map_1.Map; } }); | ||
var MatchType_1 = require("./enums/MatchType"); | ||
exports.MatchType = MatchType_1.MatchType; | ||
Object.defineProperty(exports, "MatchType", { enumerable: true, get: function () { return MatchType_1.MatchType; } }); | ||
var RankingFilter_1 = require("./enums/RankingFilter"); | ||
exports.RankingFilter = RankingFilter_1.RankingFilter; | ||
Object.defineProperty(exports, "RankingFilter", { enumerable: true, get: function () { return RankingFilter_1.RankingFilter; } }); | ||
var StreamCategory_1 = require("./enums/StreamCategory"); | ||
exports.StreamCategory = StreamCategory_1.StreamCategory; | ||
Object.defineProperty(exports, "StreamCategory", { enumerable: true, get: function () { return StreamCategory_1.StreamCategory; } }); | ||
var ThreadCategory_1 = require("./enums/ThreadCategory"); | ||
exports.ThreadCategory = ThreadCategory_1.ThreadCategory; | ||
Object.defineProperty(exports, "ThreadCategory", { enumerable: true, get: function () { return ThreadCategory_1.ThreadCategory; } }); | ||
var ContentFilter_1 = require("./enums/ContentFilter"); | ||
exports.ContentFilter = ContentFilter_1.ContentFilter; | ||
Object.defineProperty(exports, "ContentFilter", { enumerable: true, get: function () { return ContentFilter_1.ContentFilter; } }); | ||
var EventSize_1 = require("./enums/EventSize"); | ||
exports.EventSize = EventSize_1.EventSize; | ||
Object.defineProperty(exports, "EventSize", { enumerable: true, get: function () { return EventSize_1.EventSize; } }); | ||
var WinType_1 = require("./enums/WinType"); | ||
exports.WinType = WinType_1.WinType; | ||
Object.defineProperty(exports, "WinType", { enumerable: true, get: function () { return WinType_1.WinType; } }); | ||
var getEvents_1 = require("./endpoints/getEvents"); | ||
@@ -41,0 +42,0 @@ var mappers_1 = require("./utils/mappers"); |
import { Team } from './Team'; | ||
import { Event } from './Event'; | ||
import { MapSlug } from '../enums/MapSlug'; | ||
export interface LiveMatch { | ||
@@ -10,5 +9,4 @@ readonly id: number; | ||
readonly event: Event; | ||
readonly maps: MapSlug[]; | ||
readonly live: true; | ||
readonly stars: number; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Outcome = void 0; | ||
var Outcome; | ||
@@ -4,0 +5,0 @@ (function (Outcome) { |
import { Team } from './Team'; | ||
import { Event } from './Event'; | ||
import { MapSlug } from '../enums/MapSlug'; | ||
export interface UpcomingMatch { | ||
@@ -11,3 +10,2 @@ readonly id: number; | ||
readonly event?: Event; | ||
readonly map?: MapSlug; | ||
readonly title?: string; | ||
@@ -14,0 +12,0 @@ readonly live: false; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
/// <reference types="cheerio" /> | ||
@@ -17,6 +16,6 @@ import { Team } from '../models/Team'; | ||
export declare const getMatchFormatAndMap: (mapText: string) => { | ||
map?: MapSlug | undefined; | ||
format?: string | undefined; | ||
map?: MapSlug; | ||
format?: string; | ||
}; | ||
export declare const mapRoundElementToModel: (team1Id: number, team2Id: number) => (el: Cheerio, i: number, allRoundEls: Cheerio[]) => WeakRoundOutcome; | ||
export declare const getTimestamp: (source: string) => number; |
@@ -39,2 +39,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getTimestamp = exports.mapRoundElementToModel = exports.getMatchFormatAndMap = exports.getMatchPlayer = exports.mapVetoElementToModel = exports.getMapSlug = exports.toArray = exports.fetchPage = exports.defaultLoadPage = void 0; | ||
var cheerio = require("cheerio"); | ||
@@ -41,0 +42,0 @@ var request = require("request"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.percentageToDecimalOdd = exports.popSlashSource = exports.hasNoChild = exports.hasChild = exports.prev = exports.text = void 0; | ||
exports.text = function (el) { return el.text(); }; | ||
@@ -4,0 +5,0 @@ exports.prev = function (el) { return el.prev(); }; |
{ | ||
"name": "hltv", | ||
"version": "2.19.4", | ||
"version": "2.20.0", | ||
"description": "The unofficial HLTV Node.js API", | ||
@@ -50,3 +50,3 @@ "main": "lib/index.js", | ||
"@types/cheerio": "^0.22.9", | ||
"@types/jest": "^25.1.1", | ||
"@types/jest": "^26.0.0", | ||
"@types/request": "^2.47.1", | ||
@@ -53,0 +53,0 @@ "@types/socket.io-client": "^1.4.32", |
@@ -20,8 +20,10 @@ { | ||
"emitDecoratorMetadata": true, | ||
"skipLibCheck": true | ||
"skipLibCheck": true, | ||
"isolatedModules": true | ||
}, | ||
"exclude": [ | ||
"__tests__", | ||
"node_modules/**/*" | ||
"node_modules/**/*", | ||
"src/playground.ts" | ||
] | ||
} |
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
200602
3837
135