neozip-cli 0.75.2-beta → 0.90.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/CHANGELOG.md +78 -0
- package/DOCUMENTATION.md +20 -9
- package/README.md +55 -31
- package/dist/src/commands/mintTimestampProof.js +335 -0
- package/dist/src/commands/verifyEmail.js +146 -0
- package/dist/src/config/ConfigSetup.js +50 -20
- package/dist/src/config/ConfigStore.js +36 -3
- package/dist/src/index.js +1 -1
- package/dist/src/neolist.js +25 -11
- package/dist/src/neounzip.js +324 -66
- package/dist/src/neozip/blockchain.js +5 -5
- package/dist/src/neozip/createZip.js +211 -44
- package/dist/src/neozip/upgradeZip.js +182 -0
- package/dist/src/neozip.js +160 -24
- package/env.example +10 -0
- package/package.json +97 -82
- package/dist/neozipkit-bundles/blockchain.js +0 -13725
- package/dist/neozipkit-bundles/browser.js +0 -6186
- package/dist/neozipkit-bundles/core.js +0 -3839
- package/dist/neozipkit-bundles/node.js +0 -17730
- package/dist/neozipkit-wrappers/blockchain/core/contracts.js +0 -16
- package/dist/neozipkit-wrappers/blockchain/index.js +0 -2
- package/dist/neozipkit-wrappers/core/ZipDecompress.js +0 -2
- package/dist/neozipkit-wrappers/core/components/HashCalculator.js +0 -2
- package/dist/neozipkit-wrappers/core/components/Logger.js +0 -2
- package/dist/neozipkit-wrappers/core/constants/Errors.js +0 -2
- package/dist/neozipkit-wrappers/core/constants/Headers.js +0 -2
- package/dist/neozipkit-wrappers/core/encryption/ZipCrypto.js +0 -7
- package/dist/neozipkit-wrappers/core/index.js +0 -3
- package/dist/neozipkit-wrappers/index.js +0 -13
- package/dist/neozipkit-wrappers/node/index.js +0 -2
|
@@ -42,9 +42,10 @@ exports.ConfigStore = void 0;
|
|
|
42
42
|
const fs = __importStar(require("fs"));
|
|
43
43
|
const path = __importStar(require("path"));
|
|
44
44
|
const os = __importStar(require("os"));
|
|
45
|
-
const
|
|
45
|
+
const neozip_blockchain_1 = require("neozip-blockchain");
|
|
46
46
|
const DEFAULTS = {
|
|
47
47
|
network: 'base-sepolia',
|
|
48
|
+
timestampEmail: null,
|
|
48
49
|
rpcUrls: {
|
|
49
50
|
baseSepolia: 'https://sepolia.base.org',
|
|
50
51
|
baseMainnet: 'https://mainnet.base.org',
|
|
@@ -148,6 +149,10 @@ class ConfigStore {
|
|
|
148
149
|
const network = process.env.NEOZIP_NETWORK ||
|
|
149
150
|
jsonConfig?.wallet?.network ||
|
|
150
151
|
DEFAULTS.network;
|
|
152
|
+
// Timestamp email precedence: ENV > wallet.json > default (for Zipstamp)
|
|
153
|
+
const timestampEmail = process.env.NEOZIP_TIMESTAMP_EMAIL ||
|
|
154
|
+
jsonConfig?.zipstamp?.timestampEmail ||
|
|
155
|
+
null;
|
|
151
156
|
// RPC URLs precedence: ENV > wallet.json > default
|
|
152
157
|
const rpcUrls = {
|
|
153
158
|
baseSepolia: process.env.NEOZIP_BASE_SEPOLIA_RPC_URL ||
|
|
@@ -180,6 +185,7 @@ class ConfigStore {
|
|
|
180
185
|
return {
|
|
181
186
|
walletKey,
|
|
182
187
|
network,
|
|
188
|
+
timestampEmail,
|
|
183
189
|
rpcUrls,
|
|
184
190
|
gas,
|
|
185
191
|
debug,
|
|
@@ -198,7 +204,7 @@ class ConfigStore {
|
|
|
198
204
|
* Validate network name (uses nameAliases from CONTRACT_CONFIGS)
|
|
199
205
|
*/
|
|
200
206
|
static validateNetwork(network) {
|
|
201
|
-
return (0,
|
|
207
|
+
return (0, neozip_blockchain_1.getChainIdByName)(network) !== null;
|
|
202
208
|
}
|
|
203
209
|
/**
|
|
204
210
|
* Update a specific configuration value
|
|
@@ -213,6 +219,17 @@ class ConfigStore {
|
|
|
213
219
|
// Parse the key path (e.g., "wallet.privateKey", "gas.multiplier")
|
|
214
220
|
const parts = key.split('.');
|
|
215
221
|
switch (parts[0]) {
|
|
222
|
+
case 'zipstamp':
|
|
223
|
+
if (!config.zipstamp)
|
|
224
|
+
config.zipstamp = {};
|
|
225
|
+
if (parts[1] === 'timestampEmail') {
|
|
226
|
+
config.zipstamp.timestampEmail = value;
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
console.error(`❌ Unknown zipstamp key: ${parts[1]}`);
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
232
|
+
break;
|
|
216
233
|
case 'wallet':
|
|
217
234
|
if (parts[1] === 'privateKey') {
|
|
218
235
|
if (!this.validatePrivateKey(value)) {
|
|
@@ -223,7 +240,7 @@ class ConfigStore {
|
|
|
223
240
|
}
|
|
224
241
|
else if (parts[1] === 'network') {
|
|
225
242
|
if (!this.validateNetwork(value)) {
|
|
226
|
-
const supportedNetworks = (0,
|
|
243
|
+
const supportedNetworks = (0, neozip_blockchain_1.getSupportedNetworkNames)();
|
|
227
244
|
console.error(`❌ Invalid network: "${value}"`);
|
|
228
245
|
console.error(`Supported networks: ${supportedNetworks.join(', ')}`);
|
|
229
246
|
return false;
|
|
@@ -284,6 +301,19 @@ class ConfigStore {
|
|
|
284
301
|
// Parse the key path (e.g., "wallet.privateKey", "gas.multiplier")
|
|
285
302
|
const parts = key.split('.');
|
|
286
303
|
switch (parts[0]) {
|
|
304
|
+
case 'zipstamp':
|
|
305
|
+
if (!config.zipstamp) {
|
|
306
|
+
console.error('❌ No Zipstamp configuration found');
|
|
307
|
+
return false;
|
|
308
|
+
}
|
|
309
|
+
if (parts[1] === 'timestampEmail') {
|
|
310
|
+
delete config.zipstamp.timestampEmail;
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
console.error(`❌ Unknown zipstamp key: ${parts[1]}`);
|
|
314
|
+
return false;
|
|
315
|
+
}
|
|
316
|
+
break;
|
|
287
317
|
case 'wallet':
|
|
288
318
|
if (parts[1] === 'privateKey') {
|
|
289
319
|
delete config.wallet.privateKey;
|
|
@@ -360,6 +390,9 @@ class ConfigStore {
|
|
|
360
390
|
'(not set)',
|
|
361
391
|
network: config.network,
|
|
362
392
|
},
|
|
393
|
+
zipstamp: {
|
|
394
|
+
timestampEmail: config.timestampEmail || '(not set)',
|
|
395
|
+
},
|
|
363
396
|
rpc: config.rpcUrls,
|
|
364
397
|
gas: config.gas,
|
|
365
398
|
debug: config.debug,
|
package/dist/src/index.js
CHANGED
|
@@ -78,7 +78,7 @@ function showHelp() {
|
|
|
78
78
|
console.log(chalk_1.default.gray(' # Compress files'));
|
|
79
79
|
console.log(' neozip output.nzip file1.txt file2.txt folder/\n');
|
|
80
80
|
console.log(chalk_1.default.gray(' # Extract files'));
|
|
81
|
-
console.log(' neounzip output.nzip extracted/\n');
|
|
81
|
+
console.log(' neounzip output.nzip tests/extracted/\n');
|
|
82
82
|
console.log(chalk_1.default.gray(' # List archive contents'));
|
|
83
83
|
console.log(' neolist output.nzip\n');
|
|
84
84
|
console.log(chalk_1.default.yellow.bold('For detailed help on each command:'));
|
package/dist/src/neolist.js
CHANGED
|
@@ -46,8 +46,10 @@ exports.parseArgs = parseArgs;
|
|
|
46
46
|
exports.showHelp = showHelp;
|
|
47
47
|
exports.showExtendedHelp = showExtendedHelp;
|
|
48
48
|
const fs = __importStar(require("fs"));
|
|
49
|
-
const neozipkit_1 = require("neozipkit");
|
|
50
49
|
const node_1 = __importDefault(require("neozipkit/node"));
|
|
50
|
+
const neozip_blockchain_1 = require("neozip-blockchain");
|
|
51
|
+
const ots_1 = require("neozip-blockchain/ots");
|
|
52
|
+
const zipstamp_server_1 = require("neozip-blockchain/zipstamp-server");
|
|
51
53
|
const chalk_1 = __importDefault(require("chalk"));
|
|
52
54
|
const ora_1 = __importDefault(require("ora"));
|
|
53
55
|
const version_1 = require("./version");
|
|
@@ -248,14 +250,20 @@ function getActualCompressedSize(entry) {
|
|
|
248
250
|
* Format entry name for display (handles blockchain metadata)
|
|
249
251
|
*/
|
|
250
252
|
function formatEntryName(entry) {
|
|
251
|
-
if (entry.filename ===
|
|
252
|
-
return `${
|
|
253
|
+
if (entry.filename === neozip_blockchain_1.TOKENIZED_METADATA) {
|
|
254
|
+
return `${neozip_blockchain_1.TOKENIZED_METADATA} (NFT Token)`;
|
|
253
255
|
}
|
|
254
|
-
if (entry.filename ===
|
|
255
|
-
return `${
|
|
256
|
+
if (entry.filename === ots_1.TIMESTAMP_METADATA) {
|
|
257
|
+
return `${ots_1.TIMESTAMP_METADATA} (OTS Timestamp)`;
|
|
256
258
|
}
|
|
257
|
-
if (entry.filename ===
|
|
258
|
-
return `${
|
|
259
|
+
if (entry.filename === ots_1.TIMESTAMP_SUBMITTED) {
|
|
260
|
+
return `${ots_1.TIMESTAMP_SUBMITTED} (OTS Pending)`;
|
|
261
|
+
}
|
|
262
|
+
if (entry.filename === zipstamp_server_1.SUBMIT_METADATA) {
|
|
263
|
+
return `${zipstamp_server_1.SUBMIT_METADATA} (Zipstamp Pending)`;
|
|
264
|
+
}
|
|
265
|
+
if (entry.filename === zipstamp_server_1.TIMESTAMP_METADATA) {
|
|
266
|
+
return `${zipstamp_server_1.TIMESTAMP_METADATA} (Zipstamp Timestamp)`;
|
|
259
267
|
}
|
|
260
268
|
return entry.filename;
|
|
261
269
|
}
|
|
@@ -453,8 +461,11 @@ function outputVerbose(entries, archivePath, zip, options = { verbose: false, qu
|
|
|
453
461
|
entries.forEach((entry, index) => {
|
|
454
462
|
// Use ZipEntry's showVerboseInfo() method for detailed information
|
|
455
463
|
log(`File ${index + 1}: ${formatEntryName(entry)}`, options);
|
|
456
|
-
// Call showVerboseInfo() directly - it will output to console
|
|
457
464
|
entry.showVerboseInfo();
|
|
465
|
+
if (entry.isEncrypted) {
|
|
466
|
+
const method = entry.aesVersion > 0 ? 'AES-256' : 'PKZIP';
|
|
467
|
+
log(` Encryption method: ${method}`, options);
|
|
468
|
+
}
|
|
458
469
|
log('', options);
|
|
459
470
|
});
|
|
460
471
|
// Summary
|
|
@@ -707,6 +718,9 @@ function outputJson(entries, archivePath, zip, options = { verbose: false, quiet
|
|
|
707
718
|
if (entry.isStrongEncrypt !== undefined) {
|
|
708
719
|
fileInfo.isStrongEncrypt = entry.isStrongEncrypt;
|
|
709
720
|
}
|
|
721
|
+
if (entry.isEncrypted) {
|
|
722
|
+
fileInfo.encryptionMethod = entry.aesVersion > 0 ? 'AES-256' : 'PKZIP';
|
|
723
|
+
}
|
|
710
724
|
// Add symbolic link information if present
|
|
711
725
|
if (entry.isSymlink !== undefined) {
|
|
712
726
|
fileInfo.isSymlink = entry.isSymlink;
|
|
@@ -955,9 +969,9 @@ Arguments:
|
|
|
955
969
|
<archive> ZIP file to list
|
|
956
970
|
|
|
957
971
|
Examples:
|
|
958
|
-
neolist output/calgary.nzip
|
|
959
|
-
neolist -b output/calgary.nzip
|
|
960
|
-
neolist -u output/calgary.nzip
|
|
972
|
+
neolist tests/output/calgary.nzip
|
|
973
|
+
neolist -b tests/output/calgary.nzip
|
|
974
|
+
neolist -u tests/output/calgary.nzip
|
|
961
975
|
`);
|
|
962
976
|
}
|
|
963
977
|
/**
|