@rhyster/wow-casc-dbc 2.14.5 → 2.15.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../src/fetcher.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,UAAU;;;;;CAKf,CAAC;AA0HF,eAAO,MAAM,WAAW,GACpB,UAAU,MAAM,EAAE,EAClB,KAAK,MAAM,EACX,MAAM,MAAM,OAAO,UAAU,EAC7B,WAAW,MAAM,EACjB,yEAMG;IACC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;CACxB,KACP,OAAO,CAAC,MAAM,CA0BhB,CAAC;AAEF,eAAO,MAAM,aAAa,GACtB,UAAU,MAAM,EAAE,EAClB,KAAK,MAAM,EACX,qCAEG;IACC,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CAChD,KACP,OAAO,CAAC,MAAM,CAGhB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC3B,QAAQ,MAAM,EACd,SAAS,MAAM,KAChB,OAAO,CAAC,MAAM,CAQhB,CAAC;AAEF,eAAO,MAAM,cAAc,GACvB,QAAQ,MAAM,EACd,SAAS,MAAM,KAChB,OAAO,CAAC,MAAM,CAQhB,CAAC"}
1
+ {"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../src/fetcher.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,UAAU;;;;;CAKf,CAAC;AA0HF,eAAO,MAAM,WAAW,GACpB,UAAU,MAAM,EAAE,EAClB,KAAK,MAAM,EACX,MAAM,MAAM,OAAO,UAAU,EAC7B,WAAW,MAAM,EACjB,yEAMG;IACC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;CACxB,KACP,OAAO,CAAC,MAAM,CA0BhB,CAAC;AAEF,eAAO,MAAM,aAAa,GACtB,UAAU,MAAM,EAAE,EAClB,KAAK,MAAM,EACX,qCAEG;IACC,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CAChD,KACP,OAAO,CAAC,MAAM,CAGhB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC3B,QAAQ,MAAM,EACd,SAAS,MAAM,KAChB,OAAO,CAAC,MAAM,CAUhB,CAAC;AAEF,eAAO,MAAM,cAAc,GACvB,QAAQ,MAAM,EACd,SAAS,MAAM,KAChB,OAAO,CAAC,MAAM,CAUhB,CAAC"}
package/dist/index.cjs CHANGED
@@ -6,7 +6,7 @@ const async = require('async');
6
6
  const cliProgress = require('cli-progress');
7
7
  const zlib = require('node:zlib');
8
8
  const fs = require('node:fs/promises');
9
- const http = require('node:http');
9
+ const https = require('node:https');
10
10
  const path = require('node:path');
11
11
 
12
12
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
@@ -16,7 +16,7 @@ const crypto__default = /*#__PURE__*/_interopDefaultCompat(crypto);
16
16
  const cliProgress__default = /*#__PURE__*/_interopDefaultCompat(cliProgress);
17
17
  const zlib__default = /*#__PURE__*/_interopDefaultCompat(zlib);
18
18
  const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
19
- const http__default = /*#__PURE__*/_interopDefaultCompat(http);
19
+ const https__default = /*#__PURE__*/_interopDefaultCompat(https);
20
20
  const path__default = /*#__PURE__*/_interopDefaultCompat(path);
21
21
 
22
22
  const ADB_MAGIC = 1481004104;
@@ -377,7 +377,7 @@ const requestData = async (url, {
377
377
  Range: partialOffset !== void 0 && partialLength !== void 0 ? `bytes=${partialOffset.toString()}-${(partialOffset + partialLength - 1).toString()}` : "bytes=0-"
378
378
  }
379
379
  };
380
- http__default.get(url, options, (res) => {
380
+ https__default.get(url, options, (res) => {
381
381
  if (res.statusCode === 301 || res.statusCode === 302) {
382
382
  if (res.headers.location !== void 0) {
383
383
  requestData(res.headers.location, { partialOffset, partialLength, showProgress }).then(resolve).catch((err) => {
@@ -480,14 +480,14 @@ const getConfigFile = async (prefixes, key, {
480
480
  return downloadBuffer.toString("utf-8");
481
481
  };
482
482
  const getProductVersions = async (region, product) => {
483
- const url = `http://${region}.patch.battle.net:1119/${product}/versions`;
483
+ const url = region !== "cn" ? `https://${region}.version.battle.net/v2/products/${product}/versions` : `https://cn.version.battlenet.com.cn/v2/products/${product}/versions`;
484
484
  const headers = new Headers();
485
485
  headers.set("User-Agent", USER_AGENT);
486
486
  const res = await fetch(url, { headers });
487
487
  return res.text();
488
488
  };
489
489
  const getProductCDNs = async (region, product) => {
490
- const url = `http://${region}.patch.battle.net:1119/${product}/cdns`;
490
+ const url = region !== "cn" ? `https://${region}.version.battle.net/v2/products/${product}/cdns` : `https://cn.version.battlenet.com.cn/v2/products/${product}/cdns`;
491
491
  const headers = new Headers();
492
492
  headers.set("User-Agent", USER_AGENT);
493
493
  const res = await fetch(url, { headers });
@@ -1066,7 +1066,7 @@ const resolveCDNHost = async (hosts, path) => {
1066
1066
  const latencies = await Promise.allSettled(
1067
1067
  hosts.map(async (host) => {
1068
1068
  const start = Date.now();
1069
- await fetch(`http://${host}/`);
1069
+ await fetch(`https://${host}/`);
1070
1070
  const end = Date.now();
1071
1071
  return {
1072
1072
  host,
@@ -1075,7 +1075,7 @@ const resolveCDNHost = async (hosts, path) => {
1075
1075
  })
1076
1076
  );
1077
1077
  const resolved = latencies.filter((result) => result.status === "fulfilled").map((result) => result.value).sort((a, b) => a.latency - b.latency);
1078
- return resolved.map((result) => `http://${result.host}/${path}`);
1078
+ return resolved.map((result) => `https://${result.host}/${path}`);
1079
1079
  };
1080
1080
 
1081
1081
  const WDC5_MAGIC = 1464091445;