@rhyster/wow-casc-dbc 2.14.4 → 2.15.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhyster/wow-casc-dbc",
3
- "version": "2.14.4",
3
+ "version": "2.15.0",
4
4
  "description": "Fetch World of Warcraft data files from CASC and parse DBC/DB2 files.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -51,5 +51,5 @@
51
51
  "async": "^3.2.6",
52
52
  "cli-progress": "^3.12.0"
53
53
  },
54
- "packageManager": "pnpm@10.33.4"
54
+ "packageManager": "pnpm@11.0.9"
55
55
  }
package/src/fetcher.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import crypto from 'node:crypto';
2
2
  import fs from 'node:fs/promises';
3
- import http from 'node:http';
3
+ import https from 'node:https';
4
4
  import path from 'node:path';
5
5
 
6
6
  import cliProgress from 'cli-progress';
@@ -46,7 +46,7 @@ const requestData = async (
46
46
  },
47
47
  };
48
48
 
49
- http.get(url, options, (res) => {
49
+ https.get(url, options, (res) => {
50
50
  if (res.statusCode === 301 || res.statusCode === 302) {
51
51
  if (res.headers.location !== undefined) {
52
52
  requestData(res.headers.location, { partialOffset, partialLength, showProgress })
@@ -200,7 +200,9 @@ export const getProductVersions = async (
200
200
  region: string,
201
201
  product: string,
202
202
  ): Promise<string> => {
203
- const url = `http://${region}.patch.battle.net:1119/${product}/versions`;
203
+ const url = region !== 'cn'
204
+ ? `https://${region}.version.battle.net/v2/products/${product}/versions`
205
+ : `https://cn.version.battlenet.com.cn/v2/products/${product}/versions`;
204
206
  const headers = new Headers();
205
207
  headers.set('User-Agent', USER_AGENT);
206
208
 
@@ -213,7 +215,9 @@ export const getProductCDNs = async (
213
215
  region: string,
214
216
  product: string,
215
217
  ): Promise<string> => {
216
- const url = `http://${region}.patch.battle.net:1119/${product}/cdns`;
218
+ const url = region !== 'cn'
219
+ ? `https://${region}.version.battle.net/v2/products/${product}/cdns`
220
+ : `https://cn.version.battlenet.com.cn/v2/products/${product}/cdns`;
217
221
  const headers = new Headers();
218
222
  headers.set('User-Agent', USER_AGENT);
219
223
 
package/src/utils.ts CHANGED
@@ -57,7 +57,7 @@ export const resolveCDNHost = async (
57
57
  const latencies = await Promise.allSettled(
58
58
  hosts.map(async (host) => {
59
59
  const start = Date.now();
60
- await fetch(`http://${host}/`);
60
+ await fetch(`https://${host}/`);
61
61
  const end = Date.now();
62
62
  return {
63
63
  host,
@@ -73,5 +73,5 @@ export const resolveCDNHost = async (
73
73
  .map((result) => result.value)
74
74
  .sort((a, b) => a.latency - b.latency);
75
75
 
76
- return resolved.map((result) => `http://${result.host}/${path}`);
76
+ return resolved.map((result) => `https://${result.host}/${path}`);
77
77
  };