neozip-cli 0.70.0-alpha → 0.75.0-beta
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 +12 -12
- package/dist/neozipkit-bundles/blockchain.js +1491 -857
- package/dist/neozipkit-bundles/browser.js +755 -302
- package/dist/neozipkit-bundles/core.js +235 -162
- package/dist/neozipkit-bundles/{server.js → node.js} +4415 -1681
- package/dist/neozipkit-wrappers/index.js +2 -2
- package/dist/neozipkit-wrappers/node/index.js +2 -0
- package/package.json +7 -8
- package/dist/neozipkit-wrappers/server/index.js +0 -2
- package/dist/src/config/ConfigSetup.js +0 -455
- package/dist/src/config/ConfigStore.js +0 -373
- package/dist/src/config/ConfigWizard.js +0 -453
- package/dist/src/config/WalletConfig.js +0 -372
- package/dist/src/exit-codes.js +0 -210
- package/dist/src/index.js +0 -141
- package/dist/src/neolist.js +0 -1194
- package/dist/src/neounzip.js +0 -2177
- package/dist/src/neozip/CommentManager.js +0 -240
- package/dist/src/neozip/blockchain.js +0 -383
- package/dist/src/neozip/createZip.js +0 -2273
- package/dist/src/neozip/file-operations.js +0 -920
- package/dist/src/neozip/types.js +0 -6
- package/dist/src/neozip/user-interaction.js +0 -256
- package/dist/src/neozip/utils.js +0 -96
- package/dist/src/neozip.js +0 -785
- package/dist/src/server/CommentManager.js +0 -240
- package/dist/src/version.js +0 -59
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* CommentManager - Handles archive and file comments for ZIP files
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
-
var ownKeys = function(o) {
|
|
23
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
-
var ar = [];
|
|
25
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
-
return ar;
|
|
27
|
-
};
|
|
28
|
-
return ownKeys(o);
|
|
29
|
-
};
|
|
30
|
-
return function (mod) {
|
|
31
|
-
if (mod && mod.__esModule) return mod;
|
|
32
|
-
var result = {};
|
|
33
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
-
__setModuleDefault(result, mod);
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
})();
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.CommentManager = void 0;
|
|
40
|
-
const fs = __importStar(require("fs"));
|
|
41
|
-
const readline = __importStar(require("readline"));
|
|
42
|
-
class CommentManager {
|
|
43
|
-
static setArchiveComment(zip, comment) {
|
|
44
|
-
try {
|
|
45
|
-
if (zip && typeof zip.setZipComment === 'function') {
|
|
46
|
-
zip.setZipComment(comment);
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
catch (error) {
|
|
52
|
-
console.error('Error setting archive comment:', error);
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
static getArchiveComment(zip) {
|
|
57
|
-
try {
|
|
58
|
-
if (zip && typeof zip.getZipComment === 'function') {
|
|
59
|
-
return zip.getZipComment();
|
|
60
|
-
}
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
catch (error) {
|
|
64
|
-
console.error('Error getting archive comment:', error);
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
static setFileComment(entry, comment) {
|
|
69
|
-
try {
|
|
70
|
-
if (entry && typeof entry.comment !== 'undefined') {
|
|
71
|
-
entry.comment = comment;
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
catch (error) {
|
|
77
|
-
console.error('Error setting file comment:', error);
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
static getFileComment(entry) {
|
|
82
|
-
try {
|
|
83
|
-
if (entry && typeof entry.comment !== 'undefined') {
|
|
84
|
-
return entry.comment || null;
|
|
85
|
-
}
|
|
86
|
-
return null;
|
|
87
|
-
}
|
|
88
|
-
catch (error) {
|
|
89
|
-
console.error('Error getting file comment:', error);
|
|
90
|
-
return null;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
static async readCommentsFromFile(filePath) {
|
|
94
|
-
try {
|
|
95
|
-
if (!fs.existsSync(filePath)) {
|
|
96
|
-
return { success: false, error: `Comment file not found: ${filePath}` };
|
|
97
|
-
}
|
|
98
|
-
const content = fs.readFileSync(filePath, 'utf8');
|
|
99
|
-
const lines = content.split('\n');
|
|
100
|
-
let archiveComment = '';
|
|
101
|
-
const fileComments = {};
|
|
102
|
-
let currentFile = '';
|
|
103
|
-
let currentComment = '';
|
|
104
|
-
for (const line of lines) {
|
|
105
|
-
const trimmedLine = line.trim();
|
|
106
|
-
if (!trimmedLine) {
|
|
107
|
-
if (currentFile && currentComment) {
|
|
108
|
-
fileComments[currentFile] = currentComment.trim();
|
|
109
|
-
currentFile = '';
|
|
110
|
-
currentComment = '';
|
|
111
|
-
}
|
|
112
|
-
continue;
|
|
113
|
-
}
|
|
114
|
-
if (trimmedLine.includes(':')) {
|
|
115
|
-
if (currentFile && currentComment) {
|
|
116
|
-
fileComments[currentFile] = currentComment.trim();
|
|
117
|
-
}
|
|
118
|
-
const colonIndex = trimmedLine.indexOf(':');
|
|
119
|
-
currentFile = trimmedLine.substring(0, colonIndex).trim();
|
|
120
|
-
currentComment = trimmedLine.substring(colonIndex + 1).trim();
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
if (currentFile) {
|
|
124
|
-
currentComment += (currentComment ? '\n' : '') + trimmedLine;
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
archiveComment += (archiveComment ? '\n' : '') + trimmedLine;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
if (currentFile && currentComment) {
|
|
132
|
-
fileComments[currentFile] = currentComment.trim();
|
|
133
|
-
}
|
|
134
|
-
return {
|
|
135
|
-
success: true,
|
|
136
|
-
archiveComment: archiveComment || undefined,
|
|
137
|
-
fileComments: Object.keys(fileComments).length > 0 ? fileComments : undefined
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
catch (error) {
|
|
141
|
-
return {
|
|
142
|
-
success: false,
|
|
143
|
-
error: `Error reading comment file: ${error instanceof Error ? error.message : String(error)}`
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
static async promptForArchiveComment() {
|
|
148
|
-
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
149
|
-
return new Promise((resolve) => {
|
|
150
|
-
rl.question('Enter archive comment (press Enter twice to finish):\n', (comment) => {
|
|
151
|
-
const lines = [comment];
|
|
152
|
-
const readLine = () => {
|
|
153
|
-
rl.question('', (line) => {
|
|
154
|
-
if (line.trim() === '') {
|
|
155
|
-
rl.close();
|
|
156
|
-
resolve(lines.join('\n').trim());
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
lines.push(line);
|
|
160
|
-
readLine();
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
};
|
|
164
|
-
readLine();
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
static async promptForFileComments(filenames) {
|
|
169
|
-
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
170
|
-
const fileComments = {};
|
|
171
|
-
for (const filename of filenames) {
|
|
172
|
-
const comment = await new Promise((resolve) => {
|
|
173
|
-
rl.question(`Enter comment for ${filename}: `, (input) => resolve(input.trim()));
|
|
174
|
-
});
|
|
175
|
-
if (comment)
|
|
176
|
-
fileComments[filename] = comment;
|
|
177
|
-
}
|
|
178
|
-
rl.close();
|
|
179
|
-
return fileComments;
|
|
180
|
-
}
|
|
181
|
-
static async promptForFileCommentsOnly(filenames) {
|
|
182
|
-
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
183
|
-
const fileComments = {};
|
|
184
|
-
for (const filename of filenames) {
|
|
185
|
-
const comment = await new Promise((resolve) => {
|
|
186
|
-
rl.question(`Enter comment for ${filename}: `, (input) => resolve(input.trim()));
|
|
187
|
-
});
|
|
188
|
-
if (comment)
|
|
189
|
-
fileComments[filename] = comment;
|
|
190
|
-
}
|
|
191
|
-
rl.close();
|
|
192
|
-
return fileComments;
|
|
193
|
-
}
|
|
194
|
-
static applyComments(zip, entries, options) {
|
|
195
|
-
try {
|
|
196
|
-
let success = true;
|
|
197
|
-
const errors = [];
|
|
198
|
-
if (options.archiveComment) {
|
|
199
|
-
if (!this.setArchiveComment(zip, options.archiveComment)) {
|
|
200
|
-
success = false;
|
|
201
|
-
errors.push('Failed to set archive comment');
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
if (options.fileComments) {
|
|
205
|
-
for (const [filename, comment] of Object.entries(options.fileComments)) {
|
|
206
|
-
const entry = entries.find((e) => e.filename === filename);
|
|
207
|
-
if (entry) {
|
|
208
|
-
if (!this.setFileComment(entry, comment)) {
|
|
209
|
-
success = false;
|
|
210
|
-
errors.push(`Failed to set comment for ${filename}`);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
else {
|
|
214
|
-
success = false;
|
|
215
|
-
errors.push(`File not found: ${filename}`);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
return { success, archiveComment: options.archiveComment, fileComments: options.fileComments, error: errors.length > 0 ? errors.join('; ') : undefined };
|
|
220
|
-
}
|
|
221
|
-
catch (error) {
|
|
222
|
-
return { success: false, error: `Error applying comments: ${error instanceof Error ? error.message : String(error)}` };
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
static applyFileCommentToEntry(entry, filename, fileComments) {
|
|
226
|
-
try {
|
|
227
|
-
if (fileComments[filename]) {
|
|
228
|
-
return this.setFileComment(entry, fileComments[filename]);
|
|
229
|
-
}
|
|
230
|
-
return true;
|
|
231
|
-
}
|
|
232
|
-
catch (error) {
|
|
233
|
-
console.error(`Error applying file comment to ${filename}:`, error);
|
|
234
|
-
return false;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
exports.CommentManager = CommentManager;
|
|
239
|
-
exports.default = CommentManager;
|
|
240
|
-
//# sourceMappingURL=CommentManager.js.map
|
package/dist/src/version.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Centralized version information for NeoZip CLI
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
-
var ownKeys = function(o) {
|
|
23
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
-
var ar = [];
|
|
25
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
-
return ar;
|
|
27
|
-
};
|
|
28
|
-
return ownKeys(o);
|
|
29
|
-
};
|
|
30
|
-
return function (mod) {
|
|
31
|
-
if (mod && mod.__esModule) return mod;
|
|
32
|
-
var result = {};
|
|
33
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
-
__setModuleDefault(result, mod);
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
})();
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.APP_RELEASE_DATE = exports.APP_VERSION = void 0;
|
|
40
|
-
const path = __importStar(require("path"));
|
|
41
|
-
const fs = __importStar(require("fs"));
|
|
42
|
-
// Resolve package.json path - works in both development and installed locations
|
|
43
|
-
function getPackageJson() {
|
|
44
|
-
// Try relative path first (development)
|
|
45
|
-
let packageJsonPath = path.join(__dirname, '../package.json');
|
|
46
|
-
if (!fs.existsSync(packageJsonPath)) {
|
|
47
|
-
// If not found, try going up two levels (installed: dist/src -> dist -> root)
|
|
48
|
-
packageJsonPath = path.join(__dirname, '../../package.json');
|
|
49
|
-
}
|
|
50
|
-
if (!fs.existsSync(packageJsonPath)) {
|
|
51
|
-
// Last resort: try from process.cwd() or __dirname
|
|
52
|
-
packageJsonPath = path.join(__dirname, '../../../package.json');
|
|
53
|
-
}
|
|
54
|
-
return JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
55
|
-
}
|
|
56
|
-
const packageJson = getPackageJson();
|
|
57
|
-
exports.APP_VERSION = packageJson.version;
|
|
58
|
-
exports.APP_RELEASE_DATE = packageJson.release_date || new Date().toISOString().split('T')[0];
|
|
59
|
-
//# sourceMappingURL=version.js.map
|