@genobank/biofs 1.6.9 → 1.8.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/.claude/settings.local.json +33 -0
- package/BIOFS_CLI_NODE_CONVERGENCE_ANALYSIS.md +932 -0
- package/BIOFS_FEDERATED_NETWORK_ARCHITECTURE.md +1071 -0
- package/BIOFS_NODE_CLIENT_ARCHITECTURE.md +557 -0
- package/BIOFS_NODE_IMPLEMENTATION_PLAN.md +2164 -0
- package/BIOROUTER_IMPLEMENTATION_CHECKLIST.md +618 -0
- package/BUBBLEWRAP_INTEGRATION.md +486 -0
- package/BUBBLEWRAP_QUICKSTART.md +356 -0
- package/BUBBLEWRAP_README.md +466 -0
- package/BUBBLEWRAP_STRATEGIC_ANALYSIS.md +625 -0
- package/CHANGELOG.md +138 -120
- package/EXECUTIVE_SUMMARY_BIOROUTER_CONVERGENCE.md +323 -0
- package/GEMINI_REMOVAL_COMPLETE.md +311 -0
- package/debug_credentials.js +60 -0
- package/dist/commands/sandbox.d.ts +10 -0
- package/dist/commands/sandbox.d.ts.map +1 -0
- package/dist/commands/sandbox.js +418 -0
- package/dist/commands/sandbox.js.map +1 -0
- package/dist/index.js +11 -54
- package/dist/index.js.map +1 -1
- package/dist/lib/ai/classifier.d.ts +3 -1
- package/dist/lib/ai/classifier.d.ts.map +1 -1
- package/dist/lib/ai/classifier.js +37 -17
- package/dist/lib/ai/classifier.js.map +1 -1
- package/dist/lib/api/client.d.ts +0 -46
- package/dist/lib/api/client.d.ts.map +1 -1
- package/dist/lib/api/client.js +19 -159
- package/dist/lib/api/client.js.map +1 -1
- package/dist/lib/auth/server.d.ts.map +1 -1
- package/dist/lib/auth/server.js +11 -2
- package/dist/lib/auth/server.js.map +1 -1
- package/dist/lib/biofiles/fingerprint.d.ts.map +1 -1
- package/dist/lib/biofiles/fingerprint.js +40 -11
- package/dist/lib/biofiles/fingerprint.js.map +1 -1
- package/dist/lib/biofiles/resolver.d.ts.map +1 -1
- package/dist/lib/biofiles/resolver.js +75 -59
- package/dist/lib/biofiles/resolver.js.map +1 -1
- package/dist/lib/config/constants.d.ts +0 -1
- package/dist/lib/config/constants.d.ts.map +1 -1
- package/dist/lib/config/constants.js +3 -3
- package/dist/lib/config/constants.js.map +1 -1
- package/dist/lib/sandbox/bubblewrap.d.ts +125 -0
- package/dist/lib/sandbox/bubblewrap.d.ts.map +1 -0
- package/dist/lib/sandbox/bubblewrap.js +343 -0
- package/dist/lib/sandbox/bubblewrap.js.map +1 -0
- package/dist/lib/utils/logger.d.ts +6 -5
- package/dist/lib/utils/logger.d.ts.map +1 -1
- package/dist/lib/utils/logger.js +23 -5
- package/dist/lib/utils/logger.js.map +1 -1
- package/dist/types/api.d.ts +0 -21
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/biofiles.d.ts +2 -2
- package/dist/types/biofiles.d.ts.map +1 -1
- package/examples/sandbox-usage.ts +361 -0
- package/package.json +3 -2
- package/dist/commands/biofiles.d.ts +0 -9
- package/dist/commands/biofiles.d.ts.map +0 -1
- package/dist/commands/biofiles.js +0 -112
- package/dist/commands/biofiles.js.map +0 -1
- package/dist/commands/labs/list.d.ts +0 -19
- package/dist/commands/labs/list.d.ts.map +0 -1
- package/dist/commands/labs/list.js +0 -98
- package/dist/commands/labs/list.js.map +0 -1
- package/dist/commands/share.d.ts +0 -10
- package/dist/commands/share.d.ts.map +0 -1
- package/dist/commands/share.js +0 -186
- package/dist/commands/share.js.map +0 -1
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Bubblewrap Sandbox Integration for BioFS-CLI
|
|
4
|
+
*
|
|
5
|
+
* Provides secure isolation for genomic data processing operations
|
|
6
|
+
* using Linux namespaces via bubblewrap.
|
|
7
|
+
*
|
|
8
|
+
* Security guarantees:
|
|
9
|
+
* - Process isolation (PID namespace)
|
|
10
|
+
* - Network isolation (NET namespace)
|
|
11
|
+
* - Filesystem isolation (MOUNT namespace)
|
|
12
|
+
* - IPC isolation (IPC namespace)
|
|
13
|
+
* - Seccomp syscall filtering
|
|
14
|
+
* - Capability dropping
|
|
15
|
+
*
|
|
16
|
+
* @module lib/sandbox/bubblewrap
|
|
17
|
+
*/
|
|
18
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
21
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
22
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
23
|
+
}
|
|
24
|
+
Object.defineProperty(o, k2, desc);
|
|
25
|
+
}) : (function(o, m, k, k2) {
|
|
26
|
+
if (k2 === undefined) k2 = k;
|
|
27
|
+
o[k2] = m[k];
|
|
28
|
+
}));
|
|
29
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
30
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
31
|
+
}) : function(o, v) {
|
|
32
|
+
o["default"] = v;
|
|
33
|
+
});
|
|
34
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
35
|
+
var ownKeys = function(o) {
|
|
36
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
37
|
+
var ar = [];
|
|
38
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
39
|
+
return ar;
|
|
40
|
+
};
|
|
41
|
+
return ownKeys(o);
|
|
42
|
+
};
|
|
43
|
+
return function (mod) {
|
|
44
|
+
if (mod && mod.__esModule) return mod;
|
|
45
|
+
var result = {};
|
|
46
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
47
|
+
__setModuleDefault(result, mod);
|
|
48
|
+
return result;
|
|
49
|
+
};
|
|
50
|
+
})();
|
|
51
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
+
exports.BubblewrapSandbox = void 0;
|
|
53
|
+
exports.isSandboxAvailable = isSandboxAvailable;
|
|
54
|
+
exports.getSandboxVersion = getSandboxVersion;
|
|
55
|
+
const child_process_1 = require("child_process");
|
|
56
|
+
const util_1 = require("util");
|
|
57
|
+
const fs = __importStar(require("fs-extra"));
|
|
58
|
+
const path = __importStar(require("path"));
|
|
59
|
+
const os = __importStar(require("os"));
|
|
60
|
+
const logger_1 = require("../utils/logger");
|
|
61
|
+
const execFileAsync = (0, util_1.promisify)(child_process_1.execFile);
|
|
62
|
+
/**
|
|
63
|
+
* Bubblewrap sandbox wrapper for secure genomic data processing
|
|
64
|
+
*/
|
|
65
|
+
class BubblewrapSandbox {
|
|
66
|
+
constructor(config = {}) {
|
|
67
|
+
// Secure defaults for genomic data processing
|
|
68
|
+
this.config = {
|
|
69
|
+
isolateNetwork: config.isolateNetwork ?? true,
|
|
70
|
+
isolatePID: config.isolatePID ?? true,
|
|
71
|
+
isolateIPC: config.isolateIPC ?? true,
|
|
72
|
+
isolateUTS: config.isolateUTS ?? true,
|
|
73
|
+
enableSeccomp: config.enableSeccomp ?? true,
|
|
74
|
+
dropCapabilities: config.dropCapabilities ?? true,
|
|
75
|
+
hostname: config.hostname ?? 'biofs-sandbox',
|
|
76
|
+
workingDir: config.workingDir ?? '/workspace',
|
|
77
|
+
env: config.env ?? {},
|
|
78
|
+
mounts: config.mounts ?? [],
|
|
79
|
+
allowDevices: config.allowDevices ?? true,
|
|
80
|
+
allowProc: config.allowProc ?? true,
|
|
81
|
+
useTmpfs: config.useTmpfs ?? true,
|
|
82
|
+
dieWithParent: config.dieWithParent ?? true,
|
|
83
|
+
newSession: config.newSession ?? true,
|
|
84
|
+
uid: config.uid ?? os.userInfo().uid,
|
|
85
|
+
gid: config.gid ?? os.userInfo().gid,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Check if bubblewrap is available on the system
|
|
90
|
+
*/
|
|
91
|
+
static async isAvailable() {
|
|
92
|
+
try {
|
|
93
|
+
await execFileAsync('which', ['bwrap']);
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Get bubblewrap version
|
|
102
|
+
*/
|
|
103
|
+
static async getVersion() {
|
|
104
|
+
try {
|
|
105
|
+
const { stdout } = await execFileAsync('bwrap', ['--version']);
|
|
106
|
+
return stdout.trim();
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
throw new Error(`Failed to get bubblewrap version: ${error}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Execute a command in a sandboxed environment
|
|
114
|
+
*/
|
|
115
|
+
async exec(command, options = {}) {
|
|
116
|
+
if (!await BubblewrapSandbox.isAvailable()) {
|
|
117
|
+
throw new Error('bubblewrap is not installed. Install with: sudo apt-get install bubblewrap');
|
|
118
|
+
}
|
|
119
|
+
const bwrapArgs = await this.buildBwrapArgs(command);
|
|
120
|
+
logger_1.Logger.debug('Executing sandboxed command:', {
|
|
121
|
+
command: command.join(' '),
|
|
122
|
+
config: this.config,
|
|
123
|
+
});
|
|
124
|
+
try {
|
|
125
|
+
const { stdout, stderr } = await execFileAsync('bwrap', bwrapArgs, {
|
|
126
|
+
timeout: options.timeout,
|
|
127
|
+
maxBuffer: options.maxBuffer ?? 10 * 1024 * 1024, // 10MB default
|
|
128
|
+
encoding: 'utf8',
|
|
129
|
+
});
|
|
130
|
+
return {
|
|
131
|
+
stdout,
|
|
132
|
+
stderr,
|
|
133
|
+
exitCode: 0,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
logger_1.Logger.error('Sandboxed command failed:', {
|
|
138
|
+
command: command.join(' '),
|
|
139
|
+
error: error.message,
|
|
140
|
+
stderr: error.stderr,
|
|
141
|
+
});
|
|
142
|
+
return {
|
|
143
|
+
stdout: error.stdout || '',
|
|
144
|
+
stderr: error.stderr || error.message,
|
|
145
|
+
exitCode: error.code || 1,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Build bubblewrap argument array from config
|
|
151
|
+
*/
|
|
152
|
+
async buildBwrapArgs(command) {
|
|
153
|
+
const args = [];
|
|
154
|
+
// Essential system mounts (read-only)
|
|
155
|
+
args.push('--ro-bind', '/usr', '/usr');
|
|
156
|
+
args.push('--ro-bind', '/lib', '/lib');
|
|
157
|
+
if (await fs.pathExists('/lib64')) {
|
|
158
|
+
args.push('--ro-bind', '/lib64', '/lib64');
|
|
159
|
+
}
|
|
160
|
+
if (await fs.pathExists('/bin')) {
|
|
161
|
+
args.push('--ro-bind', '/bin', '/bin');
|
|
162
|
+
}
|
|
163
|
+
if (await fs.pathExists('/sbin')) {
|
|
164
|
+
args.push('--ro-bind', '/sbin', '/sbin');
|
|
165
|
+
}
|
|
166
|
+
// /proc filesystem
|
|
167
|
+
if (this.config.allowProc) {
|
|
168
|
+
args.push('--proc', '/proc');
|
|
169
|
+
}
|
|
170
|
+
// /dev devices
|
|
171
|
+
if (this.config.allowDevices) {
|
|
172
|
+
args.push('--dev', '/dev');
|
|
173
|
+
}
|
|
174
|
+
// Temporary filesystem for /tmp
|
|
175
|
+
if (this.config.useTmpfs) {
|
|
176
|
+
args.push('--tmpfs', '/tmp');
|
|
177
|
+
}
|
|
178
|
+
// Custom mounts
|
|
179
|
+
for (const mount of this.config.mounts) {
|
|
180
|
+
const mountFlag = mount.readonly ? '--ro-bind' : '--bind';
|
|
181
|
+
const resolvedSource = path.resolve(mount.source);
|
|
182
|
+
// Verify source exists
|
|
183
|
+
if (!await fs.pathExists(resolvedSource)) {
|
|
184
|
+
throw new Error(`Mount source does not exist: ${resolvedSource}`);
|
|
185
|
+
}
|
|
186
|
+
args.push(mountFlag, resolvedSource, mount.target);
|
|
187
|
+
}
|
|
188
|
+
// Working directory
|
|
189
|
+
if (this.config.workingDir) {
|
|
190
|
+
args.push('--chdir', this.config.workingDir);
|
|
191
|
+
}
|
|
192
|
+
// Network isolation
|
|
193
|
+
if (this.config.isolateNetwork) {
|
|
194
|
+
args.push('--unshare-net');
|
|
195
|
+
}
|
|
196
|
+
// PID isolation
|
|
197
|
+
if (this.config.isolatePID) {
|
|
198
|
+
args.push('--unshare-pid');
|
|
199
|
+
}
|
|
200
|
+
// IPC isolation
|
|
201
|
+
if (this.config.isolateIPC) {
|
|
202
|
+
args.push('--unshare-ipc');
|
|
203
|
+
}
|
|
204
|
+
// UTS isolation (hostname)
|
|
205
|
+
if (this.config.isolateUTS) {
|
|
206
|
+
args.push('--unshare-uts');
|
|
207
|
+
args.push('--hostname', this.config.hostname);
|
|
208
|
+
}
|
|
209
|
+
// User namespace
|
|
210
|
+
args.push('--unshare-user');
|
|
211
|
+
args.push('--uid', this.config.uid.toString());
|
|
212
|
+
args.push('--gid', this.config.gid.toString());
|
|
213
|
+
// Drop capabilities
|
|
214
|
+
if (this.config.dropCapabilities) {
|
|
215
|
+
args.push('--cap-drop', 'ALL');
|
|
216
|
+
}
|
|
217
|
+
// Seccomp filter
|
|
218
|
+
if (this.config.enableSeccomp) {
|
|
219
|
+
// Create temporary seccomp filter file
|
|
220
|
+
const seccompFilter = await this.createSeccompFilter();
|
|
221
|
+
args.push('--seccomp', '3');
|
|
222
|
+
// TODO: Pass seccomp filter via fd 3
|
|
223
|
+
}
|
|
224
|
+
// Die with parent
|
|
225
|
+
if (this.config.dieWithParent) {
|
|
226
|
+
args.push('--die-with-parent');
|
|
227
|
+
}
|
|
228
|
+
// New session
|
|
229
|
+
if (this.config.newSession) {
|
|
230
|
+
args.push('--new-session');
|
|
231
|
+
}
|
|
232
|
+
// Environment variables
|
|
233
|
+
for (const [key, value] of Object.entries(this.config.env)) {
|
|
234
|
+
args.push('--setenv', key, value);
|
|
235
|
+
}
|
|
236
|
+
// Command separator
|
|
237
|
+
args.push('--');
|
|
238
|
+
// Actual command to execute
|
|
239
|
+
args.push(...command);
|
|
240
|
+
return args;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Create seccomp filter for syscall restrictions
|
|
244
|
+
*
|
|
245
|
+
* Allows safe syscalls for file I/O, memory management, and process control
|
|
246
|
+
* Blocks dangerous syscalls like ptrace, mount, kexec, etc.
|
|
247
|
+
*/
|
|
248
|
+
async createSeccompFilter() {
|
|
249
|
+
// TODO: Implement seccomp BPF filter
|
|
250
|
+
// For now, bubblewrap's default filter is sufficient
|
|
251
|
+
return '';
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Create a pre-configured sandbox for genomic file download
|
|
255
|
+
*/
|
|
256
|
+
static forDownload(outputDir) {
|
|
257
|
+
return new BubblewrapSandbox({
|
|
258
|
+
isolateNetwork: false, // Need network for S3/IPFS
|
|
259
|
+
isolatePID: true,
|
|
260
|
+
isolateIPC: true,
|
|
261
|
+
mounts: [
|
|
262
|
+
{ source: outputDir, target: '/output', readonly: false },
|
|
263
|
+
{
|
|
264
|
+
source: path.join(os.homedir(), '.genobank/credentials.json'),
|
|
265
|
+
target: '/credentials.json',
|
|
266
|
+
readonly: true,
|
|
267
|
+
},
|
|
268
|
+
],
|
|
269
|
+
workingDir: '/output',
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Create a pre-configured sandbox for genomic file upload
|
|
274
|
+
*/
|
|
275
|
+
static forUpload(inputPath, tempDir) {
|
|
276
|
+
return new BubblewrapSandbox({
|
|
277
|
+
isolateNetwork: false, // Need network for S3
|
|
278
|
+
isolatePID: true,
|
|
279
|
+
isolateIPC: true,
|
|
280
|
+
mounts: [
|
|
281
|
+
{ source: inputPath, target: '/input', readonly: true },
|
|
282
|
+
{ source: tempDir, target: '/temp', readonly: false },
|
|
283
|
+
{
|
|
284
|
+
source: path.join(os.homedir(), '.genobank/credentials.json'),
|
|
285
|
+
target: '/credentials.json',
|
|
286
|
+
readonly: true,
|
|
287
|
+
},
|
|
288
|
+
],
|
|
289
|
+
workingDir: '/temp',
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Create a pre-configured sandbox for local file processing (no network)
|
|
294
|
+
*/
|
|
295
|
+
static forProcessing(inputPath, outputDir) {
|
|
296
|
+
return new BubblewrapSandbox({
|
|
297
|
+
isolateNetwork: true, // NO NETWORK - prevent exfiltration
|
|
298
|
+
isolatePID: true,
|
|
299
|
+
isolateIPC: true,
|
|
300
|
+
mounts: [
|
|
301
|
+
{ source: inputPath, target: '/data/input', readonly: true },
|
|
302
|
+
{ source: outputDir, target: '/data/output', readonly: false },
|
|
303
|
+
],
|
|
304
|
+
workingDir: '/data',
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Create a pre-configured sandbox for research job execution
|
|
309
|
+
*/
|
|
310
|
+
static forJob(jobConfig) {
|
|
311
|
+
const mounts = jobConfig.inputs.map((input, index) => ({
|
|
312
|
+
source: input,
|
|
313
|
+
target: `/data/input/${index}`,
|
|
314
|
+
readonly: true,
|
|
315
|
+
}));
|
|
316
|
+
mounts.push({
|
|
317
|
+
source: jobConfig.outputDir,
|
|
318
|
+
target: '/data/output',
|
|
319
|
+
readonly: false,
|
|
320
|
+
});
|
|
321
|
+
return new BubblewrapSandbox({
|
|
322
|
+
isolateNetwork: !jobConfig.allowNetwork,
|
|
323
|
+
isolatePID: true,
|
|
324
|
+
isolateIPC: true,
|
|
325
|
+
mounts,
|
|
326
|
+
workingDir: '/data',
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
exports.BubblewrapSandbox = BubblewrapSandbox;
|
|
331
|
+
/**
|
|
332
|
+
* Convenience function to check if sandboxing is available
|
|
333
|
+
*/
|
|
334
|
+
async function isSandboxAvailable() {
|
|
335
|
+
return BubblewrapSandbox.isAvailable();
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Convenience function to get sandbox version info
|
|
339
|
+
*/
|
|
340
|
+
async function getSandboxVersion() {
|
|
341
|
+
return BubblewrapSandbox.getVersion();
|
|
342
|
+
}
|
|
343
|
+
//# sourceMappingURL=bubblewrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bubblewrap.js","sourceRoot":"","sources":["../../../src/lib/sandbox/bubblewrap.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuZH,gDAEC;AAKD,8CAEC;AA9ZD,iDAAyC;AACzC,+BAAiC;AACjC,6CAA+B;AAC/B,2CAA6B;AAC7B,uCAAyB;AACzB,4CAAyC;AAEzC,MAAM,aAAa,GAAG,IAAA,gBAAS,EAAC,wBAAQ,CAAC,CAAC;AAmE1C;;GAEG;AACH,MAAa,iBAAiB;IAG5B,YAAY,SAAwB,EAAE;QACpC,8CAA8C;QAC9C,IAAI,CAAC,MAAM,GAAG;YACZ,cAAc,EAAE,MAAM,CAAC,cAAc,IAAI,IAAI;YAC7C,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,IAAI;YACrC,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,IAAI;YACrC,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,IAAI;YACrC,aAAa,EAAE,MAAM,CAAC,aAAa,IAAI,IAAI;YAC3C,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,IAAI,IAAI;YACjD,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,eAAe;YAC5C,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,YAAY;YAC7C,GAAG,EAAE,MAAM,CAAC,GAAG,IAAI,EAAE;YACrB,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;YAC3B,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,IAAI;YACzC,SAAS,EAAE,MAAM,CAAC,SAA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,UAAU,EAAE,OAAO;SACpB,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,SAIb;QACC,MAAM,MAAM,GAAkB,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;YACpE,MAAM,EAAE,KAAK;YACb,MAAM,EAAE,eAAe,KAAK,EAAE;YAC9B,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC,CAAC;QAEJ,MAAM,CAAC,IAAI,CAAC;YACV,MAAM,EAAE,SAAS,CAAC,SAAS;YAC3B,MAAM,EAAE,cAAc;YACtB,QAAQ,EAAE,KAAK;SAChB,CAAC,CAAC;QAEH,OAAO,IAAI,iBAAiB,CAAC;YAC3B,cAAc,EAAE,CAAC,SAAS,CAAC,YAAY;YACvC,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,IAAI;YAChB,MAAM;YACN,UAAU,EAAE,OAAO;SACpB,CAAC,CAAC;IACL,CAAC;CACF;AAnUD,8CAmUC;AAED;;GAEG;AACI,KAAK,UAAU,kBAAkB;IACtC,OAAO,iBAAiB,CAAC,WAAW,EAAE,CAAC;AACzC,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,iBAAiB;IACrC,OAAO,iBAAiB,CAAC,UAAU,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Ora } from 'ora';
|
|
2
2
|
export declare class Logger {
|
|
3
|
-
static success(message: string): void;
|
|
4
|
-
static error(message: string): void;
|
|
5
|
-
static warning(message: string): void;
|
|
6
|
-
static
|
|
7
|
-
static
|
|
3
|
+
static success(message: string, context?: any): void;
|
|
4
|
+
static error(message: string, context?: any): void;
|
|
5
|
+
static warning(message: string, context?: any): void;
|
|
6
|
+
static warn(message: string, context?: any): void;
|
|
7
|
+
static info(message: string, context?: any): void;
|
|
8
|
+
static debug(message: string, context?: any): void;
|
|
8
9
|
static box(content: string, title?: string): void;
|
|
9
10
|
static table(headers: string[], rows: string[][]): void;
|
|
10
11
|
static spinner(text: string): Ora;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/logger.ts"],"names":[],"mappings":"AAEA,OAAY,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE/B,qBAAa,MAAM;IACjB,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/logger.ts"],"names":[],"mappings":"AAEA,OAAY,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE/B,qBAAa,MAAM;IACjB,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI;IAOpD,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI;IAOlD,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI;IAOpD,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI;IAIjD,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI;IAOjD,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI;IASlD,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAajD,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,IAAI;IAcvD,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG;IAOjC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAK3C,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM;IAK9C,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAQ5C,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;CAW1C"}
|
package/dist/lib/utils/logger.js
CHANGED
|
@@ -8,21 +8,39 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
8
8
|
const boxen_1 = __importDefault(require("boxen"));
|
|
9
9
|
const ora_1 = __importDefault(require("ora"));
|
|
10
10
|
class Logger {
|
|
11
|
-
static success(message) {
|
|
11
|
+
static success(message, context) {
|
|
12
12
|
console.log(chalk_1.default.green(`✅ ${message}`));
|
|
13
|
+
if (context && process.env.DEBUG) {
|
|
14
|
+
console.log(chalk_1.default.gray(JSON.stringify(context, null, 2)));
|
|
15
|
+
}
|
|
13
16
|
}
|
|
14
|
-
static error(message) {
|
|
17
|
+
static error(message, context) {
|
|
15
18
|
console.log(chalk_1.default.red(`❌ ${message}`));
|
|
19
|
+
if (context) {
|
|
20
|
+
console.error(chalk_1.default.red(typeof context === 'string' ? context : JSON.stringify(context, null, 2)));
|
|
21
|
+
}
|
|
16
22
|
}
|
|
17
|
-
static warning(message) {
|
|
23
|
+
static warning(message, context) {
|
|
18
24
|
console.log(chalk_1.default.yellow(`⚠️ ${message}`));
|
|
25
|
+
if (context && process.env.DEBUG) {
|
|
26
|
+
console.log(chalk_1.default.gray(JSON.stringify(context, null, 2)));
|
|
27
|
+
}
|
|
19
28
|
}
|
|
20
|
-
static
|
|
29
|
+
static warn(message, context) {
|
|
30
|
+
this.warning(message, context);
|
|
31
|
+
}
|
|
32
|
+
static info(message, context) {
|
|
21
33
|
console.log(chalk_1.default.blue(`ℹ️ ${message}`));
|
|
34
|
+
if (context && process.env.DEBUG) {
|
|
35
|
+
console.log(chalk_1.default.gray(JSON.stringify(context, null, 2)));
|
|
36
|
+
}
|
|
22
37
|
}
|
|
23
|
-
static debug(message) {
|
|
38
|
+
static debug(message, context) {
|
|
24
39
|
if (process.env.DEBUG) {
|
|
25
40
|
console.log(chalk_1.default.gray(`🔍 ${message}`));
|
|
41
|
+
if (context) {
|
|
42
|
+
console.log(chalk_1.default.gray(JSON.stringify(context, null, 2)));
|
|
43
|
+
}
|
|
26
44
|
}
|
|
27
45
|
}
|
|
28
46
|
static box(content, title) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/lib/utils/logger.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,kDAA0B;AAC1B,8CAA+B;AAE/B,MAAa,MAAM;IACjB,MAAM,CAAC,OAAO,CAAC,OAAe;
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/lib/utils/logger.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,kDAA0B;AAC1B,8CAA+B;AAE/B,MAAa,MAAM;IACjB,MAAM,CAAC,OAAO,CAAC,OAAe,EAAE,OAAa;QAC3C,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC;QACzC,IAAI,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;YACjC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAAe,EAAE,OAAa;QACzC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC;QACvC,IAAI,OAAO,EAA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CAAC;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;QAEpC,IAAI,IAAI,GAAG,CAAC;YAAE,OAAO,GAAG,IAAI,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC3D,IAAI,KAAK,GAAG,CAAC;YAAE,OAAO,GAAG,KAAK,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC/D,IAAI,OAAO,GAAG,CAAC;YAAE,OAAO,GAAG,OAAO,UAAU,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACvE,OAAO,GAAG,OAAO,UAAU,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IACxD,CAAC;CACF;AAzGD,wBAyGC"}
|
package/dist/types/api.d.ts
CHANGED
|
@@ -21,35 +21,14 @@ export interface FileInfo {
|
|
|
21
21
|
export interface FileWithURL extends FileInfo {
|
|
22
22
|
presigned_url?: string;
|
|
23
23
|
download_url?: string;
|
|
24
|
-
original_name?: string;
|
|
25
|
-
path?: string;
|
|
26
|
-
extension?: string;
|
|
27
|
-
type?: string;
|
|
28
24
|
}
|
|
29
25
|
export interface IPAsset {
|
|
30
26
|
ipId: string;
|
|
31
27
|
owner: string;
|
|
32
|
-
wallet_address?: string;
|
|
33
28
|
metadata_uri?: string;
|
|
34
|
-
metadata?: {
|
|
35
|
-
name?: string;
|
|
36
|
-
description?: string;
|
|
37
|
-
image?: string;
|
|
38
|
-
[key: string]: any;
|
|
39
|
-
};
|
|
40
29
|
nft_id?: string;
|
|
41
|
-
token_id?: number;
|
|
42
30
|
created_at?: string;
|
|
43
31
|
collection?: string;
|
|
44
|
-
collection_address?: string;
|
|
45
|
-
filename?: string;
|
|
46
|
-
original_filename?: string;
|
|
47
|
-
file_type?: string;
|
|
48
|
-
type?: string;
|
|
49
|
-
s3_path?: string;
|
|
50
|
-
ipfs_hash?: string;
|
|
51
|
-
source?: string;
|
|
52
|
-
chain?: string;
|
|
53
32
|
}
|
|
54
33
|
export interface Biosample {
|
|
55
34
|
biosample_serial: string;
|
package/dist/types/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/types/api.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,GAAG;IAClC,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC;IAC9B,cAAc,CAAC,EAAE;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,CAAC,CAAC;KACV,CAAC;CACH;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAY,SAAQ,QAAQ;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/types/api.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,GAAG;IAClC,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC;IAC9B,cAAc,CAAC,EAAE;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,CAAC,CAAC;KACV,CAAC;CACH;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAY,SAAQ,QAAQ;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,SAAS;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB"}
|
package/dist/types/biofiles.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface BioFile {
|
|
|
9
9
|
biocid: string;
|
|
10
10
|
type: string;
|
|
11
11
|
size?: number;
|
|
12
|
-
source: 'S3' | 'BioFS' | 'IPFS' | 'Story'
|
|
12
|
+
source: 'S3' | 'BioFS' | 'IPFS' | 'Story';
|
|
13
13
|
created_at?: string;
|
|
14
14
|
ip_asset?: string;
|
|
15
15
|
s3_path?: string;
|
|
@@ -20,7 +20,7 @@ export interface BioFile {
|
|
|
20
20
|
license_type?: string;
|
|
21
21
|
}
|
|
22
22
|
export interface FileLocation {
|
|
23
|
-
type: 'S3' | 'BioFS' | 'IPFS' | 'Story'
|
|
23
|
+
type: 'S3' | 'BioFS' | 'IPFS' | 'Story';
|
|
24
24
|
path?: string;
|
|
25
25
|
bucket?: string;
|
|
26
26
|
presigned_url?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biofiles.d.ts","sourceRoot":"","sources":["../../src/types/biofiles.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,IAAI,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"biofiles.d.ts","sourceRoot":"","sources":["../../src/types/biofiles.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EA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