@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,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Encryption types and interfaces for NeoZipKit extension
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.EncryptionMethod = void 0;
|
|
7
|
+
var EncryptionMethod;
|
|
8
|
+
(function (EncryptionMethod) {
|
|
9
|
+
EncryptionMethod[EncryptionMethod["NONE"] = 0] = "NONE";
|
|
10
|
+
EncryptionMethod[EncryptionMethod["ZIP_CRYPTO"] = 1] = "ZIP_CRYPTO";
|
|
11
|
+
})(EncryptionMethod || (exports.EncryptionMethod = EncryptionMethod = {}));
|
|
12
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/encryption/types.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,uDAAQ,CAAA;IACR,mEAAc,CAAA;AAChB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core Module Exports
|
|
3
|
+
* Core ZIP functionality (platform-agnostic)
|
|
4
|
+
*/
|
|
5
|
+
import Zipkit from './Zipkit';
|
|
6
|
+
export * from './Zipkit';
|
|
7
|
+
export * from './ZipEntry';
|
|
8
|
+
export { ZipCompress } from './ZipCompress';
|
|
9
|
+
export type { CompressOptions, CreateZipOptions } from './ZipCompress';
|
|
10
|
+
export type { DecompressionResult, DecompressionOptions } from './ZipDecompress';
|
|
11
|
+
export { ZipCopy } from './ZipCopy';
|
|
12
|
+
export type { CopyOptions, CopyResult, CopyEntriesOnlyResult, FinalizeZipOptions, } from './ZipCopy';
|
|
13
|
+
export default Zipkit;
|
|
14
|
+
export { default as HashCalculator, HashCalculator as HashCalculatorClass } from './components/HashCalculator';
|
|
15
|
+
export * from './components/Util';
|
|
16
|
+
export * from './components/Support';
|
|
17
|
+
export { ProgressTracker } from './components/ProgressTracker';
|
|
18
|
+
export { EncryptionManager } from './encryption/Manager';
|
|
19
|
+
export { ZipCrypto, crc32, crc32update, sha256 } from './encryption/ZipCrypto';
|
|
20
|
+
export type { EncryptionMethod, EncryptionOptions, EncryptionResult, DecryptionResult, EncryptionProvider } from './encryption/types';
|
|
21
|
+
export * from '../types';
|
|
22
|
+
export * from './constants/Headers';
|
|
23
|
+
export * from './constants/Errors';
|
|
24
|
+
export * from './version';
|
|
25
|
+
export { Logger, configureLoggerFromEnvironment } from './components/Logger';
|
|
26
|
+
export type { LogLevel, LoggerConfig } from './components/Logger';
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACvE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EACV,WAAW,EACX,UAAU,EACV,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,WAAW,CAAC;AACnB,eAAe,MAAM,CAAC;AAGtB,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,cAAc,IAAI,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAC/G,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC/E,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGtI,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAG1B,OAAO,EAAE,MAAM,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AAC7E,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Core Module Exports
|
|
4
|
+
* Core ZIP functionality (platform-agnostic)
|
|
5
|
+
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
+
};
|
|
20
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.configureLoggerFromEnvironment = exports.Logger = exports.sha256 = exports.crc32update = exports.crc32 = exports.ZipCrypto = exports.EncryptionManager = exports.ProgressTracker = exports.HashCalculatorClass = exports.HashCalculator = exports.ZipCopy = exports.ZipCompress = void 0;
|
|
25
|
+
// Core ZIP classes
|
|
26
|
+
const Zipkit_1 = __importDefault(require("./Zipkit"));
|
|
27
|
+
__exportStar(require("./Zipkit"), exports);
|
|
28
|
+
__exportStar(require("./ZipEntry"), exports);
|
|
29
|
+
var ZipCompress_1 = require("./ZipCompress");
|
|
30
|
+
Object.defineProperty(exports, "ZipCompress", { enumerable: true, get: function () { return ZipCompress_1.ZipCompress; } });
|
|
31
|
+
var ZipCopy_1 = require("./ZipCopy");
|
|
32
|
+
Object.defineProperty(exports, "ZipCopy", { enumerable: true, get: function () { return ZipCopy_1.ZipCopy; } });
|
|
33
|
+
exports.default = Zipkit_1.default;
|
|
34
|
+
// Shared components
|
|
35
|
+
var HashCalculator_1 = require("./components/HashCalculator");
|
|
36
|
+
Object.defineProperty(exports, "HashCalculator", { enumerable: true, get: function () { return __importDefault(HashCalculator_1).default; } });
|
|
37
|
+
Object.defineProperty(exports, "HashCalculatorClass", { enumerable: true, get: function () { return HashCalculator_1.HashCalculator; } });
|
|
38
|
+
__exportStar(require("./components/Util"), exports);
|
|
39
|
+
__exportStar(require("./components/Support"), exports);
|
|
40
|
+
var ProgressTracker_1 = require("./components/ProgressTracker");
|
|
41
|
+
Object.defineProperty(exports, "ProgressTracker", { enumerable: true, get: function () { return ProgressTracker_1.ProgressTracker; } });
|
|
42
|
+
// Encryption functionality
|
|
43
|
+
var Manager_1 = require("./encryption/Manager");
|
|
44
|
+
Object.defineProperty(exports, "EncryptionManager", { enumerable: true, get: function () { return Manager_1.EncryptionManager; } });
|
|
45
|
+
var ZipCrypto_1 = require("./encryption/ZipCrypto");
|
|
46
|
+
Object.defineProperty(exports, "ZipCrypto", { enumerable: true, get: function () { return ZipCrypto_1.ZipCrypto; } });
|
|
47
|
+
Object.defineProperty(exports, "crc32", { enumerable: true, get: function () { return ZipCrypto_1.crc32; } });
|
|
48
|
+
Object.defineProperty(exports, "crc32update", { enumerable: true, get: function () { return ZipCrypto_1.crc32update; } });
|
|
49
|
+
Object.defineProperty(exports, "sha256", { enumerable: true, get: function () { return ZipCrypto_1.sha256; } });
|
|
50
|
+
// Types and constants
|
|
51
|
+
__exportStar(require("../types"), exports);
|
|
52
|
+
__exportStar(require("./constants/Headers"), exports);
|
|
53
|
+
__exportStar(require("./constants/Errors"), exports);
|
|
54
|
+
__exportStar(require("./version"), exports);
|
|
55
|
+
// Logger utility
|
|
56
|
+
var Logger_1 = require("./components/Logger");
|
|
57
|
+
Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return Logger_1.Logger; } });
|
|
58
|
+
Object.defineProperty(exports, "configureLoggerFromEnvironment", { enumerable: true, get: function () { return Logger_1.configureLoggerFromEnvironment; } });
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;AAEH,mBAAmB;AACnB,sDAA8B;AAC9B,2CAAyB;AACzB,6CAA2B;AAC3B,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AAGpB,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAOhB,kBAAe,gBAAM,CAAC;AAEtB,oBAAoB;AACpB,8DAA+G;AAAtG,iIAAA,OAAO,OAAkB;AAAE,qHAAA,cAAc,OAAuB;AACzE,oDAAkC;AAClC,uDAAqC;AACrC,gEAA+D;AAAtD,kHAAA,eAAe,OAAA;AAExB,2BAA2B;AAC3B,gDAAyD;AAAhD,4GAAA,iBAAiB,OAAA;AAC1B,oDAA+E;AAAtE,sGAAA,SAAS,OAAA;AAAE,kGAAA,KAAK,OAAA;AAAE,wGAAA,WAAW,OAAA;AAAE,mGAAA,MAAM,OAAA;AAG9C,sBAAsB;AACtB,2CAAyB;AACzB,sDAAoC;AACpC,qDAAmC;AACnC,4CAA0B;AAE1B,iBAAiB;AACjB,8CAA6E;AAApE,gGAAA,MAAM,OAAA;AAAE,wHAAA,8BAA8B,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/core/version.ts"],"names":[],"mappings":"AA6BA,eAAO,MAAM,OAAO;;;CAGnB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Import package.json to get the version
|
|
3
|
+
// import * as path from 'path';
|
|
4
|
+
// import * as fs from 'fs';
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.VERSION = void 0;
|
|
7
|
+
// Resolve package.json path - works with both normal installs and symlinks
|
|
8
|
+
// Walk up from __dirname to find package.json
|
|
9
|
+
// let packageJsonPath: string | null = null;
|
|
10
|
+
// let currentDir = __dirname;
|
|
11
|
+
// Walk up the directory tree to find package.json
|
|
12
|
+
// while (currentDir !== path.dirname(currentDir)) {
|
|
13
|
+
// const candidate = path.join(currentDir, 'package.json');
|
|
14
|
+
// if (fs.existsSync(candidate)) {
|
|
15
|
+
// packageJsonPath = candidate;
|
|
16
|
+
// break;
|
|
17
|
+
// }
|
|
18
|
+
// currentDir = path.dirname(currentDir);
|
|
19
|
+
// }
|
|
20
|
+
// if (!packageJsonPath) {
|
|
21
|
+
// throw new Error('Cannot find package.json for neozipkit');
|
|
22
|
+
// }
|
|
23
|
+
// const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
24
|
+
// Get current date for release date
|
|
25
|
+
const currentDate = new Date();
|
|
26
|
+
const releaseDate = `${String(currentDate.getMonth() + 1).padStart(2, '0')}-${String(currentDate.getDate()).padStart(2, '0')}-${currentDate.getFullYear()}`;
|
|
27
|
+
exports.VERSION = {
|
|
28
|
+
number: '0.3.1', // packageJson.version,
|
|
29
|
+
date: releaseDate
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/core/version.ts"],"names":[],"mappings":";AAAA,yCAAyC;AACzC,gCAAgC;AAChC,4BAA4B;;;AAE5B,2EAA2E;AAC3E,8CAA8C;AAC9C,6CAA6C;AAC7C,8BAA8B;AAE9B,kDAAkD;AAClD,oDAAoD;AACpD,6DAA6D;AAC7D,oCAAoC;AACpC,mCAAmC;AACnC,aAAa;AACb,MAAM;AACN,2CAA2C;AAC3C,IAAI;AAEJ,0BAA0B;AAC1B,+DAA+D;AAC/D,IAAI;AAEJ,4EAA4E;AAE5E,oCAAoC;AACpC,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC;AAC/B,MAAM,WAAW,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,WAAW,CAAC,WAAW,EAAE,EAAE,CAAC;AAE/I,QAAA,OAAO,GAAG;IACrB,MAAM,EAAE,OAAO,EAAE,uBAAuB;IACxC,IAAI,EAAE,WAAW;CAClB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './core';
|
|
2
|
+
import Zipkit from './core';
|
|
3
|
+
export default Zipkit;
|
|
4
|
+
export { default as ZipkitBrowser } from './browser/ZipkitBrowser';
|
|
5
|
+
export declare const PlatformUtils: {
|
|
6
|
+
isBrowser: boolean;
|
|
7
|
+
isNode: string | false;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,cAAc,QAAQ,CAAC;AACvB,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,eAAe,MAAM,CAAC;AAGtB,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGnE,eAAO,MAAM,aAAa;;;CAKzB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// =============================================================================
|
|
3
|
+
// NeoZipkit - Unified Package Exports
|
|
4
|
+
// =============================================================================
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
+
};
|
|
19
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
20
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.PlatformUtils = exports.ZipkitBrowser = void 0;
|
|
24
|
+
// Core shared exports (from core module)
|
|
25
|
+
__exportStar(require("./core"), exports);
|
|
26
|
+
const core_1 = __importDefault(require("./core"));
|
|
27
|
+
exports.default = core_1.default;
|
|
28
|
+
// Browser-only exports
|
|
29
|
+
var ZipkitBrowser_1 = require("./browser/ZipkitBrowser");
|
|
30
|
+
Object.defineProperty(exports, "ZipkitBrowser", { enumerable: true, get: function () { return __importDefault(ZipkitBrowser_1).default; } });
|
|
31
|
+
// Platform-specific conditional exports
|
|
32
|
+
exports.PlatformUtils = {
|
|
33
|
+
// Browser detection
|
|
34
|
+
isBrowser: typeof window !== 'undefined' && typeof document !== 'undefined',
|
|
35
|
+
// Node.js detection
|
|
36
|
+
isNode: typeof process !== 'undefined' && process.versions && process.versions.node,
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,sCAAsC;AACtC,gFAAgF;;;;;;;;;;;;;;;;;;;;AAEhF,yCAAyC;AACzC,yCAAuB;AACvB,kDAA4B;AAC5B,kBAAe,cAAM,CAAC;AAEtB,uBAAuB;AACvB,yDAAmE;AAA1D,+HAAA,OAAO,OAAiB;AAEjC,wCAAwC;AAC3B,QAAA,aAAa,GAAG;IAC3B,oBAAoB;IACpB,SAAS,EAAE,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW;IAC3E,oBAAoB;IACpB,MAAM,EAAE,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI;CACpF,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { CompressOptions } from '../core/ZipCompress';
|
|
2
|
+
import ZipEntry from '../core/ZipEntry';
|
|
3
|
+
import ZipkitNode from './ZipkitNode';
|
|
4
|
+
export type { CompressOptions } from '../core/ZipCompress';
|
|
5
|
+
/**
|
|
6
|
+
* ZipCompressNode - Node.js file-based compression operations
|
|
7
|
+
*
|
|
8
|
+
* Independent compression implementation for Node.js environments.
|
|
9
|
+
* All compression logic is implemented directly without delegating to ZipCompress.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const zipkitNode = new ZipkitNode();
|
|
14
|
+
* const compressNode = new ZipCompressNode(zipkitNode);
|
|
15
|
+
* const compressed = await compressNode.compressFile('/path/to/file.txt', entry);
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare class ZipCompressNode {
|
|
19
|
+
private zipkitNode;
|
|
20
|
+
private static loggingEnabled;
|
|
21
|
+
/**
|
|
22
|
+
* Internal logging method - only logs if class logging is enabled
|
|
23
|
+
*/
|
|
24
|
+
private log;
|
|
25
|
+
/**
|
|
26
|
+
* Creates a new ZipCompressNode instance
|
|
27
|
+
* @param zipkitNode - ZipkitNode instance to use for ZIP operations
|
|
28
|
+
*/
|
|
29
|
+
constructor(zipkitNode: ZipkitNode);
|
|
30
|
+
/**
|
|
31
|
+
* Compress data for a ZIP entry (Buffer-based only)
|
|
32
|
+
* @param entry - ZIP entry to compress
|
|
33
|
+
* @param data - Buffer containing data to compress
|
|
34
|
+
* @param options - Compression options
|
|
35
|
+
* @param onOutputBuffer - Optional callback for streaming output
|
|
36
|
+
* @returns Buffer containing compressed data
|
|
37
|
+
*/
|
|
38
|
+
compressData(entry: ZipEntry, data: Buffer, options?: CompressOptions, onOutputBuffer?: (data: Buffer) => Promise<void>): Promise<Buffer>;
|
|
39
|
+
/**
|
|
40
|
+
* Compresses data using deflate algorithm with chunked processing
|
|
41
|
+
* @param data - Data to compress (Buffer or chunked reader)
|
|
42
|
+
* @param options - Compression options
|
|
43
|
+
* @param bufferSize - Size of buffer to read (default: 512KB)
|
|
44
|
+
* @param entry - Optional ZIP entry for hash calculation
|
|
45
|
+
* @param onOutputBuffer - Optional callback for streaming output
|
|
46
|
+
* @returns Compressed data buffer
|
|
47
|
+
*/
|
|
48
|
+
deflateCompress(data: Buffer | {
|
|
49
|
+
totalSize: number;
|
|
50
|
+
onReadChunk: (position: number, size: number) => Buffer;
|
|
51
|
+
onOutChunk: (chunk: Buffer) => void;
|
|
52
|
+
}, options?: CompressOptions, bufferSize?: number, entry?: ZipEntry, onOutputBuffer?: (data: Buffer) => Promise<void>): Promise<Buffer>;
|
|
53
|
+
/**
|
|
54
|
+
* Compresses data using deflate algorithm (legacy method for small buffers)
|
|
55
|
+
* @param inbuf - Data to compress
|
|
56
|
+
* @param options - Compression options
|
|
57
|
+
* @returns Compressed data buffer
|
|
58
|
+
*/
|
|
59
|
+
deflate(inbuf: Buffer, options?: CompressOptions): Buffer;
|
|
60
|
+
/**
|
|
61
|
+
* Compresses data using Zstandard (zstd) algorithm
|
|
62
|
+
* @param input - Buffer to compress OR chunked reader object with totalSize and readChunk callback
|
|
63
|
+
* @param options - Compression options
|
|
64
|
+
* @param bufferSize - Size of buffer to read if using chunked reader (default: 512KB)
|
|
65
|
+
* @param entry - Optional ZIP entry for hash calculation
|
|
66
|
+
* @param onOutputBuffer - Optional callback for streaming output
|
|
67
|
+
* @returns Compressed data buffer
|
|
68
|
+
*/
|
|
69
|
+
zstdCompress(input: Buffer | {
|
|
70
|
+
totalSize: number;
|
|
71
|
+
readChunk: (position: number, size: number) => Buffer;
|
|
72
|
+
}, options?: CompressOptions, bufferSize?: number, entry?: ZipEntry, onOutputBuffer?: (data: Buffer) => Promise<void>): Promise<Buffer>;
|
|
73
|
+
/**
|
|
74
|
+
* Encrypt compressed data using PKZIP encryption
|
|
75
|
+
* Creates encryption header, encrypts compressed data, and updates entry flags
|
|
76
|
+
* @param compressedData - Compressed data to encrypt
|
|
77
|
+
* @param entry - ZIP entry to encrypt
|
|
78
|
+
* @param password - Password for encryption
|
|
79
|
+
* @returns Encrypted buffer (encrypted header + encrypted compressed data)
|
|
80
|
+
*/
|
|
81
|
+
private encryptCompressedData;
|
|
82
|
+
/**
|
|
83
|
+
* Compress a file from disk
|
|
84
|
+
*
|
|
85
|
+
* Reads file from disk, sets entry metadata from file stats, and compresses the data.
|
|
86
|
+
*
|
|
87
|
+
* @param filePath - Path to the file to compress
|
|
88
|
+
* @param entry - ZIP entry to compress (filename should already be set)
|
|
89
|
+
* @param options - Optional compression options
|
|
90
|
+
* @returns Promise resolving to Buffer containing compressed data
|
|
91
|
+
* @throws Error if file not found or not a file
|
|
92
|
+
*/
|
|
93
|
+
compressFile(filePath: string, entry: ZipEntry, options?: CompressOptions): Promise<Buffer>;
|
|
94
|
+
/**
|
|
95
|
+
* Compress a file from disk using streaming for large files
|
|
96
|
+
*
|
|
97
|
+
* Streams file in chunks for memory-efficient compression of large files.
|
|
98
|
+
* All chunk reading logic is handled in this server class.
|
|
99
|
+
*
|
|
100
|
+
* @param filePath - Path to the file to compress
|
|
101
|
+
* @param entry - ZIP entry to compress (filename should already be set)
|
|
102
|
+
* @param options - Optional compression options
|
|
103
|
+
* @param onOutputBuffer - Optional callback for streaming output
|
|
104
|
+
* @returns Promise resolving to Buffer containing compressed data
|
|
105
|
+
* @throws Error if file not found or not a file
|
|
106
|
+
*/
|
|
107
|
+
compressFileStream(filePath: string, entry: ZipEntry, options?: CompressOptions, onOutputBuffer?: (data: Buffer) => Promise<void>): Promise<Buffer>;
|
|
108
|
+
/**
|
|
109
|
+
* Compress multiple files from disk to a ZIP file
|
|
110
|
+
*
|
|
111
|
+
* Batch compression from file paths. Creates entries for each file and writes
|
|
112
|
+
* to output ZIP file. This is a simplified implementation - full implementation
|
|
113
|
+
* would need to write ZIP structure incrementally.
|
|
114
|
+
*
|
|
115
|
+
* @param filePaths - Array of file paths to compress
|
|
116
|
+
* @param outputPath - Path where the ZIP file should be created
|
|
117
|
+
* @param options - Optional compression options
|
|
118
|
+
* @returns Promise that resolves when ZIP creation is complete
|
|
119
|
+
* @throws Error if any file not found
|
|
120
|
+
*/
|
|
121
|
+
compressFiles(filePaths: string[], outputPath: string, options?: CompressOptions): Promise<void>;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=ZipCompressNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZipCompressNode.d.ts","sourceRoot":"","sources":["../../src/node/ZipCompressNode.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,UAAU,MAAM,cAAc,CAAC;AAatC,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;;;;;;;;;;GAYG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,UAAU,CAAa;IAG/B,OAAO,CAAC,MAAM,CAAC,cAAc,CAAkB;IAE/C;;OAEG;IACH,OAAO,CAAC,GAAG;IAMX;;;OAGG;gBACS,UAAU,EAAE,UAAU;IAYlC;;;;;;;OAOG;IACG,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,EAAE,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAoE/I;;;;;;;;OAQG;IACG,eAAe,CACnB,IAAI,EAAE,MAAM,GAAG;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;QAAC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,EAClI,OAAO,CAAC,EAAE,eAAe,EACzB,UAAU,CAAC,EAAE,MAAM,EACnB,KAAK,CAAC,EAAE,QAAQ,EAChB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAC/C,OAAO,CAAC,MAAM,CAAC;IA8IlB;;;;;OAKG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,MAAM;IAgBzD;;;;;;;;OAQG;IACG,YAAY,CAChB,KAAK,EAAE,MAAM,GAAG;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;KAAE,EAC5F,OAAO,CAAC,EAAE,eAAe,EACzB,UAAU,CAAC,EAAE,MAAM,EACnB,KAAK,CAAC,EAAE,QAAQ,EAChB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAC/C,OAAO,CAAC,MAAM,CAAC;IAsElB;;;;;;;OAOG;IACH,OAAO,CAAC,qBAAqB;IAqB7B;;;;;;;;;;OAUG;IACG,YAAY,CAChB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,QAAQ,EACf,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,MAAM,CAAC;IAsBlB;;;;;;;;;;;;OAYG;IACG,kBAAkB,CACtB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,QAAQ,EACf,OAAO,CAAC,EAAE,eAAe,EACzB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAC/C,OAAO,CAAC,MAAM,CAAC;IAgElB;;;;;;;;;;;;OAYG;IACG,aAAa,CACjB,SAAS,EAAE,MAAM,EAAE,EACnB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,IAAI,CAAC;CAoCjB"}
|