neozipkit 0.2.1 → 0.3.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 (301) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +410 -186
  3. package/contracts/ABI.txt +889 -0
  4. package/contracts/Bytecode.txt +1 -0
  5. package/contracts/COMPILATION_NOTES.md +59 -0
  6. package/contracts/QUICK_DEPLOY.md +286 -0
  7. package/contracts/README.md +235 -131
  8. package/contracts/VERIFICATION.md +308 -0
  9. package/contracts/deploy-interactive.js +448 -0
  10. package/contracts/deployment-arbitrum-sepolia.json +12 -0
  11. package/contracts/deployment-arbitrum.json +12 -0
  12. package/contracts/deployment-eth-sepolia.json +12 -0
  13. package/contracts/hardhat.config.js +114 -0
  14. package/contracts/package.json +20 -0
  15. package/contracts/scripts/compile-and-extract.js +119 -0
  16. package/contracts/scripts/verify-contract.js +223 -0
  17. package/contracts/src/{NZIP-NFT-Private.sol → NZIP-NFT-v2.0.sol} +66 -151
  18. package/contracts/src/NZIP-NFT.sol +9 -15
  19. package/dist/blockchain/browser/TokenVerifierBrowser.d.ts +67 -0
  20. package/dist/blockchain/browser/TokenVerifierBrowser.d.ts.map +1 -0
  21. package/dist/blockchain/browser/TokenVerifierBrowser.js +313 -0
  22. package/dist/blockchain/browser/TokenVerifierBrowser.js.map +1 -0
  23. package/dist/blockchain/browser/WalletManagerBrowser.d.ts +98 -0
  24. package/dist/blockchain/browser/WalletManagerBrowser.d.ts.map +1 -0
  25. package/dist/blockchain/browser/WalletManagerBrowser.js +434 -0
  26. package/dist/blockchain/browser/WalletManagerBrowser.js.map +1 -0
  27. package/dist/blockchain/browser/ZipkitMinterBrowser.d.ts +58 -0
  28. package/dist/blockchain/browser/ZipkitMinterBrowser.d.ts.map +1 -0
  29. package/dist/blockchain/browser/ZipkitMinterBrowser.js +317 -0
  30. package/dist/blockchain/browser/ZipkitMinterBrowser.js.map +1 -0
  31. package/dist/blockchain/browser/index.d.ts +11 -0
  32. package/dist/blockchain/browser/index.d.ts.map +1 -0
  33. package/dist/blockchain/browser/index.js +16 -0
  34. package/dist/blockchain/browser/index.js.map +1 -0
  35. package/dist/blockchain/core/WalletManager.d.ts +124 -0
  36. package/dist/blockchain/core/WalletManager.d.ts.map +1 -0
  37. package/dist/blockchain/{ZipKitWallet.js → core/WalletManager.js} +157 -177
  38. package/dist/blockchain/core/WalletManager.js.map +1 -0
  39. package/dist/blockchain/{ZipKitMinter.d.ts → core/ZipkitMinter.d.ts} +46 -11
  40. package/dist/blockchain/core/ZipkitMinter.d.ts.map +1 -0
  41. package/dist/blockchain/core/ZipkitMinter.js +548 -0
  42. package/dist/blockchain/core/ZipkitMinter.js.map +1 -0
  43. package/dist/blockchain/{ZipKitOTS.d.ts → core/ZipkitOTS.d.ts} +6 -15
  44. package/dist/blockchain/core/ZipkitOTS.d.ts.map +1 -0
  45. package/dist/blockchain/{ZipKitOTS.js → core/ZipkitOTS.js} +26 -84
  46. package/dist/blockchain/core/ZipkitOTS.js.map +1 -0
  47. package/dist/blockchain/core/ZipkitVerifier.d.ts +177 -0
  48. package/dist/blockchain/core/ZipkitVerifier.d.ts.map +1 -0
  49. package/dist/blockchain/core/ZipkitVerifier.js +632 -0
  50. package/dist/blockchain/core/ZipkitVerifier.js.map +1 -0
  51. package/dist/blockchain/core/contracts.d.ts +83 -0
  52. package/dist/blockchain/core/contracts.d.ts.map +1 -0
  53. package/dist/blockchain/core/contracts.js +341 -0
  54. package/dist/blockchain/core/contracts.js.map +1 -0
  55. package/dist/blockchain/core/index.d.ts +12 -0
  56. package/dist/blockchain/core/index.d.ts.map +1 -0
  57. package/dist/blockchain/core/index.js +59 -0
  58. package/dist/blockchain/core/index.js.map +1 -0
  59. package/dist/blockchain/index.d.ts +11 -7
  60. package/dist/blockchain/index.d.ts.map +1 -0
  61. package/dist/blockchain/index.js +18 -34
  62. package/dist/blockchain/index.js.map +1 -0
  63. package/dist/blockchain/node/WalletManagerNode.d.ts +47 -0
  64. package/dist/blockchain/node/WalletManagerNode.d.ts.map +1 -0
  65. package/dist/blockchain/node/WalletManagerNode.js +203 -0
  66. package/dist/blockchain/node/WalletManagerNode.js.map +1 -0
  67. package/dist/blockchain/node/index.d.ts +12 -0
  68. package/dist/blockchain/node/index.d.ts.map +1 -0
  69. package/dist/blockchain/node/index.js +24 -0
  70. package/dist/blockchain/node/index.js.map +1 -0
  71. package/dist/browser/ZipkitBrowser.d.ts +27 -0
  72. package/dist/browser/ZipkitBrowser.d.ts.map +1 -0
  73. package/dist/browser/{ZipKitBrowser.js → ZipkitBrowser.js} +96 -43
  74. package/dist/browser/ZipkitBrowser.js.map +1 -0
  75. package/dist/browser/index.d.ts +12 -0
  76. package/dist/browser/index.d.ts.map +1 -0
  77. package/dist/browser/index.js +42 -0
  78. package/dist/browser/index.js.map +1 -0
  79. package/dist/browser-esm/index.d.ts +12 -0
  80. package/dist/browser-esm/index.js +59559 -0
  81. package/dist/browser-esm/index.js.map +7 -0
  82. package/dist/browser-umd/index.d.ts +12 -0
  83. package/dist/browser-umd/index.js +59576 -0
  84. package/dist/browser-umd/index.js.map +7 -0
  85. package/dist/browser-umd/index.min.js +63 -0
  86. package/dist/browser.d.ts +8 -14
  87. package/dist/browser.js +13 -28
  88. package/dist/core/ZipCompress.d.ts +99 -0
  89. package/dist/core/ZipCompress.d.ts.map +1 -0
  90. package/dist/core/ZipCompress.js +309 -0
  91. package/dist/core/ZipCompress.js.map +1 -0
  92. package/dist/core/ZipDecompress.d.ts +58 -0
  93. package/dist/core/ZipDecompress.d.ts.map +1 -0
  94. package/dist/core/ZipDecompress.js +172 -0
  95. package/dist/core/ZipDecompress.js.map +1 -0
  96. package/dist/{shared → core}/ZipEntry.d.ts +8 -1
  97. package/dist/core/ZipEntry.d.ts.map +1 -0
  98. package/dist/{shared → core}/ZipEntry.js +225 -82
  99. package/dist/core/ZipEntry.js.map +1 -0
  100. package/dist/core/Zipkit.d.ts +315 -0
  101. package/dist/core/Zipkit.d.ts.map +1 -0
  102. package/dist/core/Zipkit.js +647 -0
  103. package/dist/core/Zipkit.js.map +1 -0
  104. package/dist/core/components/HashCalculator.d.ts +138 -0
  105. package/dist/core/components/HashCalculator.d.ts.map +1 -0
  106. package/dist/core/components/HashCalculator.js +360 -0
  107. package/dist/core/components/HashCalculator.js.map +1 -0
  108. package/dist/core/components/Logger.d.ts +73 -0
  109. package/dist/core/components/Logger.d.ts.map +1 -0
  110. package/dist/core/components/Logger.js +156 -0
  111. package/dist/core/components/Logger.js.map +1 -0
  112. package/dist/core/components/ProgressTracker.d.ts +43 -0
  113. package/dist/core/components/ProgressTracker.d.ts.map +1 -0
  114. package/dist/core/components/ProgressTracker.js +112 -0
  115. package/dist/core/components/ProgressTracker.js.map +1 -0
  116. package/dist/{shared → core}/components/Support.d.ts +1 -0
  117. package/dist/core/components/Support.d.ts.map +1 -0
  118. package/dist/{shared → core}/components/Support.js +1 -0
  119. package/dist/core/components/Support.js.map +1 -0
  120. package/dist/{shared → core}/components/Util.d.ts +7 -2
  121. package/dist/core/components/Util.d.ts.map +1 -0
  122. package/dist/{shared → core}/components/Util.js +14 -34
  123. package/dist/core/components/Util.js.map +1 -0
  124. package/dist/{shared → core}/constants/Errors.d.ts +1 -2
  125. package/dist/core/constants/Errors.d.ts.map +1 -0
  126. package/dist/{shared → core}/constants/Errors.js +1 -3
  127. package/dist/core/constants/Errors.js.map +1 -0
  128. package/dist/{shared → core}/constants/Headers.d.ts +3 -0
  129. package/dist/core/constants/Headers.d.ts.map +1 -0
  130. package/dist/{shared → core}/constants/Headers.js +20 -17
  131. package/dist/core/constants/Headers.js.map +1 -0
  132. package/dist/core/encryption/Manager.d.ts +58 -0
  133. package/dist/core/encryption/Manager.d.ts.map +1 -0
  134. package/dist/core/encryption/Manager.js +121 -0
  135. package/dist/core/encryption/Manager.js.map +1 -0
  136. package/dist/core/encryption/ZipCrypto.d.ts +172 -0
  137. package/dist/core/encryption/ZipCrypto.d.ts.map +1 -0
  138. package/dist/core/encryption/ZipCrypto.js +554 -0
  139. package/dist/core/encryption/ZipCrypto.js.map +1 -0
  140. package/dist/core/encryption/index.d.ts +9 -0
  141. package/dist/core/encryption/index.d.ts.map +1 -0
  142. package/dist/core/encryption/index.js +17 -0
  143. package/dist/core/encryption/index.js.map +1 -0
  144. package/dist/core/encryption/types.d.ts +29 -0
  145. package/dist/core/encryption/types.d.ts.map +1 -0
  146. package/dist/core/encryption/types.js +12 -0
  147. package/dist/core/encryption/types.js.map +1 -0
  148. package/dist/core/index.d.ts +24 -0
  149. package/dist/core/index.d.ts.map +1 -0
  150. package/dist/core/index.js +57 -0
  151. package/dist/core/index.js.map +1 -0
  152. package/dist/core/version.d.ts +5 -0
  153. package/dist/core/version.d.ts.map +1 -0
  154. package/dist/core/version.js +31 -0
  155. package/dist/core/version.js.map +1 -0
  156. package/dist/index.d.ts +8 -18
  157. package/dist/index.d.ts.map +1 -0
  158. package/dist/index.js +29 -35
  159. package/dist/index.js.map +1 -0
  160. package/dist/node/ZipCompressNode.d.ts +123 -0
  161. package/dist/node/ZipCompressNode.d.ts.map +1 -0
  162. package/dist/node/ZipCompressNode.js +576 -0
  163. package/dist/node/ZipCompressNode.js.map +1 -0
  164. package/dist/node/ZipDecompressNode.d.ts +120 -0
  165. package/dist/node/ZipDecompressNode.d.ts.map +1 -0
  166. package/dist/node/ZipDecompressNode.js +461 -0
  167. package/dist/node/ZipDecompressNode.js.map +1 -0
  168. package/dist/node/ZipkitNode.d.ts +406 -0
  169. package/dist/node/ZipkitNode.d.ts.map +1 -0
  170. package/dist/node/ZipkitNode.js +1305 -0
  171. package/dist/node/ZipkitNode.js.map +1 -0
  172. package/dist/node/index.d.ts +26 -0
  173. package/dist/node/index.d.ts.map +1 -0
  174. package/dist/node/index.js +65 -0
  175. package/dist/node/index.js.map +1 -0
  176. package/dist/types/index.d.ts +59 -0
  177. package/dist/types/index.d.ts.map +1 -0
  178. package/dist/types/index.js +36 -1
  179. package/dist/types/index.js.map +1 -0
  180. package/examples/README.md +269 -0
  181. package/examples/blockchain-tokenize.ts +354 -0
  182. package/examples/create-zip.ts +172 -0
  183. package/examples/extract-zip.ts +158 -0
  184. package/examples/list-zip.ts +161 -0
  185. package/examples/test-files/data.json +116 -0
  186. package/examples/test-files/document.md +80 -0
  187. package/examples/test-files/document.txt +2 -0
  188. package/examples/test-files/file1.txt +48 -0
  189. package/examples/test-files/file2.txt +80 -0
  190. package/examples/tsconfig.json +44 -0
  191. package/examples/unzip-token.ts +491 -0
  192. package/examples/verify-tokenized-zip.ts +305 -0
  193. package/examples/zip-token.ts +604 -0
  194. package/package.json +108 -24
  195. package/src/blockchain/README.md +59 -66
  196. package/src/{browser/TokenVerifierBrowser.ts-remove → blockchain/browser/TokenVerifierBrowser.ts} +125 -79
  197. package/src/blockchain/browser/WalletManagerBrowser.ts +486 -0
  198. package/src/blockchain/browser/ZipkitMinterBrowser.ts +400 -0
  199. package/src/blockchain/browser/index.ts +13 -0
  200. package/src/blockchain/{ZipKitWallet.ts → core/WalletManager.ts} +241 -143
  201. package/src/blockchain/core/ZipkitMinter.ts +716 -0
  202. package/src/blockchain/{ZipKitOTS.ts → core/ZipkitOTS.ts} +28 -62
  203. package/src/blockchain/core/ZipkitVerifier.ts +853 -0
  204. package/src/blockchain/core/contracts.ts +370 -0
  205. package/src/blockchain/core/index.ts +71 -0
  206. package/src/blockchain/index.ts +21 -55
  207. package/src/blockchain/node/WalletManagerNode.ts +171 -0
  208. package/src/blockchain/node/index.ts +40 -0
  209. package/src/browser/{ZipKitBrowser.ts → ZipkitBrowser.ts} +104 -41
  210. package/src/browser/index.esm.ts +37 -0
  211. package/src/browser/index.ts +25 -0
  212. package/src/core/ZipCompress.ts +398 -0
  213. package/src/core/ZipDecompress.ts +212 -0
  214. package/src/{shared → core}/ZipEntry.ts +240 -90
  215. package/src/core/Zipkit.ts +794 -0
  216. package/src/core/components/HashCalculator.ts +384 -0
  217. package/src/core/components/Logger.ts +180 -0
  218. package/src/core/components/ProgressTracker.ts +134 -0
  219. package/src/{shared → core}/components/Util.ts +12 -34
  220. package/src/{shared → core}/constants/Errors.ts +0 -4
  221. package/src/{shared → core}/constants/Headers.ts +19 -17
  222. package/src/core/encryption/Manager.ts +137 -0
  223. package/src/core/encryption/ZipCrypto.ts +650 -0
  224. package/src/core/encryption/index.ts +15 -0
  225. package/src/core/encryption/types.ts +33 -0
  226. package/src/core/index.ts +34 -0
  227. package/src/core/version.ts +33 -0
  228. package/src/index.ts +54 -25
  229. package/src/node/ZipCompressNode.ts +632 -0
  230. package/src/node/ZipDecompressNode.ts +508 -0
  231. package/src/node/ZipkitNode.ts +1559 -0
  232. package/src/node/index.ts +69 -0
  233. package/src/types/index.ts +131 -1
  234. package/src/types/modules.d.ts +1 -11
  235. package/src/types/opentimestamps.d.ts +1 -23
  236. package/contracts/INTEGRATION.md +0 -338
  237. package/contracts/NETWORKS.md +0 -156
  238. package/contracts/NZIP-NFT-bytecode.txt +0 -1
  239. package/contracts/constants.ts +0 -952
  240. package/contracts/deploy-bytecode.mjs +0 -94
  241. package/dist/blockchain/CertificateToken.d.ts +0 -48
  242. package/dist/blockchain/CertificateToken.js +0 -386
  243. package/dist/blockchain/ZipKitMinter.js +0 -347
  244. package/dist/blockchain/ZipKitNFT.d.ts +0 -3
  245. package/dist/blockchain/ZipKitNFT.js +0 -7
  246. package/dist/blockchain/ZipKitVerifier.d.ts +0 -69
  247. package/dist/blockchain/ZipKitVerifier.js +0 -289
  248. package/dist/blockchain/ZipKitWallet.d.ts +0 -69
  249. package/dist/blockchain/contracts.d.ts +0 -14
  250. package/dist/blockchain/contracts.js +0 -77
  251. package/dist/blockchain/types.d.ts +0 -47
  252. package/dist/blockchain/types.js +0 -30
  253. package/dist/browser/ZipKitBrowser.d.ts +0 -18
  254. package/dist/browser/ZipKitStampBrowser.d.ts +0 -2
  255. package/dist/browser/ZipKitStampBrowser.js +0 -12
  256. package/dist/browser-index.d.ts +0 -18
  257. package/dist/browser-index.js +0 -57
  258. package/dist/server/ZipKitServer.d.ts +0 -74
  259. package/dist/server/ZipKitServer.js +0 -310
  260. package/dist/shared/ZipKit.d.ts +0 -243
  261. package/dist/shared/ZipKit.js +0 -772
  262. package/dist/shared/components/CertificateOTS.d.ts +0 -15
  263. package/dist/shared/components/CertificateOTS.js +0 -116
  264. package/dist/shared/components/FileSys.d.ts +0 -2
  265. package/dist/shared/components/FileSys.js +0 -113
  266. package/dist/shared/components/HashAccumulator.d.ts +0 -55
  267. package/dist/shared/components/HashAccumulator.js +0 -100
  268. package/dist/shared/components/ZipCrypto.d.ts +0 -3
  269. package/dist/shared/components/ZipCrypto.js +0 -78
  270. package/dist/shared/components/merkleTree.d.ts +0 -66
  271. package/dist/shared/components/merkleTree.js +0 -136
  272. package/dist/shared/types/index.d.ts +0 -21
  273. package/dist/shared/types/index.js +0 -3
  274. package/dist/shared/types.d.ts +0 -33
  275. package/dist/shared/types.js +0 -8
  276. package/dist/shared/version.d.ts +0 -2
  277. package/dist/shared/version.js +0 -6
  278. package/src/blockchain/CertificateToken.ts +0 -444
  279. package/src/blockchain/ZipKitMinter.ts +0 -470
  280. package/src/blockchain/ZipKitNFT.ts +0 -12
  281. package/src/blockchain/ZipKitVerifier.ts +0 -382
  282. package/src/blockchain/contracts.ts +0 -88
  283. package/src/blockchain/types.ts +0 -91
  284. package/src/browser/CertificateGeneratorBrowser.ts-remove +0 -498
  285. package/src/browser/ZipKitStampBrowser.ts +0 -9
  286. package/src/browser-index.ts +0 -36
  287. package/src/server/README.md +0 -25
  288. package/src/server/ZipKitServer.ts +0 -305
  289. package/src/shared/ZipKit.ts +0 -881
  290. package/src/shared/components/CertificateOTS.ts +0 -132
  291. package/src/shared/components/FileSys.ts +0 -87
  292. package/src/shared/components/HashAccumulator.ts +0 -113
  293. package/src/shared/components/ZipCrypto.ts +0 -91
  294. package/src/shared/components/merkleTree.ts +0 -162
  295. package/src/shared/types/index.ts +0 -25
  296. package/src/shared/types/modules.d.ts +0 -22
  297. package/src/shared/types/opentimestamps.d.ts +0 -23
  298. package/src/shared/types.d.ts +0 -8
  299. package/src/shared/types.ts +0 -43
  300. package/src/shared/version.ts +0 -3
  301. /package/src/{shared → core}/components/Support.ts +0 -0
@@ -0,0 +1,120 @@
1
+ import ZipkitNode from './ZipkitNode';
2
+ import ZipEntry from '../core/ZipEntry';
3
+ /**
4
+ * ZipDecompressNode - Node.js file-based decompression operations
5
+ *
6
+ * Independent decompression implementation for Node.js environments.
7
+ * All decompression logic is implemented directly without delegating to ZipDecompress.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * const zipkitNode = new ZipkitNode();
12
+ * const decompressNode = new ZipDecompressNode(zipkitNode);
13
+ * await decompressNode.extractToFile(entry, './output/file.txt');
14
+ * ```
15
+ */
16
+ export declare class ZipDecompressNode {
17
+ private zipkitNode;
18
+ private zstdCodec;
19
+ private static loggingEnabled;
20
+ /**
21
+ * Creates a new ZipDecompressNode instance
22
+ * @param zipkitNode - ZipkitNode instance to use for ZIP operations
23
+ */
24
+ constructor(zipkitNode: ZipkitNode);
25
+ /**
26
+ * Internal logging method - only logs if class logging is enabled
27
+ */
28
+ private log;
29
+ /**
30
+ * Extract file directly to disk with true streaming (no memory buffering)
31
+ * Public method that validates file mode and extracts entry to file
32
+ *
33
+ * This method processes chunks as they are decompressed and writes them
34
+ * directly to disk, maintaining minimal memory footprint regardless of file size.
35
+ * This is the recommended method for file extraction to avoid memory issues.
36
+ *
37
+ * @param entry ZIP entry to extract
38
+ * @param outputPath Path where the file should be written
39
+ * @param options Optional extraction options including progress callback
40
+ * @throws Error if not a File-based ZIP
41
+ */
42
+ extractToFile(entry: ZipEntry, outputPath: string, options?: {
43
+ skipHashCheck?: boolean;
44
+ onProgress?: (bytes: number) => void;
45
+ }): Promise<void>;
46
+ /**
47
+ * Read compressed data from file and yield one block at a time
48
+ *
49
+ * MEMORY EFFICIENCY: Yields compressed data chunks one at a time without accumulation.
50
+ * Each chunk is read from disk and yielded immediately, allowing downstream processing
51
+ * (decryption, decompression) to handle one block at a time.
52
+ *
53
+ * @param fileHandle - File handle to read from
54
+ * @param entry - ZIP entry to read compressed data for
55
+ * @param chunkSize - Optional chunk size override (defaults to ZipkitServer's bufferSize)
56
+ * @returns Async generator yielding compressed data chunks one at a time
57
+ */
58
+ private readCompressedDataStream;
59
+ /**
60
+ * Handles: reading compressed data, optional decryption, decompression, hashing, and writing
61
+ * Internal method that takes fileHandle as parameter
62
+ */
63
+ private extractToFileInternal;
64
+ /**
65
+ * Decompress data stream and write to file
66
+ *
67
+ * MEMORY EFFICIENCY: Processes decompressed chunks one at a time.
68
+ * Pipeline: compressedStream → decompressStream() → hashCalc → writeStream
69
+ * - Each decompressed chunk is written immediately without accumulation
70
+ * - Hash calculation is incremental (HashCalculator)
71
+ * - Progress callbacks are invoked per chunk
72
+ *
73
+ * Handles decompression, hash calculation, file writing, and verification.
74
+ * Internal method only
75
+ */
76
+ private unCompressToFile;
77
+ /**
78
+ * Decompress data stream chunk by chunk
79
+ *
80
+ * MEMORY EFFICIENCY: Processes compressed data one block at a time.
81
+ * - For STORED: Passes through chunks unchanged (no accumulation)
82
+ * - For DEFLATED: Uses pako streaming inflate (maintains state across chunks)
83
+ * - For ZSTD: Collects all chunks (ZSTD limitation - requires full buffer)
84
+ *
85
+ * Pipeline: readCompressedDataStream() → DecryptionStream.decrypt() → decompressStream() → writeStream
86
+ *
87
+ * Internal method only
88
+ */
89
+ private decompressStream;
90
+ /**
91
+ * Streaming deflate decompression using pako
92
+ *
93
+ * MEMORY EFFICIENCY: Processes compressed chunks one at a time.
94
+ * - Inflator maintains decompression state across chunks
95
+ * - Decompressed chunks are yielded immediately after processing each compressed chunk
96
+ * - No accumulation of compressed data (except in pako's internal buffers)
97
+ */
98
+ private inflateStream;
99
+ /**
100
+ * Streaming ZSTD decompression
101
+ */
102
+ private zstdDecompressStream;
103
+ /**
104
+ * Inflate data using pako (internal use only)
105
+ */
106
+ private inflate;
107
+ /**
108
+ * Synchronous zstd decompress method for in-memory mode
109
+ * ZSTD codec is guaranteed to be initialized via factory method
110
+ * Internal method only
111
+ */
112
+ private zstdDecompressSync;
113
+ /**
114
+ * Uncompress compressed data buffer (synchronous for in-memory mode)
115
+ * Handles decompression and hash verification
116
+ * Internal method only
117
+ */
118
+ private unCompress;
119
+ }
120
+ //# sourceMappingURL=ZipDecompressNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZipDecompressNode.d.ts","sourceRoot":"","sources":["../../src/node/ZipDecompressNode.ts"],"names":[],"mappings":"AAiBA,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AAoBxC;;;;;;;;;;;;GAYG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,SAAS,CAAkD;IAGnE,OAAO,CAAC,MAAM,CAAC,cAAc,CAAkB;IAE/C;;;OAGG;gBACS,UAAU,EAAE,UAAU;IAQlC;;OAEG;IACH,OAAO,CAAC,GAAG;IAUX;;;;;;;;;;;;OAYG;IACG,aAAa,CACjB,KAAK,EAAE,QAAQ,EACf,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;QACR,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;KACtC,GACA,OAAO,CAAC,IAAI,CAAC;IAkBhB;;;;;;;;;;;OAWG;YACY,wBAAwB;IAqCvC;;;OAGG;YACW,qBAAqB;IAyDnC;;;;;;;;;;;OAWG;YACW,gBAAgB;IA8E9B;;;;;;;;;;;OAWG;YACY,gBAAgB;IAsB/B;;;;;;;OAOG;YACY,aAAa;IA6B5B;;OAEG;YACY,oBAAoB;IAiCnC;;OAEG;IACH,OAAO,CAAC,OAAO;IAMf;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAiB1B;;;;OAIG;IACH,OAAO,CAAC,UAAU;CAyCnB"}
@@ -0,0 +1,461 @@
1
+ "use strict";
2
+ // ======================================
3
+ // ZipDecompressNode.ts - Node.js File-Based Decompression
4
+ // Copyright (c) 2025 NeoWare, Inc. All rights reserved.
5
+ // ======================================
6
+ //
7
+ // LOGGING INSTRUCTIONS:
8
+ // ---------------------
9
+ // To enable/disable logging, set loggingEnabled to true/false in the class:
10
+ // private static loggingEnabled: boolean = true; // Enable logging
11
+ // private static loggingEnabled: boolean = false; // Disable logging
12
+ //
13
+ // Logging respects the global Logger level (debug, info, warn, error, silent).
14
+ // Logger level is automatically set to 'debug' when loggingEnabled is true.
15
+ //
16
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ var desc = Object.getOwnPropertyDescriptor(m, k);
19
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
20
+ desc = { enumerable: true, get: function() { return m[k]; } };
21
+ }
22
+ Object.defineProperty(o, k2, desc);
23
+ }) : (function(o, m, k, k2) {
24
+ if (k2 === undefined) k2 = k;
25
+ o[k2] = m[k];
26
+ }));
27
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
28
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
29
+ }) : function(o, v) {
30
+ o["default"] = v;
31
+ });
32
+ var __importStar = (this && this.__importStar) || (function () {
33
+ var ownKeys = function(o) {
34
+ ownKeys = Object.getOwnPropertyNames || function (o) {
35
+ var ar = [];
36
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
37
+ return ar;
38
+ };
39
+ return ownKeys(o);
40
+ };
41
+ return function (mod) {
42
+ if (mod && mod.__esModule) return mod;
43
+ var result = {};
44
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
45
+ __setModuleDefault(result, mod);
46
+ return result;
47
+ };
48
+ })();
49
+ var __importDefault = (this && this.__importDefault) || function (mod) {
50
+ return (mod && mod.__esModule) ? mod : { "default": mod };
51
+ };
52
+ Object.defineProperty(exports, "__esModule", { value: true });
53
+ exports.ZipDecompressNode = void 0;
54
+ const pako = require('pako');
55
+ const zstd_js_1 = require("@oneidentity/zstd-js");
56
+ const Logger_1 = require("../core/components/Logger");
57
+ const Errors_1 = __importDefault(require("../core/constants/Errors"));
58
+ const Headers_1 = require("../core/constants/Headers");
59
+ const HashCalculator_1 = require("../core/components/HashCalculator");
60
+ const ZipCrypto_1 = require("../core/encryption/ZipCrypto");
61
+ const types_1 = require("../core/encryption/types");
62
+ const fs = __importStar(require("fs"));
63
+ // Module-level singleton for ZSTD (shared across all instances)
64
+ let zstdCodec = null;
65
+ // Async initialization function for zstd
66
+ async function initZstd() {
67
+ if (!zstdCodec) {
68
+ zstdCodec = await (0, zstd_js_1.ZstdInit)();
69
+ }
70
+ return zstdCodec;
71
+ }
72
+ /**
73
+ * ZipDecompressNode - Node.js file-based decompression operations
74
+ *
75
+ * Independent decompression implementation for Node.js environments.
76
+ * All decompression logic is implemented directly without delegating to ZipDecompress.
77
+ *
78
+ * @example
79
+ * ```typescript
80
+ * const zipkitNode = new ZipkitNode();
81
+ * const decompressNode = new ZipDecompressNode(zipkitNode);
82
+ * await decompressNode.extractToFile(entry, './output/file.txt');
83
+ * ```
84
+ */
85
+ class ZipDecompressNode {
86
+ /**
87
+ * Creates a new ZipDecompressNode instance
88
+ * @param zipkitNode - ZipkitNode instance to use for ZIP operations
89
+ */
90
+ constructor(zipkitNode) {
91
+ this.zstdCodec = null;
92
+ this.zipkitNode = zipkitNode;
93
+ // If logging is enabled, ensure Logger level is set to debug
94
+ if (ZipDecompressNode.loggingEnabled) {
95
+ Logger_1.Logger.setLevel('debug');
96
+ }
97
+ }
98
+ /**
99
+ * Internal logging method - only logs if class logging is enabled
100
+ */
101
+ log(...args) {
102
+ if (ZipDecompressNode.loggingEnabled) {
103
+ Logger_1.Logger.debug(`[ZipDecompressNode]`, ...args);
104
+ }
105
+ }
106
+ // ============================================================================
107
+ // File-Based Extraction Methods
108
+ // ============================================================================
109
+ /**
110
+ * Extract file directly to disk with true streaming (no memory buffering)
111
+ * Public method that validates file mode and extracts entry to file
112
+ *
113
+ * This method processes chunks as they are decompressed and writes them
114
+ * directly to disk, maintaining minimal memory footprint regardless of file size.
115
+ * This is the recommended method for file extraction to avoid memory issues.
116
+ *
117
+ * @param entry ZIP entry to extract
118
+ * @param outputPath Path where the file should be written
119
+ * @param options Optional extraction options including progress callback
120
+ * @throws Error if not a File-based ZIP
121
+ */
122
+ async extractToFile(entry, outputPath, options) {
123
+ // Lazy ZSTD initialization
124
+ // Note: ZSTD codec is lazily initialized on first use (module-level singleton)
125
+ if (entry.cmpMethod === Headers_1.CMP_METHOD.ZSTD && !this.zstdCodec) {
126
+ this.zstdCodec = await initZstd();
127
+ }
128
+ // Get fileHandle from zipkitNode (merged from ZipLoadEntriesServer)
129
+ const fileHandle = this.zipkitNode.getFileHandle();
130
+ // Call internal method with fileHandle
131
+ await this.extractToFileInternal(fileHandle, entry, outputPath, options);
132
+ }
133
+ // ============================================================================
134
+ // Internal File-Based Methods
135
+ // ============================================================================
136
+ /**
137
+ * Read compressed data from file and yield one block at a time
138
+ *
139
+ * MEMORY EFFICIENCY: Yields compressed data chunks one at a time without accumulation.
140
+ * Each chunk is read from disk and yielded immediately, allowing downstream processing
141
+ * (decryption, decompression) to handle one block at a time.
142
+ *
143
+ * @param fileHandle - File handle to read from
144
+ * @param entry - ZIP entry to read compressed data for
145
+ * @param chunkSize - Optional chunk size override (defaults to ZipkitServer's bufferSize)
146
+ * @returns Async generator yielding compressed data chunks one at a time
147
+ */
148
+ async *readCompressedDataStream(fileHandle, entry, chunkSize) {
149
+ // Use provided chunkSize or ZipkitServer's default bufferSize
150
+ const effectiveChunkSize = chunkSize || this.zipkitNode.getBufferSize();
151
+ // Read local file header
152
+ const localHeaderBuffer = Buffer.alloc(30);
153
+ await fileHandle.read(localHeaderBuffer, 0, 30, entry.localHdrOffset);
154
+ if (localHeaderBuffer.readUInt32LE(0) !== 0x04034b50) { // LOCAL_HDR.SIGNATURE
155
+ throw new Error(Errors_1.default.INVALID_CEN);
156
+ }
157
+ // Calculate data start position
158
+ const filenameLength = localHeaderBuffer.readUInt16LE(26);
159
+ const extraFieldLength = localHeaderBuffer.readUInt16LE(28);
160
+ const dataStart = entry.localHdrOffset + 30 + filenameLength + extraFieldLength;
161
+ // Yield compressed data in chunks - one block at a time
162
+ let remaining = entry.compressedSize;
163
+ let position = dataStart;
164
+ while (remaining > 0) {
165
+ const currentChunkSize = Math.min(effectiveChunkSize, remaining);
166
+ const chunk = Buffer.alloc(currentChunkSize);
167
+ await fileHandle.read(chunk, 0, currentChunkSize, position);
168
+ this.log(`readCompressedDataStream: Yielding compressed chunk: ${chunk.length} bytes (${remaining} bytes remaining)`);
169
+ yield chunk;
170
+ position += currentChunkSize;
171
+ remaining -= currentChunkSize;
172
+ }
173
+ }
174
+ /**
175
+ * Handles: reading compressed data, optional decryption, decompression, hashing, and writing
176
+ * Internal method that takes fileHandle as parameter
177
+ */
178
+ async extractToFileInternal(fileHandle, entry, outputPath, options) {
179
+ this.log(`extractToFileInternal called for entry: ${entry.filename}`);
180
+ this.log(`Entry isEncrypted: ${entry.isEncrypted}, has password: ${!!this.zipkitNode?.password}`);
181
+ try {
182
+ // Create output stream with overwrite flag to truncate existing files
183
+ const writeStream = fs.createWriteStream(outputPath, { flags: 'w' });
184
+ // Build compressed data stream - yields one block at a time
185
+ let dataStream = this.readCompressedDataStream(fileHandle, entry);
186
+ // Decrypt if needed using password on zipkitNode instance
187
+ // Decryption maintains state across blocks via updateKeys()
188
+ const isEncrypted = entry.isEncrypted && this.zipkitNode?.password;
189
+ if (isEncrypted) {
190
+ this.log(`Starting decryption for entry: ${entry.filename}`);
191
+ // Prepare entry for decryption by parsing local header
192
+ await ZipCrypto_1.DecryptionStream.prepareEntryForDecryption(fileHandle, entry);
193
+ const encryptionMethod = entry.encryptionMethod || types_1.EncryptionMethod.ZIP_CRYPTO;
194
+ this.log(`Creating DecryptionStream with method: ${encryptionMethod}`);
195
+ const decryptor = new ZipCrypto_1.DecryptionStream({
196
+ password: this.zipkitNode.password,
197
+ method: encryptionMethod,
198
+ entry: entry
199
+ });
200
+ this.log(`DecryptionStream created, calling decrypt()...`);
201
+ // Decryption processes one block at a time, maintaining state across blocks
202
+ dataStream = decryptor.decrypt(dataStream);
203
+ this.log(`decrypt() returned, dataStream is now a generator that yields one decrypted block at a time`);
204
+ }
205
+ // Pipeline: readCompressedDataStream() → DecryptionStream.decrypt() → decompressStream() → writeStream
206
+ // Each stage processes one block at a time without accumulation
207
+ await this.unCompressToFile(dataStream, entry, writeStream, {
208
+ skipHashCheck: options?.skipHashCheck,
209
+ onProgress: options?.onProgress,
210
+ outputPath
211
+ });
212
+ }
213
+ catch (error) {
214
+ throw error;
215
+ }
216
+ }
217
+ /**
218
+ * Decompress data stream and write to file
219
+ *
220
+ * MEMORY EFFICIENCY: Processes decompressed chunks one at a time.
221
+ * Pipeline: compressedStream → decompressStream() → hashCalc → writeStream
222
+ * - Each decompressed chunk is written immediately without accumulation
223
+ * - Hash calculation is incremental (HashCalculator)
224
+ * - Progress callbacks are invoked per chunk
225
+ *
226
+ * Handles decompression, hash calculation, file writing, and verification.
227
+ * Internal method only
228
+ */
229
+ async unCompressToFile(compressedStream, entry, writeStream, // Node.js WriteStream
230
+ options) {
231
+ this.log(`unCompressToFile() called for entry: ${entry.filename}, method: ${entry.cmpMethod}`);
232
+ // Decompress stream - processes one block at a time
233
+ const decompressedStream = this.decompressStream(compressedStream, entry.cmpMethod);
234
+ // Process and write chunks - one block at a time
235
+ const hashCalc = new HashCalculator_1.HashCalculator({ useSHA256: !!entry.sha256 });
236
+ let totalBytes = 0;
237
+ try {
238
+ for await (const chunk of decompressedStream) {
239
+ this.log(`unCompressToFile: Processing decompressed chunk: ${chunk.length} bytes`);
240
+ hashCalc.update(chunk);
241
+ writeStream.write(chunk);
242
+ totalBytes += chunk.length;
243
+ if (options?.onProgress) {
244
+ options.onProgress(totalBytes);
245
+ }
246
+ }
247
+ // Close stream
248
+ await new Promise((resolve, reject) => {
249
+ writeStream.end(() => resolve(undefined));
250
+ writeStream.on('error', reject);
251
+ });
252
+ // Verify hash
253
+ if (!options?.skipHashCheck) {
254
+ if (entry.sha256) {
255
+ const calculatedHash = hashCalc.finalizeSHA256();
256
+ this.log(`SHA-256 comparison: calculated=${calculatedHash}, stored=${entry.sha256}`);
257
+ if (calculatedHash !== entry.sha256) {
258
+ if (options?.outputPath && fs) {
259
+ fs.unlinkSync(options.outputPath);
260
+ }
261
+ throw new Error(Errors_1.default.INVALID_SHA256);
262
+ }
263
+ this.log(`SHA-256 comparison: calculated=${calculatedHash}, stored=${entry.sha256}`);
264
+ }
265
+ else {
266
+ const calculatedCRC = hashCalc.finalizeCRC32();
267
+ this.log(`CRC-32 comparison: calculated=${calculatedCRC}, stored=${entry.crc}`);
268
+ if (calculatedCRC !== entry.crc) {
269
+ if (options?.outputPath && fs) {
270
+ fs.unlinkSync(options.outputPath);
271
+ }
272
+ throw new Error(Errors_1.default.INVALID_CRC);
273
+ }
274
+ this.log(`CRC-32 comparison: calculated=${calculatedCRC}, stored=${entry.crc}`);
275
+ }
276
+ }
277
+ }
278
+ catch (error) {
279
+ // Cleanup file on error
280
+ if (options?.outputPath && fs) {
281
+ try {
282
+ fs.unlinkSync(options.outputPath);
283
+ }
284
+ catch {
285
+ // Ignore cleanup errors
286
+ }
287
+ }
288
+ throw error;
289
+ }
290
+ }
291
+ // ============================================================================
292
+ // Decompression Methods
293
+ // ============================================================================
294
+ /**
295
+ * Decompress data stream chunk by chunk
296
+ *
297
+ * MEMORY EFFICIENCY: Processes compressed data one block at a time.
298
+ * - For STORED: Passes through chunks unchanged (no accumulation)
299
+ * - For DEFLATED: Uses pako streaming inflate (maintains state across chunks)
300
+ * - For ZSTD: Collects all chunks (ZSTD limitation - requires full buffer)
301
+ *
302
+ * Pipeline: readCompressedDataStream() → DecryptionStream.decrypt() → decompressStream() → writeStream
303
+ *
304
+ * Internal method only
305
+ */
306
+ async *decompressStream(compressedStream, method, chunkSize) {
307
+ // chunkSize parameter is currently unused but kept for API consistency
308
+ if (method === Headers_1.CMP_METHOD.STORED) {
309
+ // Pass through unchanged - one block at a time
310
+ for await (const chunk of compressedStream) {
311
+ yield chunk;
312
+ }
313
+ }
314
+ else if (method === Headers_1.CMP_METHOD.DEFLATED) {
315
+ // Use pako streaming inflate - maintains state across chunks
316
+ yield* this.inflateStream(compressedStream);
317
+ }
318
+ else if (method === Headers_1.CMP_METHOD.ZSTD) {
319
+ // Use ZSTD streaming decompression - note: ZSTD requires full buffer
320
+ yield* this.zstdDecompressStream(compressedStream);
321
+ }
322
+ else {
323
+ throw new Error(`Unsupported compression method: ${method}`);
324
+ }
325
+ }
326
+ /**
327
+ * Streaming deflate decompression using pako
328
+ *
329
+ * MEMORY EFFICIENCY: Processes compressed chunks one at a time.
330
+ * - Inflator maintains decompression state across chunks
331
+ * - Decompressed chunks are yielded immediately after processing each compressed chunk
332
+ * - No accumulation of compressed data (except in pako's internal buffers)
333
+ */
334
+ async *inflateStream(compressedStream) {
335
+ const inflator = new pako.Inflate({ raw: true });
336
+ const decompressedChunks = [];
337
+ inflator.onData = (chunk) => {
338
+ decompressedChunks.push(Buffer.from(chunk));
339
+ };
340
+ // Process each compressed chunk one at a time
341
+ for await (const compressedChunk of compressedStream) {
342
+ this.log(`inflateStream: Processing compressed chunk: ${compressedChunk.length} bytes`);
343
+ inflator.push(compressedChunk, false);
344
+ // Yield accumulated decompressed chunks immediately (no accumulation)
345
+ for (const chunk of decompressedChunks) {
346
+ yield chunk;
347
+ }
348
+ decompressedChunks.length = 0;
349
+ }
350
+ // Finalize decompression
351
+ inflator.push(new Uint8Array(0), true);
352
+ for (const chunk of decompressedChunks) {
353
+ yield chunk;
354
+ }
355
+ }
356
+ /**
357
+ * Streaming ZSTD decompression
358
+ */
359
+ async *zstdDecompressStream(compressedStream) {
360
+ // ZSTD is guaranteed to be initialized via factory method
361
+ // Collect all compressed chunks first (ZSTD needs complete data)
362
+ const compressedChunks = [];
363
+ for await (const chunk of compressedStream) {
364
+ compressedChunks.push(chunk);
365
+ }
366
+ const compressedData = Buffer.concat(compressedChunks);
367
+ try {
368
+ if (!this.zstdCodec) {
369
+ throw new Error('ZSTD codec not initialized.');
370
+ }
371
+ const decompressed = this.zstdCodec.ZstdSimple.decompress(compressedData);
372
+ const decompressedBuffer = Buffer.from(decompressed);
373
+ // Yield decompressed data in chunks using ZipkitServer's bufferSize
374
+ const chunkSize = this.zipkitNode.getBufferSize();
375
+ let offset = 0;
376
+ while (offset < decompressedBuffer.length) {
377
+ const end = Math.min(offset + chunkSize, decompressedBuffer.length);
378
+ yield decompressedBuffer.slice(offset, end);
379
+ offset = end;
380
+ }
381
+ }
382
+ catch (error) {
383
+ throw new Error(`ZSTD streaming decompression failed: ${error instanceof Error ? error.message : String(error)}`);
384
+ }
385
+ }
386
+ /**
387
+ * Inflate data using pako (internal use only)
388
+ */
389
+ inflate(data) {
390
+ this.log(`inflate() called with ${data.length} bytes`);
391
+ const result = pako.inflateRaw(data);
392
+ return Buffer.from(result.buffer, result.byteOffset, result.byteLength);
393
+ }
394
+ /**
395
+ * Synchronous zstd decompress method for in-memory mode
396
+ * ZSTD codec is guaranteed to be initialized via factory method
397
+ * Internal method only
398
+ */
399
+ zstdDecompressSync(data) {
400
+ this.log(`zstdDecompressSync() called with ${data.length} bytes`);
401
+ try {
402
+ // Ensure ZSTD is initialized
403
+ if (!this.zstdCodec) {
404
+ throw new Error('ZSTD codec not initialized.');
405
+ }
406
+ const decompressed = this.zstdCodec.ZstdSimple.decompress(data);
407
+ this.log(`ZSTD synchronous decompression successful: ${data.length} bytes -> ${decompressed.length} bytes`);
408
+ return Buffer.from(decompressed);
409
+ }
410
+ catch (error) {
411
+ this.log(`ZSTD synchronous decompression failed: ${error}`);
412
+ throw new Error(`ZSTD synchronous decompression failed: ${error instanceof Error ? error.message : String(error)}`);
413
+ }
414
+ }
415
+ /**
416
+ * Uncompress compressed data buffer (synchronous for in-memory mode)
417
+ * Handles decompression and hash verification
418
+ * Internal method only
419
+ */
420
+ unCompress(compressedData, entry, skipHashCheck) {
421
+ this.log(`unCompress() called for entry: ${entry.filename}, method: ${entry.cmpMethod}, data length: ${compressedData.length}`);
422
+ if (compressedData.length === 0) {
423
+ return Buffer.alloc(0);
424
+ }
425
+ let outBuf;
426
+ if (entry.cmpMethod === Headers_1.CMP_METHOD.STORED) {
427
+ outBuf = compressedData;
428
+ }
429
+ else if (entry.cmpMethod === Headers_1.CMP_METHOD.DEFLATED) {
430
+ // Use synchronous inflate for deflate
431
+ outBuf = this.inflate(compressedData);
432
+ }
433
+ else if (entry.cmpMethod === Headers_1.CMP_METHOD.ZSTD) {
434
+ // Use synchronous ZSTD decompression for in-memory mode
435
+ outBuf = this.zstdDecompressSync(compressedData);
436
+ }
437
+ else {
438
+ throw new Error(`Unsupported compression method: ${entry.cmpMethod}`);
439
+ }
440
+ // Verify hash
441
+ if (!skipHashCheck) {
442
+ if (entry.sha256) {
443
+ const isValid = this.zipkitNode.testSHA256(entry, outBuf);
444
+ if (!isValid) {
445
+ throw new Error(Errors_1.default.INVALID_SHA256);
446
+ }
447
+ }
448
+ else {
449
+ const isValid = this.zipkitNode.testCRC32(entry, outBuf);
450
+ if (!isValid) {
451
+ throw new Error(Errors_1.default.INVALID_CRC);
452
+ }
453
+ }
454
+ }
455
+ return outBuf;
456
+ }
457
+ }
458
+ exports.ZipDecompressNode = ZipDecompressNode;
459
+ // Class-level logging control - set to true to enable logging
460
+ ZipDecompressNode.loggingEnabled = false;
461
+ //# sourceMappingURL=ZipDecompressNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZipDecompressNode.js","sourceRoot":"","sources":["../../src/node/ZipDecompressNode.ts"],"names":[],"mappings":";AAAA,yCAAyC;AACzC,0DAA0D;AAC1D,yDAAyD;AACzD,yCAAyC;AACzC,EAAE;AACF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