@neoware_inc/neozipkit 0.5.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/README.md +134 -0
- package/dist/browser/ZipkitBrowser.d.ts +27 -0
- package/dist/browser/ZipkitBrowser.d.ts.map +1 -0
- package/dist/browser/ZipkitBrowser.js +303 -0
- package/dist/browser/ZipkitBrowser.js.map +1 -0
- package/dist/browser/index.d.ts +9 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.esm.d.ts +12 -0
- package/dist/browser/index.esm.d.ts.map +1 -0
- package/dist/browser/index.esm.js +46 -0
- package/dist/browser/index.esm.js.map +1 -0
- package/dist/browser/index.js +38 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser-esm/index.d.ts +9 -0
- package/dist/browser-esm/index.js +50211 -0
- package/dist/browser-esm/index.js.map +7 -0
- package/dist/browser-umd/index.d.ts +9 -0
- package/dist/browser-umd/index.js +50221 -0
- package/dist/browser-umd/index.js.map +7 -0
- package/dist/browser-umd/index.min.js +39 -0
- package/dist/browser.d.ts +9 -0
- package/dist/browser.js +38 -0
- package/dist/core/ZipCompress.d.ts +99 -0
- package/dist/core/ZipCompress.d.ts.map +1 -0
- package/dist/core/ZipCompress.js +287 -0
- package/dist/core/ZipCompress.js.map +1 -0
- package/dist/core/ZipCopy.d.ts +175 -0
- package/dist/core/ZipCopy.d.ts.map +1 -0
- package/dist/core/ZipCopy.js +310 -0
- package/dist/core/ZipCopy.js.map +1 -0
- package/dist/core/ZipDecompress.d.ts +57 -0
- package/dist/core/ZipDecompress.d.ts.map +1 -0
- package/dist/core/ZipDecompress.js +155 -0
- package/dist/core/ZipDecompress.js.map +1 -0
- package/dist/core/ZipEntry.d.ts +138 -0
- package/dist/core/ZipEntry.d.ts.map +1 -0
- package/dist/core/ZipEntry.js +829 -0
- package/dist/core/ZipEntry.js.map +1 -0
- package/dist/core/Zipkit.d.ts +315 -0
- package/dist/core/Zipkit.d.ts.map +1 -0
- package/dist/core/Zipkit.js +647 -0
- package/dist/core/Zipkit.js.map +1 -0
- package/dist/core/ZstdManager.d.ts +56 -0
- package/dist/core/ZstdManager.d.ts.map +1 -0
- package/dist/core/ZstdManager.js +144 -0
- package/dist/core/ZstdManager.js.map +1 -0
- package/dist/core/components/HashCalculator.d.ts +138 -0
- package/dist/core/components/HashCalculator.d.ts.map +1 -0
- package/dist/core/components/HashCalculator.js +360 -0
- package/dist/core/components/HashCalculator.js.map +1 -0
- package/dist/core/components/Logger.d.ts +73 -0
- package/dist/core/components/Logger.d.ts.map +1 -0
- package/dist/core/components/Logger.js +156 -0
- package/dist/core/components/Logger.js.map +1 -0
- package/dist/core/components/ProgressTracker.d.ts +43 -0
- package/dist/core/components/ProgressTracker.d.ts.map +1 -0
- package/dist/core/components/ProgressTracker.js +112 -0
- package/dist/core/components/ProgressTracker.js.map +1 -0
- package/dist/core/components/Support.d.ts +64 -0
- package/dist/core/components/Support.d.ts.map +1 -0
- package/dist/core/components/Support.js +71 -0
- package/dist/core/components/Support.js.map +1 -0
- package/dist/core/components/Util.d.ts +26 -0
- package/dist/core/components/Util.d.ts.map +1 -0
- package/dist/core/components/Util.js +95 -0
- package/dist/core/components/Util.js.map +1 -0
- package/dist/core/constants/Errors.d.ts +52 -0
- package/dist/core/constants/Errors.d.ts.map +1 -0
- package/dist/core/constants/Errors.js +67 -0
- package/dist/core/constants/Errors.js.map +1 -0
- package/dist/core/constants/Headers.d.ts +170 -0
- package/dist/core/constants/Headers.d.ts.map +1 -0
- package/dist/core/constants/Headers.js +194 -0
- package/dist/core/constants/Headers.js.map +1 -0
- package/dist/core/encryption/Manager.d.ts +58 -0
- package/dist/core/encryption/Manager.d.ts.map +1 -0
- package/dist/core/encryption/Manager.js +121 -0
- package/dist/core/encryption/Manager.js.map +1 -0
- package/dist/core/encryption/ZipCrypto.d.ts +172 -0
- package/dist/core/encryption/ZipCrypto.d.ts.map +1 -0
- package/dist/core/encryption/ZipCrypto.js +554 -0
- package/dist/core/encryption/ZipCrypto.js.map +1 -0
- package/dist/core/encryption/index.d.ts +9 -0
- package/dist/core/encryption/index.d.ts.map +1 -0
- package/dist/core/encryption/index.js +17 -0
- package/dist/core/encryption/index.js.map +1 -0
- package/dist/core/encryption/types.d.ts +29 -0
- package/dist/core/encryption/types.d.ts.map +1 -0
- package/dist/core/encryption/types.js +12 -0
- package/dist/core/encryption/types.js.map +1 -0
- package/dist/core/index.d.ts +27 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +59 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/version.d.ts +5 -0
- package/dist/core/version.d.ts.map +1 -0
- package/dist/core/version.js +31 -0
- package/dist/core/version.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/node/ZipCompressNode.d.ts +123 -0
- package/dist/node/ZipCompressNode.d.ts.map +1 -0
- package/dist/node/ZipCompressNode.js +565 -0
- package/dist/node/ZipCompressNode.js.map +1 -0
- package/dist/node/ZipCopyNode.d.ts +165 -0
- package/dist/node/ZipCopyNode.d.ts.map +1 -0
- package/dist/node/ZipCopyNode.js +347 -0
- package/dist/node/ZipCopyNode.js.map +1 -0
- package/dist/node/ZipDecompressNode.d.ts +197 -0
- package/dist/node/ZipDecompressNode.d.ts.map +1 -0
- package/dist/node/ZipDecompressNode.js +678 -0
- package/dist/node/ZipDecompressNode.js.map +1 -0
- package/dist/node/ZipkitNode.d.ts +466 -0
- package/dist/node/ZipkitNode.d.ts.map +1 -0
- package/dist/node/ZipkitNode.js +1426 -0
- package/dist/node/ZipkitNode.js.map +1 -0
- package/dist/node/index.d.ts +25 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +54 -0
- package/dist/node/index.js.map +1 -0
- package/dist/types/index.d.ts +45 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +11 -0
- package/dist/types/index.js.map +1 -0
- package/examples/README.md +261 -0
- package/examples/append-data.json +44 -0
- package/examples/copy-zip-append.ts +139 -0
- package/examples/copy-zip.ts +152 -0
- package/examples/create-zip.ts +172 -0
- package/examples/extract-zip.ts +118 -0
- package/examples/list-zip.ts +161 -0
- package/examples/test-files/data.json +116 -0
- package/examples/test-files/document.md +80 -0
- package/examples/test-files/document.txt +6 -0
- package/examples/test-files/file1.txt +48 -0
- package/examples/test-files/file2.txt +80 -0
- package/examples/tsconfig.json +44 -0
- package/package.json +167 -0
- package/src/browser/ZipkitBrowser.ts +305 -0
- package/src/browser/index.esm.ts +32 -0
- package/src/browser/index.ts +19 -0
- package/src/core/ZipCompress.ts +370 -0
- package/src/core/ZipCopy.ts +434 -0
- package/src/core/ZipDecompress.ts +191 -0
- package/src/core/ZipEntry.ts +917 -0
- package/src/core/Zipkit.ts +794 -0
- package/src/core/ZstdManager.ts +165 -0
- package/src/core/components/HashCalculator.ts +384 -0
- package/src/core/components/Logger.ts +180 -0
- package/src/core/components/ProgressTracker.ts +134 -0
- package/src/core/components/Support.ts +77 -0
- package/src/core/components/Util.ts +91 -0
- package/src/core/constants/Errors.ts +78 -0
- package/src/core/constants/Headers.ts +205 -0
- package/src/core/encryption/Manager.ts +137 -0
- package/src/core/encryption/ZipCrypto.ts +650 -0
- package/src/core/encryption/index.ts +15 -0
- package/src/core/encryption/types.ts +33 -0
- package/src/core/index.ts +42 -0
- package/src/core/version.ts +33 -0
- package/src/index.ts +19 -0
- package/src/node/ZipCompressNode.ts +618 -0
- package/src/node/ZipCopyNode.ts +437 -0
- package/src/node/ZipDecompressNode.ts +793 -0
- package/src/node/ZipkitNode.ts +1706 -0
- package/src/node/index.ts +40 -0
- package/src/types/index.ts +68 -0
- package/src/types/modules.d.ts +22 -0
- package/src/types/opentimestamps.d.ts +1 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { ZipFileEntry, FileData } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Class representing a single entry (file or directory) within a ZIP archive
|
|
4
|
+
*/
|
|
5
|
+
export default class ZipEntry implements ZipFileEntry {
|
|
6
|
+
debug: boolean;
|
|
7
|
+
verMadeBy: number;
|
|
8
|
+
verExtract: number;
|
|
9
|
+
bitFlags: number;
|
|
10
|
+
cmpMethod: number;
|
|
11
|
+
timeDateDOS: number;
|
|
12
|
+
crc: number;
|
|
13
|
+
compressedSize: number;
|
|
14
|
+
uncompressedSize: number;
|
|
15
|
+
volNumber: number;
|
|
16
|
+
intFileAttr: number;
|
|
17
|
+
extFileAttr: number;
|
|
18
|
+
localHdrOffset: number;
|
|
19
|
+
filename: string;
|
|
20
|
+
extraField: Buffer | null;
|
|
21
|
+
comment: string | null;
|
|
22
|
+
fileBuffer: Buffer | null;
|
|
23
|
+
cmpData: Buffer | null;
|
|
24
|
+
isEncrypted: boolean;
|
|
25
|
+
isStrongEncrypt: boolean;
|
|
26
|
+
encryptHdr: Buffer | null;
|
|
27
|
+
lastModTimeDate: number;
|
|
28
|
+
decrypt: Function | null;
|
|
29
|
+
isUpdated: boolean;
|
|
30
|
+
isDirectory: boolean;
|
|
31
|
+
isMetaData: boolean;
|
|
32
|
+
platform: string | null;
|
|
33
|
+
universalTime: number | null;
|
|
34
|
+
uid: number | null;
|
|
35
|
+
gid: number | null;
|
|
36
|
+
sha256: string | null;
|
|
37
|
+
isSymlink: boolean;
|
|
38
|
+
linkTarget: string | null;
|
|
39
|
+
isHardLink: boolean;
|
|
40
|
+
originalEntry: string | null;
|
|
41
|
+
inode: number | null;
|
|
42
|
+
fileData?: FileData;
|
|
43
|
+
/**
|
|
44
|
+
* Creates a new ZIP entry
|
|
45
|
+
* @param fname - Name of the file within the ZIP
|
|
46
|
+
* @param comment - Optional comment for this entry
|
|
47
|
+
* @param debug - Enable debug logging
|
|
48
|
+
*/
|
|
49
|
+
constructor(fname: string | null, comment?: string | null, debug?: boolean);
|
|
50
|
+
isMSDOS: boolean;
|
|
51
|
+
isUnixLike: boolean;
|
|
52
|
+
isMacOS: boolean;
|
|
53
|
+
isLinux: boolean;
|
|
54
|
+
VER_MADE_BY: number;
|
|
55
|
+
/**
|
|
56
|
+
* Reads ZIP entry data from a central directory buffer
|
|
57
|
+
* @param data - Buffer containing central directory entry data
|
|
58
|
+
* @returns Buffer positioned at start of next entry
|
|
59
|
+
* @throws Error if central directory entry is invalid
|
|
60
|
+
*/
|
|
61
|
+
readZipEntry(data: Buffer): Buffer;
|
|
62
|
+
/**
|
|
63
|
+
* Checks if the filename contains characters that require Unicode handling
|
|
64
|
+
* @returns true if the filename contains non-ASCII characters or special characters
|
|
65
|
+
*/
|
|
66
|
+
needsUnicodeHandling(): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Adds UTF-8 Unicode Path field to a buffer
|
|
69
|
+
* @param buffer - The buffer to write to
|
|
70
|
+
* @param offset - The offset in the buffer to start writing
|
|
71
|
+
* @returns The new offset after writing
|
|
72
|
+
*/
|
|
73
|
+
private addUnicodePathField;
|
|
74
|
+
/**
|
|
75
|
+
* Creates a local header for this ZIP entry
|
|
76
|
+
* @returns Buffer containing the local header data
|
|
77
|
+
*/
|
|
78
|
+
createLocalHdr(): Buffer;
|
|
79
|
+
/**
|
|
80
|
+
* Creates a central directory entry for this ZIP entry
|
|
81
|
+
* @returns Buffer containing the central directory entry data
|
|
82
|
+
*/
|
|
83
|
+
centralDirEntry(): Buffer;
|
|
84
|
+
/**
|
|
85
|
+
* Sets the DOS date/time for this entry
|
|
86
|
+
* @param date - Date to convert to DOS format
|
|
87
|
+
* @returns number - DOS format date/time
|
|
88
|
+
*/
|
|
89
|
+
setDateTime(date: Date): number;
|
|
90
|
+
/**
|
|
91
|
+
* Converts DOS date/time to JavaScript Date
|
|
92
|
+
* @param timeStamp - DOS format date/time
|
|
93
|
+
* @returns Date object or null if timestamp is 0
|
|
94
|
+
*/
|
|
95
|
+
parseDateTime(timeStamp: number): Date | null;
|
|
96
|
+
/**
|
|
97
|
+
* Formats the entry's date in local format
|
|
98
|
+
* @returns String in MM/DD/YYYY format or "--/--/----" if no date
|
|
99
|
+
*/
|
|
100
|
+
toLocalDateString(): string;
|
|
101
|
+
/**
|
|
102
|
+
* Formats the entry's time
|
|
103
|
+
* @returns String in HH:MM format or "--:--" if no time
|
|
104
|
+
*/
|
|
105
|
+
toTimeString(): string;
|
|
106
|
+
/**
|
|
107
|
+
* Formats the entry's date and time in local format
|
|
108
|
+
* @returns String like "Jan 01, 2024 13:45:30" or "--/--/-- --:--" if no date/time
|
|
109
|
+
*/
|
|
110
|
+
toFormattedDateString(): string;
|
|
111
|
+
/**
|
|
112
|
+
* Formats the entry's date and time in UTC
|
|
113
|
+
* @returns String like "Jan 01, 2024 13:45:30 UTC" or "--/--/-- --:--" if no date/time
|
|
114
|
+
*/
|
|
115
|
+
toFormattedUTCDateString(): string;
|
|
116
|
+
/**
|
|
117
|
+
* Converts compression method code to human-readable string
|
|
118
|
+
* @returns String describing the compression method
|
|
119
|
+
*/
|
|
120
|
+
cmpMethodToString(): string;
|
|
121
|
+
/**
|
|
122
|
+
* Converts file system code to human-readable string
|
|
123
|
+
* @returns String describing the file system
|
|
124
|
+
*/
|
|
125
|
+
fileSystemToString(): string;
|
|
126
|
+
/**
|
|
127
|
+
* Converts MS-DOS file attributes to string representation
|
|
128
|
+
* @returns String like "----" where R=readonly, H=hidden, S=system, A=archive
|
|
129
|
+
*/
|
|
130
|
+
private dosAttributesToString;
|
|
131
|
+
/**
|
|
132
|
+
* Outputs detailed information about this entry for debugging
|
|
133
|
+
* Includes compression, encryption, timestamps, and extra fields
|
|
134
|
+
*/
|
|
135
|
+
showVerboseInfo(): void;
|
|
136
|
+
}
|
|
137
|
+
export { ZipEntry };
|
|
138
|
+
//# sourceMappingURL=ZipEntry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZipEntry.d.ts","sourceRoot":"","sources":["../../src/core/ZipEntry.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,M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