@rhyster/wow-casc-dbc 2.6.18 → 2.7.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.
Files changed (56) hide show
  1. package/dist/adb.d.ts +17 -0
  2. package/dist/adb.d.ts.map +1 -0
  3. package/dist/blte.d.ts +25 -0
  4. package/dist/blte.d.ts.map +1 -0
  5. package/dist/client.d.ts +84 -0
  6. package/dist/client.d.ts.map +1 -0
  7. package/dist/dbd.d.ts +26 -0
  8. package/dist/dbd.d.ts.map +1 -0
  9. package/dist/fetcher.d.ts +21 -0
  10. package/dist/fetcher.d.ts.map +1 -0
  11. package/dist/index.cjs +72 -107
  12. package/dist/index.cjs.map +1 -0
  13. package/dist/index.d.ts +9 -261
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.mjs +72 -107
  16. package/dist/index.mjs.map +1 -0
  17. package/dist/jenkins96.d.ts +3 -0
  18. package/dist/jenkins96.d.ts.map +1 -0
  19. package/dist/parsers/archiveIndex.d.ts +9 -0
  20. package/dist/parsers/archiveIndex.d.ts.map +1 -0
  21. package/dist/parsers/config.d.ts +40 -0
  22. package/dist/parsers/config.d.ts.map +1 -0
  23. package/dist/parsers/encodingFile.d.ts +11 -0
  24. package/dist/parsers/encodingFile.d.ts.map +1 -0
  25. package/dist/parsers/productConfig.d.ts +21 -0
  26. package/dist/parsers/productConfig.d.ts.map +1 -0
  27. package/dist/parsers/rootFile.d.ts +45 -0
  28. package/dist/parsers/rootFile.d.ts.map +1 -0
  29. package/dist/salsa20.d.ts +14 -0
  30. package/dist/salsa20.d.ts.map +1 -0
  31. package/dist/store.d.ts +9 -0
  32. package/dist/store.d.ts.map +1 -0
  33. package/dist/test/salsa20.test.d.ts +2 -0
  34. package/dist/test/salsa20.test.d.ts.map +1 -0
  35. package/dist/utils.d.ts +3 -0
  36. package/dist/utils.d.ts.map +1 -0
  37. package/dist/wdc.d.ts +104 -0
  38. package/dist/wdc.d.ts.map +1 -0
  39. package/package.json +5 -4
  40. package/src/adb.ts +70 -0
  41. package/src/blte.ts +220 -0
  42. package/src/client.ts +411 -0
  43. package/src/dbd.ts +427 -0
  44. package/src/fetcher.ts +223 -0
  45. package/src/index.ts +44 -0
  46. package/src/jenkins96.ts +75 -0
  47. package/src/parsers/archiveIndex.ts +119 -0
  48. package/src/parsers/config.ts +75 -0
  49. package/src/parsers/encodingFile.ts +159 -0
  50. package/src/parsers/productConfig.ts +57 -0
  51. package/src/parsers/rootFile.ts +172 -0
  52. package/src/salsa20.ts +143 -0
  53. package/src/store.ts +37 -0
  54. package/src/test/salsa20.test.ts +522 -0
  55. package/src/utils.ts +77 -0
  56. package/src/wdc.ts +788 -0
package/dist/adb.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ export interface HotfixEntry {
2
+ regionID: number;
3
+ pushID: number;
4
+ uniqueID: number;
5
+ tableHash: number;
6
+ recordID: number;
7
+ dataSize: number;
8
+ recordState: number;
9
+ data: Buffer;
10
+ }
11
+ export default class ADBReader {
12
+ build: number;
13
+ entries: HotfixEntry[];
14
+ tableEntries: Map<number, HotfixEntry[]>;
15
+ constructor(buffer: Buffer);
16
+ }
17
+ //# sourceMappingURL=adb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adb.d.ts","sourceRoot":"","sources":["../src/adb.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,OAAO,SAAS;IACnB,KAAK,EAAE,MAAM,CAAC;IAEd,OAAO,EAAE,WAAW,EAAE,CAAM;IAE5B,YAAY,6BAAoC;gBAE3C,MAAM,EAAE,MAAM;CA+C7B"}
package/dist/blte.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ interface Block {
2
+ compressedSize: number;
3
+ decompressedSize: number;
4
+ hash: string;
5
+ }
6
+ interface MissingKeyBlock {
7
+ offset: number;
8
+ size: number;
9
+ blockIndex: number;
10
+ keyName: string;
11
+ }
12
+ export default class BLTEReader {
13
+ buffer: Buffer;
14
+ readonly blte: Buffer;
15
+ readonly blocks: Block[];
16
+ readonly keys: Map<string, Uint8Array>;
17
+ private processedBlock;
18
+ private processedOffset;
19
+ constructor(buffer: Buffer, eKey: string, keys?: Map<string, Uint8Array<ArrayBufferLike>>);
20
+ private processBlock;
21
+ processBytes(allowMissingKey?: false, size?: number): undefined;
22
+ processBytes(allowMissingKey: true, size?: number): MissingKeyBlock[];
23
+ }
24
+ export type { MissingKeyBlock };
25
+ //# sourceMappingURL=blte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blte.d.ts","sourceRoot":"","sources":["../src/blte.ts"],"names":[],"mappings":"AAMA,UAAU,KAAK;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,eAAe;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACnB;AAMD,MAAM,CAAC,OAAO,OAAO,UAAU;IACpB,MAAM,EAAE,MAAM,CAAC;IAEtB,SAAgB,IAAI,EAAE,MAAM,CAAC;IAE7B,SAAgB,MAAM,EAAE,KAAK,EAAE,CAAM;IAErC,SAAgB,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAE9C,OAAO,CAAC,cAAc,CAAK;IAE3B,OAAO,CAAC,eAAe,CAAK;gBAEhB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,2CAAgC;IA0D9E,OAAO,CAAC,YAAY;IA+DpB,YAAY,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS;IAC/D,YAAY,CAAC,eAAe,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,eAAe,EAAE;CA2DxE;AAED,YAAY,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,84 @@
1
+ import type ADBReader from './adb.ts';
2
+ import type { MissingKeyBlock } from './blte.ts';
3
+ import type { ArchiveIndex } from './parsers/archiveIndex.ts';
4
+ import type { EncodingData } from './parsers/encodingFile.ts';
5
+ import type { Version } from './parsers/productConfig.ts';
6
+ import type { FileInfo, RootData } from './parsers/rootFile.ts';
7
+ interface ClientPreloadData {
8
+ prefixes: string[];
9
+ archives: Map<string, ArchiveIndex>;
10
+ encoding: EncodingData;
11
+ rootFile: RootData;
12
+ }
13
+ interface FileFetchResultFull {
14
+ type: 'full';
15
+ buffer: Buffer;
16
+ blocks: undefined;
17
+ }
18
+ interface FileFetchResultPartial {
19
+ type: 'partial';
20
+ buffer: Buffer;
21
+ blocks: MissingKeyBlock[];
22
+ }
23
+ type FileFetchResult = FileFetchResultFull | FileFetchResultPartial;
24
+ declare enum LogLevel {
25
+ error = 0,
26
+ warn = 1,
27
+ info = 2,
28
+ debug = 3
29
+ }
30
+ export default class CASCClient {
31
+ readonly region: string;
32
+ readonly product: string;
33
+ readonly version: Version;
34
+ readonly name2FileDataID: Map<string, number>;
35
+ readonly keys: Map<string, Uint8Array<ArrayBufferLike>>;
36
+ preload?: ClientPreloadData;
37
+ static getProductVersion(region: string, product: string): Promise<Version | undefined>;
38
+ static LocaleFlags: {
39
+ readonly enUS: 2;
40
+ readonly koKR: 4;
41
+ readonly frFR: 16;
42
+ readonly deDE: 32;
43
+ readonly zhCN: 64;
44
+ readonly esES: 128;
45
+ readonly zhTW: 256;
46
+ readonly enGB: 512;
47
+ readonly esMX: 4096;
48
+ readonly ruRU: 8192;
49
+ readonly ptBR: 16384;
50
+ readonly itIT: 32768;
51
+ readonly ptPT: 65536;
52
+ };
53
+ static ContentFlags: {
54
+ readonly Install: 4;
55
+ readonly LoadOnWindows: 8;
56
+ readonly LoadOnMacOS: 16;
57
+ readonly x86_32: 32;
58
+ readonly x86_64: 64;
59
+ readonly LowViolence: 128;
60
+ readonly DoNotLoad: 256;
61
+ readonly UpdatePlugin: 2048;
62
+ readonly ARM64: 32768;
63
+ readonly Encrypted: 134217728;
64
+ readonly NoNameHash: 268435456;
65
+ readonly UncommonResolution: 536870912;
66
+ readonly Bundle: 1073741824;
67
+ readonly NoCompression: 2147483648;
68
+ };
69
+ static LogLevel: typeof LogLevel;
70
+ logLevel: LogLevel;
71
+ constructor(region: string, product: string, version: Version, logLevel?: LogLevel);
72
+ private log;
73
+ init(): Promise<void>;
74
+ loadRemoteListFile(): Promise<void>;
75
+ loadRemoteTACTKeys(): Promise<void>;
76
+ loadTACTKeys(): Promise<void>;
77
+ loadBroadcastTACTKeys(adb: ADBReader): void;
78
+ getFileDataIDByName(name: string): number | undefined;
79
+ getContentKeysByFileDataID(fileDataID: number): FileInfo[] | undefined;
80
+ getFileByContentKey(cKey: string, allowMissingKey?: false): Promise<FileFetchResultFull>;
81
+ getFileByContentKey(cKey: string, allowMissingKey: true): Promise<FileFetchResult>;
82
+ }
83
+ export type { Version, ClientPreloadData, ArchiveIndex, EncodingData, RootData, FileInfo, FileFetchResultFull, FileFetchResultPartial, FileFetchResult, MissingKeyBlock, };
84
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,SAAS,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEhE,UAAU,iBAAiB;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACpC,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;CACtB;AAED,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,CAAC;CACrB;AAED,UAAU,sBAAsB;IAC5B,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED,KAAK,eAAe,GAAG,mBAAmB,GAAG,sBAAsB,CAAC;AAEpE,aAAK,QAAQ;IACT,KAAK,IAAI;IACT,IAAI,IAAI;IACR,IAAI,IAAI;IACR,KAAK,IAAI;CACZ;AASD,MAAM,CAAC,OAAO,OAAO,UAAU;IAC3B,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B,SAAgB,OAAO,EAAE,MAAM,CAAC;IAEhC,SAAgB,OAAO,EAAE,OAAO,CAAC;IAEjC,SAAgB,eAAe,sBAA6B;IAE5D,SAAgB,IAAI,2CAAiC;IAE9C,OAAO,CAAC,EAAE,iBAAiB,CAAC;WAEtB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;IAO7F,OAAc,WAAW;;;;;;;;;;;;;;MAAe;IAGxC,OAAc,YAAY;;;;;;;;;;;;;;;MAAgB;IAG1C,OAAc,QAAQ,kBAAY;IAE3B,QAAQ,EAAE,QAAQ,CAAC;gBAEd,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,WAAgB;IAOvF,OAAO,CAAC,GAAG;IAUL,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA+GrB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAWnC,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBnC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAqCnC,qBAAqB,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI;IAkC3C,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAUrD,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,EAAE,GAAG,SAAS;IAQhE,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,mBAAmB,CAAC;IACxF,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,GAAG,OAAO,CAAC,eAAe,CAAC;CAyD3F;AAED,YAAY,EACR,OAAO,EACP,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,eAAe,GAClB,CAAC"}
package/dist/dbd.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ import type WDCReader from './wdc.ts';
2
+ interface Column {
3
+ name: string;
4
+ type: string;
5
+ isID: boolean;
6
+ isInline: boolean;
7
+ isRelation: boolean;
8
+ isSigned: boolean;
9
+ size?: number;
10
+ arraySize?: number;
11
+ }
12
+ type BasicColumnData = number | bigint | string | undefined;
13
+ type ColumnData = BasicColumnData | BasicColumnData[];
14
+ export default class DBDParser {
15
+ readonly wdc: WDCReader;
16
+ readonly definitions: Map<string, string>;
17
+ columns: Column[];
18
+ private cache;
19
+ private constructor();
20
+ private init;
21
+ static parse(wdc: WDCReader): Promise<DBDParser>;
22
+ getAllIDs(): number[];
23
+ getRowData(id: number): Record<string, ColumnData> | undefined;
24
+ }
25
+ export type { Column, ColumnData, BasicColumnData, };
26
+ //# sourceMappingURL=dbd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dbd.d.ts","sourceRoot":"","sources":["../src/dbd.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,SAAS,MAAM,UAAU,CAAC;AAStC,UAAU,MAAM;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,KAAK,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAE5D,KAAK,UAAU,GAAG,eAAe,GAAG,eAAe,EAAE,CAAC;AA8DtD,MAAM,CAAC,OAAO,OAAO,SAAS;IAC1B,SAAgB,GAAG,EAAE,SAAS,CAAC;IAE/B,SAAgB,WAAW,sBAA6B;IAEjD,OAAO,EAAE,MAAM,EAAE,CAAM;IAE9B,OAAO,CAAC,KAAK,CAAiD;IAE9D,OAAO;YAIO,IAAI;WAqFL,KAAK,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAQtD,SAAS,IAAI,MAAM,EAAE;IAIrB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,SAAS;CAgOjE;AAED,YAAY,EACR,MAAM,EACN,UAAU,EACV,eAAe,GAClB,CAAC"}
@@ -0,0 +1,21 @@
1
+ declare const CACHE_DIRS: {
2
+ build: string;
3
+ indexes: string;
4
+ data: string;
5
+ dbd: string;
6
+ };
7
+ export declare const getDataFile: (prefixes: string[], key: string, type: keyof typeof CACHE_DIRS, buildCKey: string, { name, partialOffset, partialLength, showProgress, showAttemptFail, }?: {
8
+ name?: string;
9
+ partialOffset?: number;
10
+ partialLength?: number;
11
+ showProgress?: boolean;
12
+ showAttemptFail?: boolean;
13
+ }) => Promise<Buffer>;
14
+ export declare const getConfigFile: (prefixes: string[], key: string, { showProgress, showAttemptFail, }?: {
15
+ showProgress?: boolean;
16
+ showAttemptFail?: boolean;
17
+ }) => Promise<string>;
18
+ export declare const getProductVersions: (region: string, product: string) => Promise<string>;
19
+ export declare const getProductCDNs: (region: string, product: string) => Promise<string>;
20
+ export {};
21
+ //# sourceMappingURL=fetcher.d.ts.map
@@ -0,0 +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,aACV,MAAM,EAAE,OACb,MAAM,QACL,MAAM,OAAO,UAAU,aAClB,MAAM,2EAOd;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;CAC7B,KACF,OAAO,CAAC,MAAM,CA0BhB,CAAC;AAEF,eAAO,MAAM,aAAa,aACZ,MAAM,EAAE,OACb,MAAM,uCAGR;IACC,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CACrD,KACF,OAAO,CAAC,MAAM,CAGhB,CAAC;AAEF,eAAO,MAAM,kBAAkB,WACnB,MAAM,WACL,MAAM,KAChB,OAAO,CAAC,MAAM,CAQhB,CAAC;AAEF,eAAO,MAAM,cAAc,WACf,MAAM,WACL,MAAM,KAChB,OAAO,CAAC,MAAM,CAQhB,CAAC"}
package/dist/index.cjs CHANGED
@@ -19,18 +19,12 @@ const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
19
19
  const http__default = /*#__PURE__*/_interopDefaultCompat(http);
20
20
  const path__default = /*#__PURE__*/_interopDefaultCompat(path);
21
21
 
22
- var __defProp$6 = Object.defineProperty;
23
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
24
- var __publicField$6 = (obj, key, value) => {
25
- __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
26
- return value;
27
- };
28
22
  const ADB_MAGIC = 1481004104;
29
23
  class ADBReader {
24
+ build;
25
+ entries = [];
26
+ tableEntries = /* @__PURE__ */ new Map();
30
27
  constructor(buffer) {
31
- __publicField$6(this, "build");
32
- __publicField$6(this, "entries", []);
33
- __publicField$6(this, "tableEntries", /* @__PURE__ */ new Map());
34
28
  const magic = buffer.readUInt32BE(0);
35
29
  assert__default(magic === ADB_MAGIC, `[ADB]: Invalid magic: ${magic.toString(16).padStart(8, "0")}`);
36
30
  const version = buffer.readUInt32LE(4);
@@ -70,21 +64,15 @@ class ADBReader {
70
64
  }
71
65
  }
72
66
 
73
- var __defProp$5 = Object.defineProperty;
74
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
75
- var __publicField$5 = (obj, key, value) => {
76
- __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
77
- return value;
78
- };
79
67
  class Salsa20 {
68
+ fixed;
69
+ key;
70
+ nonce;
71
+ counter = new Uint32Array([0, 0]);
72
+ state = new Uint32Array(16);
73
+ block = new Uint8Array(64);
74
+ position = 0;
80
75
  constructor(key, nonce) {
81
- __publicField$5(this, "fixed");
82
- __publicField$5(this, "key");
83
- __publicField$5(this, "nonce");
84
- __publicField$5(this, "counter", new Uint32Array([0, 0]));
85
- __publicField$5(this, "state", new Uint32Array(16));
86
- __publicField$5(this, "block", new Uint8Array(64));
87
- __publicField$5(this, "position", 0);
88
76
  assert__default(key.length === 32 || key.length === 16, "Salsa20 requires 128-bit or 256-bit key");
89
77
  assert__default(nonce.length === 8, "Salsa20 requires 64-bit nonce");
90
78
  this.key = new Uint32Array(8);
@@ -188,23 +176,17 @@ class Salsa20 {
188
176
  }
189
177
  }
190
178
 
191
- var __defProp$4 = Object.defineProperty;
192
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
193
- var __publicField$4 = (obj, key, value) => {
194
- __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
195
- return value;
196
- };
197
179
  const BLTE_MAGIC = 1112298565;
198
180
  const ENC_TYPE_SALSA20 = 83;
199
181
  const EMPTY_HASH = "00000000000000000000000000000000";
200
182
  class BLTEReader {
183
+ buffer;
184
+ blte;
185
+ blocks = [];
186
+ keys;
187
+ processedBlock = 0;
188
+ processedOffset = 0;
201
189
  constructor(buffer, eKey, keys = /* @__PURE__ */ new Map()) {
202
- __publicField$4(this, "buffer");
203
- __publicField$4(this, "blte");
204
- __publicField$4(this, "blocks", []);
205
- __publicField$4(this, "keys");
206
- __publicField$4(this, "processedBlock", 0);
207
- __publicField$4(this, "processedOffset", 0);
208
190
  this.blte = buffer;
209
191
  this.buffer = Buffer.alloc(0);
210
192
  this.keys = keys;
@@ -344,17 +326,11 @@ class BLTEReader {
344
326
  }
345
327
  }
346
328
 
347
- var __defProp$3 = Object.defineProperty;
348
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
349
- var __publicField$3 = (obj, key, value) => {
350
- __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
351
- return value;
352
- };
353
329
  class Store {
330
+ data;
331
+ dataFile;
332
+ promise;
354
333
  constructor(dataFile) {
355
- __publicField$3(this, "data");
356
- __publicField$3(this, "dataFile");
357
- __publicField$3(this, "promise");
358
334
  this.dataFile = dataFile;
359
335
  this.data = {};
360
336
  this.promise = new Promise((resolve) => {
@@ -445,7 +421,7 @@ const downloadFile = (prefixes, type, key, {
445
421
  return urls.reduce(
446
422
  (prev, url, index) => prev.catch((err) => {
447
423
  if (showAttemptFail === true && index > 0 && err instanceof Error) {
448
- console.warn(`${( new Date()).toISOString()} [WARN]:`, err.message);
424
+ console.warn(`${(/* @__PURE__ */ new Date()).toISOString()} [WARN]:`, err.message);
449
425
  }
450
426
  return requestData(url, { partialOffset, partialLength, showProgress });
451
427
  }),
@@ -561,26 +537,37 @@ const hashlittle2 = (key, pc = 0, pb = 0) => {
561
537
  switch (length - offset) {
562
538
  case 12:
563
539
  c += key.charCodeAt(offset + 11) << 24;
540
+ // falls through
564
541
  case 11:
565
542
  c += key.charCodeAt(offset + 10) << 16;
543
+ // falls through
566
544
  case 10:
567
545
  c += key.charCodeAt(offset + 9) << 8;
546
+ // falls through
568
547
  case 9:
569
548
  c += key.charCodeAt(offset + 8);
549
+ // falls through
570
550
  case 8:
571
551
  b += key.charCodeAt(offset + 7) << 24;
552
+ // falls through
572
553
  case 7:
573
554
  b += key.charCodeAt(offset + 6) << 16;
555
+ // falls through
574
556
  case 6:
575
557
  b += key.charCodeAt(offset + 5) << 8;
558
+ // falls through
576
559
  case 5:
577
560
  b += key.charCodeAt(offset + 4);
561
+ // falls through
578
562
  case 4:
579
563
  a += key.charCodeAt(offset + 3) << 24;
564
+ // falls through
580
565
  case 3:
581
566
  a += key.charCodeAt(offset + 2) << 16;
567
+ // falls through
582
568
  case 2:
583
569
  a += key.charCodeAt(offset + 1) << 8;
570
+ // falls through
584
571
  case 1:
585
572
  a += key.charCodeAt(offset + 0);
586
573
  }
@@ -974,18 +961,14 @@ const JEDEC = [
974
961
  "YB"
975
962
  ];
976
963
  const formatFileSize = (input) => {
977
- if (Number.isNaN(input))
978
- return "";
964
+ if (Number.isNaN(input)) return "";
979
965
  let size = Number(input);
980
966
  const isNegative = size < 0;
981
967
  const result = [];
982
- if (isNegative)
983
- size = -size;
968
+ if (isNegative) size = -size;
984
969
  let exponent = Math.floor(Math.log(size) / Math.log(1024));
985
- if (exponent < 0)
986
- exponent = 0;
987
- if (exponent > 8)
988
- exponent = 8;
970
+ if (exponent < 0) exponent = 0;
971
+ if (exponent > 8) exponent = 8;
989
972
  if (size === 0) {
990
973
  result[0] = 0;
991
974
  result[1] = JEDEC[exponent];
@@ -998,8 +981,7 @@ const formatFileSize = (input) => {
998
981
  }
999
982
  result[1] = JEDEC[exponent];
1000
983
  }
1001
- if (isNegative)
1002
- result[0] = -result[0];
984
+ if (isNegative) result[0] = -result[0];
1003
985
  return result.join(" ");
1004
986
  };
1005
987
  const resolveCDNHost = async (hosts, path) => {
@@ -1018,12 +1000,6 @@ const resolveCDNHost = async (hosts, path) => {
1018
1000
  return resolved.map((result) => `http://${result.host}/${path}`);
1019
1001
  };
1020
1002
 
1021
- var __defProp$2 = Object.defineProperty;
1022
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1023
- var __publicField$2 = (obj, key, value) => {
1024
- __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
1025
- return value;
1026
- };
1027
1003
  const WDC5_MAGIC = 1464091445;
1028
1004
  const readBitpackedValue = (buffer, fieldOffsetBits, fieldSizeBits, signed = false) => {
1029
1005
  const offsetBytes = fieldOffsetBits >>> 3;
@@ -1043,18 +1019,18 @@ const readBitpackedValue = (buffer, fieldOffsetBits, fieldSizeBits, signed = fal
1043
1019
  return signed ? BigInt.asIntN(fieldSizeBits, value >> BigInt(bitOffset)) : BigInt.asUintN(fieldSizeBits, value >> BigInt(bitOffset));
1044
1020
  };
1045
1021
  class WDCReader {
1022
+ tableHash;
1023
+ layoutHash;
1024
+ locale;
1025
+ isNormal;
1026
+ hasRelationshipData;
1027
+ fields;
1028
+ fieldsInfo;
1029
+ rows = /* @__PURE__ */ new Map();
1030
+ relationships = /* @__PURE__ */ new Map();
1031
+ copyTable = /* @__PURE__ */ new Map();
1032
+ hotfixes = /* @__PURE__ */ new Map();
1046
1033
  constructor(buffer, blocks = [], adb) {
1047
- __publicField$2(this, "tableHash");
1048
- __publicField$2(this, "layoutHash");
1049
- __publicField$2(this, "locale");
1050
- __publicField$2(this, "isNormal");
1051
- __publicField$2(this, "hasRelationshipData");
1052
- __publicField$2(this, "fields");
1053
- __publicField$2(this, "fieldsInfo");
1054
- __publicField$2(this, "rows", /* @__PURE__ */ new Map());
1055
- __publicField$2(this, "relationships", /* @__PURE__ */ new Map());
1056
- __publicField$2(this, "copyTable", /* @__PURE__ */ new Map());
1057
- __publicField$2(this, "hotfixes", /* @__PURE__ */ new Map());
1058
1034
  const magic = buffer.readUInt32BE(0);
1059
1035
  const fieldCount = buffer.readUInt32LE(140);
1060
1036
  const recordSize = buffer.readUInt32LE(144);
@@ -1511,12 +1487,6 @@ class WDCReader {
1511
1487
  }
1512
1488
  }
1513
1489
 
1514
- var __defProp$1 = Object.defineProperty;
1515
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1516
- var __publicField$1 = (obj, key, value) => {
1517
- __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
1518
- return value;
1519
- };
1520
1490
  var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
1521
1491
  LogLevel2[LogLevel2["error"] = 0] = "error";
1522
1492
  LogLevel2[LogLevel2["warn"] = 1] = "warn";
@@ -1531,30 +1501,36 @@ const textLogLevel = [
1531
1501
  "DEBUG"
1532
1502
  ];
1533
1503
  class CASCClient {
1504
+ region;
1505
+ product;
1506
+ version;
1507
+ name2FileDataID = /* @__PURE__ */ new Map();
1508
+ keys = /* @__PURE__ */ new Map();
1509
+ preload;
1510
+ static async getProductVersion(region, product) {
1511
+ const versionsText = await getProductVersions(region, product);
1512
+ const versions = parseProductVersions(versionsText);
1513
+ return versions.find((version) => version.Region === region);
1514
+ }
1515
+ // eslint-disable-next-line @typescript-eslint/naming-convention
1516
+ static LocaleFlags = LocaleFlags;
1517
+ // eslint-disable-next-line @typescript-eslint/naming-convention
1518
+ static ContentFlags = ContentFlags;
1519
+ // eslint-disable-next-line @typescript-eslint/naming-convention
1520
+ static LogLevel = LogLevel;
1521
+ logLevel;
1534
1522
  constructor(region, product, version, logLevel = 2 /* info */) {
1535
- __publicField$1(this, "region");
1536
- __publicField$1(this, "product");
1537
- __publicField$1(this, "version");
1538
- __publicField$1(this, "name2FileDataID", /* @__PURE__ */ new Map());
1539
- __publicField$1(this, "keys", /* @__PURE__ */ new Map());
1540
- __publicField$1(this, "preload");
1541
- __publicField$1(this, "logLevel");
1542
1523
  this.region = region;
1543
1524
  this.product = product;
1544
1525
  this.version = version;
1545
1526
  this.logLevel = logLevel;
1546
1527
  }
1547
- static async getProductVersion(region, product) {
1548
- const versionsText = await getProductVersions(region, product);
1549
- const versions = parseProductVersions(versionsText);
1550
- return versions.find((version) => version.Region === region);
1551
- }
1552
1528
  log(level, message) {
1553
1529
  if (level <= this.logLevel) {
1554
1530
  if (level <= 0 /* error */) {
1555
- console.error(`${( new Date()).toISOString()} [${textLogLevel[level]}]:`, message);
1531
+ console.error(`${(/* @__PURE__ */ new Date()).toISOString()} [${textLogLevel[level]}]:`, message);
1556
1532
  } else {
1557
- console.info(`${( new Date()).toISOString()} [${textLogLevel[level]}]:`, message);
1533
+ console.info(`${(/* @__PURE__ */ new Date()).toISOString()} [${textLogLevel[level]}]:`, message);
1558
1534
  }
1559
1535
  }
1560
1536
  }
@@ -1781,19 +1757,7 @@ class CASCClient {
1781
1757
  };
1782
1758
  }
1783
1759
  }
1784
- // eslint-disable-next-line @typescript-eslint/naming-convention
1785
- __publicField$1(CASCClient, "LocaleFlags", LocaleFlags);
1786
- // eslint-disable-next-line @typescript-eslint/naming-convention
1787
- __publicField$1(CASCClient, "ContentFlags", ContentFlags);
1788
- // eslint-disable-next-line @typescript-eslint/naming-convention
1789
- __publicField$1(CASCClient, "LogLevel", LogLevel);
1790
1760
 
1791
- var __defProp = Object.defineProperty;
1792
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1793
- var __publicField = (obj, key, value) => {
1794
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
1795
- return value;
1796
- };
1797
1761
  const PATTERN_COLUMN = /^(int|float|locstring|string)(<[^:]+::[^>]+>)?\s([^\s]+)/;
1798
1762
  const PATTERN_LAYOUT = /^LAYOUT\s(.*)/;
1799
1763
  const PATTERN_FIELD = /^(\$([^$]+)\$)?([^<[]+)(<(u|)(\d+)>)?(\[(\d+)\])?$/;
@@ -1835,11 +1799,11 @@ const getCastBuffer = (value, srcSize, dstSize) => {
1835
1799
  return castBuffer;
1836
1800
  };
1837
1801
  class DBDParser {
1802
+ wdc;
1803
+ definitions = /* @__PURE__ */ new Map();
1804
+ columns = [];
1805
+ cache = /* @__PURE__ */ new Map();
1838
1806
  constructor(wdc) {
1839
- __publicField(this, "wdc");
1840
- __publicField(this, "definitions", /* @__PURE__ */ new Map());
1841
- __publicField(this, "columns", []);
1842
- __publicField(this, "cache", /* @__PURE__ */ new Map());
1843
1807
  this.wdc = wdc;
1844
1808
  }
1845
1809
  async init() {
@@ -2106,3 +2070,4 @@ exports.ADBReader = ADBReader;
2106
2070
  exports.CASCClient = CASCClient;
2107
2071
  exports.DBDParser = DBDParser;
2108
2072
  exports.WDCReader = WDCReader;
2073
+ //# sourceMappingURL=index.cjs.map