Socket
Socket
Sign inDemoInstall

blizzapi

Package Overview
Dependencies
2
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.3 to 1.3.4

18

dist/classes/BlizzAPI.d.ts

@@ -12,4 +12,4 @@ import BattleNetAPI from './abstract/BattleNetAPI';

static getAllRegionNames: () => string[];
static getRegionNameById: (regionId: string | number) => import("../types").RegionNameArray;
static validateRegionId: (regionId: string | number) => boolean;
static getRegionNameById: (regionId: import("../types").RegionIdAsNumberOrString) => import("../types").RegionNameArray;
static validateRegionId: (regionId: import("../types").RegionIdAsNumberOrString) => boolean;
static getRegionIdByName: (regionName: string) => number;

@@ -19,15 +19,15 @@ static validateRegionName: (regionName: string) => boolean;

static getAllLocaleNames: () => string[];
static getLocalesByRegionId: (regionId: string | number) => import("../types").LocaleArray;
static getLocalesByRegionId: (regionId: import("../types").RegionIdAsNumberOrString) => import("../types").LocaleArray;
static checkIfLocaleLooksValid: (locale: string) => boolean;
static validateLocale: (locale: string) => boolean;
static isLocaleValidForRegionId: (locale: string, regionId: string | number) => boolean;
static isLocaleValidForRegionId: (locale: string, regionId: import("../types").RegionIdAsNumberOrString) => boolean;
static getAllSc2Realms: () => Readonly<import("../types").RegionIdProperties<import("../types").Sc2RealmArray>>;
static getAllAvailableSc2Realms: () => import("../types").Sc2RealmList;
static getSc2RealmsByRegionId: (regionId: string | number) => import("../types").Sc2RealmList;
static checkIfSc2RealmLooksValid: (sc2Realm: string | number) => boolean;
static validateSc2Realm: (sc2Realm: string | number) => boolean;
static isSc2RealmValidForRegionId: (sc2Realm: string | number, regionId: string | number) => boolean;
static getDefaultLocaleNameForRegionId: (regionId: string | number) => string;
static getSc2RealmsByRegionId: (regionId: import("../types").RegionIdAsNumberOrString) => import("../types").Sc2RealmList;
static checkIfSc2RealmLooksValid: (sc2Realm: import("../types").Sc2RealmAsNumberOrString) => boolean;
static validateSc2Realm: (sc2Realm: import("../types").Sc2RealmAsNumberOrString) => boolean;
static isSc2RealmValidForRegionId: (sc2Realm: import("../types").Sc2RealmAsNumberOrString, regionId: import("../types").RegionIdAsNumberOrString) => boolean;
static getDefaultLocaleNameForRegionId: (regionId: import("../types").RegionIdAsNumberOrString) => string;
static getAllDefaultLocaleNames: () => import("../types").RegionIdProperties<string>;
}
//# sourceMappingURL=BlizzAPI.d.ts.map

@@ -9,4 +9,5 @@ "use strict";

const common_1 = require("../common");
exports.getAllApiHosts = () => constants_1.default.REGION_API_HOSTS;
exports.getApiHostByRegion = (regionIdOrName) => {
const getAllApiHosts = () => constants_1.default.REGION_API_HOSTS;
exports.getAllApiHosts = getAllApiHosts;
const getApiHostByRegion = (regionIdOrName) => {
const apiHost = common_1.getConstantByRegion(regionIdOrName, 'REGION_API_HOSTS');

@@ -19,2 +20,3 @@ return typeof regionIdOrName === 'string' && regionIdOrName.toLowerCase() === 'kr'

};
exports.getApiHostByRegion = getApiHostByRegion;
//# sourceMappingURL=regionHosts.js.map

@@ -9,3 +9,3 @@ "use strict";

const regions_1 = require("../localization/regions");
exports.getConstantByRegionId = (regionId, constantKey) => {
const getConstantByRegionId = (regionId, constantKey) => {
const regionIdAsString = typeof regionId !== 'string'

@@ -20,3 +20,4 @@ ? regionId

};
exports.getConstantByRegionName = (regionName, constantKey) => {
exports.getConstantByRegionId = getConstantByRegionId;
const getConstantByRegionName = (regionName, constantKey) => {
const isRegionNameValid = regions_1.validateRegionName(regionName);

@@ -29,5 +30,7 @@ if (!isRegionNameValid) {

};
exports.getConstantByRegion = (regionIdOrName, constantKey) => (regions_1.validateRegionId(regionIdOrName)
exports.getConstantByRegionName = getConstantByRegionName;
const getConstantByRegion = (regionIdOrName, constantKey) => (regions_1.validateRegionId(regionIdOrName)
? exports.getConstantByRegionId(regionIdOrName, constantKey)
: exports.getConstantByRegionName(regionIdOrName.toString(), constantKey));
exports.getConstantByRegion = getConstantByRegion;
//# sourceMappingURL=index.js.map

@@ -10,4 +10,5 @@ "use strict";

const locales_1 = require("./locales");
exports.getAllDefaultLocaleIndexes = () => constants_1.default.DEFAULT_LOCALES;
exports.getDefaultLocaleIndexForRegionId = (regionId) => {
const getAllDefaultLocaleIndexes = () => constants_1.default.DEFAULT_LOCALES;
exports.getAllDefaultLocaleIndexes = getAllDefaultLocaleIndexes;
const getDefaultLocaleIndexForRegionId = (regionId) => {
const regionIdAsString = regionId.toString();

@@ -20,3 +21,4 @@ const isRegionIdValid = regions_1.validateRegionId(regionIdAsString);

};
exports.getDefaultLocaleNameForRegionId = (regionId) => {
exports.getDefaultLocaleIndexForRegionId = getDefaultLocaleIndexForRegionId;
const getDefaultLocaleNameForRegionId = (regionId) => {
const regionIdAsString = regionId.toString();

@@ -30,3 +32,4 @@ const isRegionIdValid = regions_1.validateRegionId(regionIdAsString);

};
exports.getAllDefaultLocaleNames = () => {
exports.getDefaultLocaleNameForRegionId = getDefaultLocaleNameForRegionId;
const getAllDefaultLocaleNames = () => {
const allLocales = locales_1.getAllLocales();

@@ -38,2 +41,3 @@ const allLocaleKeys = Object.keys(allLocales);

};
exports.getAllDefaultLocaleNames = getAllDefaultLocaleNames;
//# sourceMappingURL=defaultLocales.js.map

@@ -10,4 +10,5 @@ "use strict";

const common_1 = require("../common");
exports.getAllLocales = () => constants_1.default.LOCALES;
exports.getAllLocaleNames = () => {
const getAllLocales = () => constants_1.default.LOCALES;
exports.getAllLocales = getAllLocales;
const getAllLocaleNames = () => {
const locales = Object.values(constants_1.default.LOCALES);

@@ -18,4 +19,6 @@ const flattenedLocales = [].concat(...locales);

};
exports.getLocalesByRegionId = (regionId) => common_1.getConstantByRegionId(regionId, 'LOCALES');
exports.checkIfLocaleLooksValid = (locale) => {
exports.getAllLocaleNames = getAllLocaleNames;
const getLocalesByRegionId = (regionId) => common_1.getConstantByRegionId(regionId, 'LOCALES');
exports.getLocalesByRegionId = getLocalesByRegionId;
const checkIfLocaleLooksValid = (locale) => {
const localeRegexPattern = /^(?:[a-z]{2}_[a-z]{2})$/gi;

@@ -25,3 +28,4 @@ const doesLocaleLookValid = localeRegexPattern.test(locale);

};
exports.validateLocale = (locale) => {
exports.checkIfLocaleLooksValid = checkIfLocaleLooksValid;
const validateLocale = (locale) => {
const doesLocaleLookValid = exports.checkIfLocaleLooksValid(locale);

@@ -35,3 +39,4 @@ if (!doesLocaleLookValid) {

};
exports.isLocaleValidForRegionId = (locale, regionId) => {
exports.validateLocale = validateLocale;
const isLocaleValidForRegionId = (locale, regionId) => {
const lowerCaseLocale = locale.toLowerCase();

@@ -50,2 +55,3 @@ const doesLocaleLookValid = exports.validateLocale(lowerCaseLocale) || false;

};
exports.isLocaleValidForRegionId = isLocaleValidForRegionId;
//# sourceMappingURL=locales.js.map

@@ -8,8 +8,10 @@ "use strict";

const constants_1 = __importDefault(require("../../constants"));
exports.getAllRegions = () => constants_1.default.REGIONS;
exports.getAllRegionIds = () => {
const getAllRegions = () => constants_1.default.REGIONS;
exports.getAllRegions = getAllRegions;
const getAllRegionIds = () => {
const regionKeys = Object.keys(constants_1.default.REGIONS);
return regionKeys.map((regionKey) => parseInt(regionKey, 10));
};
exports.getAllRegionNames = () => {
exports.getAllRegionIds = getAllRegionIds;
const getAllRegionNames = () => {
const regionNames = Object.values(constants_1.default.REGIONS);

@@ -19,3 +21,4 @@ const flattenedRegionNames = [].concat(...regionNames);

};
exports.getRegionNameById = (regionId) => {
exports.getAllRegionNames = getAllRegionNames;
const getRegionNameById = (regionId) => {
const regionIds = Object.keys(constants_1.default.REGIONS);

@@ -29,3 +32,4 @@ const regionIdAsString = regionId.toString();

};
exports.validateRegionId = (regionId) => {
exports.getRegionNameById = getRegionNameById;
const validateRegionId = (regionId) => {
try {

@@ -38,3 +42,4 @@ return Boolean(exports.getRegionNameById(regionId));

};
exports.getRegionIdByName = (regionName) => {
exports.validateRegionId = validateRegionId;
const getRegionIdByName = (regionName) => {
const regionNameLowercase = regionName.toLowerCase();

@@ -50,3 +55,4 @@ const regions = constants_1.default.REGIONS;

};
exports.validateRegionName = (regionName) => {
exports.getRegionIdByName = getRegionIdByName;
const validateRegionName = (regionName) => {
try {

@@ -59,2 +65,3 @@ return Boolean(exports.getRegionIdByName(regionName));

};
exports.validateRegionName = validateRegionName;
//# sourceMappingURL=regions.js.map

@@ -10,4 +10,5 @@ "use strict";

const common_1 = require("../common");
exports.getAllSc2Realms = () => constants_1.default.SC2_REALMS;
exports.getAllAvailableSc2Realms = () => {
const getAllSc2Realms = () => constants_1.default.SC2_REALMS;
exports.getAllSc2Realms = getAllSc2Realms;
const getAllAvailableSc2Realms = () => {
const sc2Realms = Object.values(constants_1.default.SC2_REALMS);

@@ -17,4 +18,6 @@ const flattenedSc2Realms = [].concat(...sc2Realms);

};
exports.getSc2RealmsByRegionId = (regionId) => common_1.getConstantByRegionId(regionId, 'SC2_REALMS');
exports.checkIfSc2RealmLooksValid = (sc2Realm) => {
exports.getAllAvailableSc2Realms = getAllAvailableSc2Realms;
const getSc2RealmsByRegionId = (regionId) => common_1.getConstantByRegionId(regionId, 'SC2_REALMS');
exports.getSc2RealmsByRegionId = getSc2RealmsByRegionId;
const checkIfSc2RealmLooksValid = (sc2Realm) => {
const sc2RealmAsString = sc2Realm.toString();

@@ -25,3 +28,4 @@ const sc2RealmRegexPattern = /^([1-9]{1})$/gi;

};
exports.validateSc2Realm = (sc2Realm) => {
exports.checkIfSc2RealmLooksValid = checkIfSc2RealmLooksValid;
const validateSc2Realm = (sc2Realm) => {
const doesSc2RealmLookValid = exports.checkIfSc2RealmLooksValid(sc2Realm);

@@ -35,3 +39,4 @@ if (!doesSc2RealmLookValid) {

};
exports.isSc2RealmValidForRegionId = (sc2Realm, regionId) => {
exports.validateSc2Realm = validateSc2Realm;
const isSc2RealmValidForRegionId = (sc2Realm, regionId) => {
const doesSc2RealmLookValid = exports.checkIfSc2RealmLooksValid(sc2Realm);

@@ -50,2 +55,3 @@ const regionIdAsString = regionId.toString();

};
exports.isSc2RealmValidForRegionId = isSc2RealmValidForRegionId;
//# sourceMappingURL=sc2Realms.js.map

@@ -9,4 +9,6 @@ "use strict";

const common_1 = require("../common");
exports.getAllAuthorizeUris = () => constants_1.default.OAUTH_AUTHORIZE_URIS;
exports.getAuthorizeUriByRegion = (regionIdOrName) => common_1.getConstantByRegion(regionIdOrName, 'OAUTH_AUTHORIZE_URIS');
const getAllAuthorizeUris = () => constants_1.default.OAUTH_AUTHORIZE_URIS;
exports.getAllAuthorizeUris = getAllAuthorizeUris;
const getAuthorizeUriByRegion = (regionIdOrName) => common_1.getConstantByRegion(regionIdOrName, 'OAUTH_AUTHORIZE_URIS');
exports.getAuthorizeUriByRegion = getAuthorizeUriByRegion;
//# sourceMappingURL=authorizeUris.js.map

@@ -9,4 +9,6 @@ "use strict";

const common_1 = require("../common");
exports.getAllCheckTokenUris = () => constants_1.default.OAUTH_CHECK_TOKEN_URIS;
exports.getCheckTokenUriByRegion = (regionIdOrName) => common_1.getConstantByRegion(regionIdOrName, 'OAUTH_CHECK_TOKEN_URIS');
const getAllCheckTokenUris = () => constants_1.default.OAUTH_CHECK_TOKEN_URIS;
exports.getAllCheckTokenUris = getAllCheckTokenUris;
const getCheckTokenUriByRegion = (regionIdOrName) => common_1.getConstantByRegion(regionIdOrName, 'OAUTH_CHECK_TOKEN_URIS');
exports.getCheckTokenUriByRegion = getCheckTokenUriByRegion;
//# sourceMappingURL=checkTokenUris.js.map

@@ -9,4 +9,6 @@ "use strict";

const common_1 = require("../common");
exports.getAllTokenUris = () => constants_1.default.OAUTH_TOKEN_URIS;
exports.getTokenUriByRegion = (regionIdOrName) => common_1.getConstantByRegion(regionIdOrName, 'OAUTH_TOKEN_URIS');
const getAllTokenUris = () => constants_1.default.OAUTH_TOKEN_URIS;
exports.getAllTokenUris = getAllTokenUris;
const getTokenUriByRegion = (regionIdOrName) => common_1.getConstantByRegion(regionIdOrName, 'OAUTH_TOKEN_URIS');
exports.getTokenUriByRegion = getTokenUriByRegion;
//# sourceMappingURL=tokenUris.js.map
{
"name": "blizzapi",
"version": "1.3.3",
"version": "1.3.4",
"description": "Flexible and feature-rich Node.js library for Blizzard Battle.net API",

@@ -41,17 +41,17 @@ "homepage": "https://blizzapi.lukem.net",

"dependencies": {
"axios": "^0.21.0"
"axios": "^0.21.1"
},
"devDependencies": {
"@types/jest": "^26.0.15",
"@types/jest": "^26.0.23",
"@types/node": "^14.14.7",
"@typescript-eslint/eslint-plugin": "^4.7.0",
"@typescript-eslint/parser": "^4.7.0",
"eslint": "^7.13.0",
"eslint-config-airbnb-typescript": "^12.0.0",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"eslint": "^7.25.0",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.1.0",
"eslint-plugin-jest": "^24.3.6",
"jest": "^26.6.3",
"rimraf": "^3.0.2",
"ts-jest": "^26.4.4",
"typescript": "^4.0.5"
"ts-jest": "^26.5.5",
"typescript": "^4.2.4"
},

@@ -58,0 +58,0 @@ "keywords": [

@@ -6,5 +6,4 @@ <img src="https://raw.githubusercontent.com/lukemnet/blizzapi-docs/master/docs/.vuepress/public/logo.png" alt="BlizzAPI logo" width="200" height="200">

[![npm (latest)](https://img.shields.io/npm/v/blizzapi/latest.svg)](https://www.npmjs.com/package/blizzapi)
[![Travis CI Build Status](https://travis-ci.com/lukemnet/blizzapi.svg?branch=master)](https://travis-ci.com/lukemnet/blizzapi)
[![Maintainability](https://api.codeclimate.com/v1/badges/8c2b8e4efe8441ad055f/maintainability)](https://codeclimate.com/github/lukemnet/blizzapi/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/8c2b8e4efe8441ad055f/test_coverage)](https://codeclimate.com/github/lukemnet/blizzapi/test_coverage)
[![Build status](https://ci.appveyor.com/api/projects/status/r7pjg9an30d5dupk/branch/master?svg=true)](https://ci.appveyor.com/project/lwojcik/blizzapi/branch/master)
[![codecov](https://codecov.io/gh/lukemnet/blizzapi/branch/master/graph/badge.svg?token=M3vY98GiIn)](https://codecov.io/gh/lukemnet/blizzapi)

@@ -11,0 +10,0 @@ Flexible feature-rich library for easy access to [Battle.net API](https://develop.battle.net/).

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc