@genobank/biofs 1.8.4 → 1.8.10
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 +100 -191
- package/dist/commands/biofiles.d.ts +1 -1
- package/dist/commands/biofiles.d.ts.map +1 -1
- package/dist/commands/biofiles.js +100 -21
- package/dist/commands/biofiles.js.map +1 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +45 -0
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/share.d.ts.map +1 -1
- package/dist/commands/share.js +137 -4
- package/dist/commands/share.js.map +1 -1
- package/dist/commands/tokenize.d.ts.map +1 -1
- package/dist/commands/tokenize.js +29 -0
- package/dist/commands/tokenize.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/api/client.d.ts +14 -1
- package/dist/lib/api/client.d.ts.map +1 -1
- package/dist/lib/api/client.js +87 -15
- package/dist/lib/api/client.js.map +1 -1
- package/dist/lib/biofiles/resolver.d.ts.map +1 -1
- package/dist/lib/biofiles/resolver.js +19 -2
- package/dist/lib/biofiles/resolver.js.map +1 -1
- package/dist/lib/genomics/vcf-fingerprint.d.ts +63 -0
- package/dist/lib/genomics/vcf-fingerprint.d.ts.map +1 -0
- package/dist/lib/genomics/vcf-fingerprint.js +337 -0
- package/dist/lib/genomics/vcf-fingerprint.js.map +1 -0
- package/dist/lib/storage/biofiles-cache.d.ts +109 -0
- package/dist/lib/storage/biofiles-cache.d.ts.map +1 -0
- package/dist/lib/storage/biofiles-cache.js +272 -0
- package/dist/lib/storage/biofiles-cache.js.map +1 -0
- package/package.json +2 -1
- package/dist/commands/files.d.ts +0 -9
- package/dist/commands/files.d.ts.map +0 -1
- package/dist/commands/files.js +0 -112
- package/dist/commands/files.js.map +0 -1
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* VCF Fingerprint Calculator
|
|
4
|
+
* Ported from Python vcfAnnotator/libs/utils/fingerprint.py
|
|
5
|
+
*
|
|
6
|
+
* Calculates DNA fingerprints from VCF, 23andMe, and genomic text files
|
|
7
|
+
* using SNP markers and bloom filters for privacy-preserving identification.
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.VCFFingerprint = void 0;
|
|
44
|
+
const crypto = __importStar(require("crypto"));
|
|
45
|
+
const fs = __importStar(require("fs"));
|
|
46
|
+
const zlib = __importStar(require("zlib"));
|
|
47
|
+
const bloom_filters_1 = require("bloom-filters");
|
|
48
|
+
class VCFFingerprint {
|
|
49
|
+
constructor() {
|
|
50
|
+
// SNPs used for fingerprinting (from 23andMe)
|
|
51
|
+
this.fingerprintSNPs = [
|
|
52
|
+
'rs952718', 'rs7803075', 'rs9319336', 'rs2397060', 'rs1344870', 'rs2946788',
|
|
53
|
+
'rs6591147', 'rs2272998', 'rs7229946', 'rs9951171', 'rs525869', 'rs530501',
|
|
54
|
+
'rs2040962', 'rs2032624', 'rs1865680', 'rs17307398', 'rs3795366', 'rs2460111',
|
|
55
|
+
'rs1675126', 'rs1061629', 'rs538847', 'rs76432344', 'rs3750390', 'rs1624844',
|
|
56
|
+
'rs3803390', 'rs2293768', 'rs9358890', 'rs11197835', 'rs1806191', 'rs7953',
|
|
57
|
+
'rs3736757', 'rs2940779', 'rs7522034', 'rs6107027', 'rs2275059', 'rs3746805',
|
|
58
|
+
'rs4953042', 'rs3817098', 'rs6965201', 'rs5998', 'rs7259333', 'rs1802778',
|
|
59
|
+
'rs907157', 'rs8064024', 'rs3749970', 'rs7933089', 'rs2292745', 'rs1799932',
|
|
60
|
+
'rs4078313', 'rs2266918', 'rs805423', 'rs540261', 'rs3734586', 'rs3753886'
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Process a file and generate DNA fingerprint
|
|
65
|
+
*/
|
|
66
|
+
async processFile(filePath, sampleIndex = 0, numSnps = 50) {
|
|
67
|
+
// Read file (handle .gz compression)
|
|
68
|
+
let fileContent;
|
|
69
|
+
if (filePath.endsWith('.gz')) {
|
|
70
|
+
const compressed = fs.readFileSync(filePath);
|
|
71
|
+
fileContent = zlib.gunzipSync(compressed);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
fileContent = fs.readFileSync(filePath);
|
|
75
|
+
}
|
|
76
|
+
const text = fileContent.toString('utf-8');
|
|
77
|
+
const lines = text.split('\n');
|
|
78
|
+
// Detect file type
|
|
79
|
+
const is23andMe = this.detect23andMe(lines);
|
|
80
|
+
const isVCF = this.detectVCF(lines);
|
|
81
|
+
if (is23andMe) {
|
|
82
|
+
return this.process23andMe(lines);
|
|
83
|
+
}
|
|
84
|
+
else if (isVCF) {
|
|
85
|
+
return this.processVCF(lines, sampleIndex, numSnps);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
// Try 23andMe format by default
|
|
89
|
+
return this.process23andMe(lines);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Process text content directly (for in-memory data)
|
|
94
|
+
*/
|
|
95
|
+
processText(text, sampleIndex = 0, numSnps = 50) {
|
|
96
|
+
const lines = text.split('\n');
|
|
97
|
+
const is23andMe = this.detect23andMe(lines);
|
|
98
|
+
const isVCF = this.detectVCF(lines);
|
|
99
|
+
if (is23andMe) {
|
|
100
|
+
return this.process23andMe(lines);
|
|
101
|
+
}
|
|
102
|
+
else if (isVCF) {
|
|
103
|
+
return this.processVCF(lines, sampleIndex, numSnps);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
return this.process23andMe(lines);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Detect 23andMe format
|
|
111
|
+
*/
|
|
112
|
+
detect23andMe(lines) {
|
|
113
|
+
for (const line of lines.slice(0, 50)) {
|
|
114
|
+
if (line.includes('23andMe') || line.includes('AncestryDNA') || line.includes('MyHeritage')) {
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
if (line.startsWith('# rsid') || (line.startsWith('rs') && line.includes('\t'))) {
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Detect VCF format
|
|
125
|
+
*/
|
|
126
|
+
detectVCF(lines) {
|
|
127
|
+
for (const line of lines.slice(0, 50)) {
|
|
128
|
+
if (line.startsWith('##fileformat=VCF') || line.startsWith('#CHROM')) {
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Process 23andMe format file
|
|
136
|
+
*/
|
|
137
|
+
process23andMe(lines) {
|
|
138
|
+
const snpGenotypes = {};
|
|
139
|
+
for (const line of lines) {
|
|
140
|
+
// Skip comments and headers
|
|
141
|
+
if (line.startsWith('#') || !line.trim()) {
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
// Split by tab
|
|
145
|
+
const parts = line.trim().split('\t');
|
|
146
|
+
if (parts.length >= 4) {
|
|
147
|
+
const rsid = parts[0];
|
|
148
|
+
const genotype = parts[3] || '';
|
|
149
|
+
// Check if this is one of our fingerprint SNPs
|
|
150
|
+
if (this.fingerprintSNPs.includes(rsid)) {
|
|
151
|
+
snpGenotypes[rsid] = genotype;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (Object.keys(snpGenotypes).length === 0) {
|
|
156
|
+
throw new Error('No fingerprint SNPs found in file');
|
|
157
|
+
}
|
|
158
|
+
return this.generateBloomFingerprint(snpGenotypes);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Process VCF format file
|
|
162
|
+
*/
|
|
163
|
+
processVCF(lines, sampleIndex, numSnps) {
|
|
164
|
+
let sampleNames = [];
|
|
165
|
+
let firstSampleIdx = -1;
|
|
166
|
+
// Find header line
|
|
167
|
+
for (const line of lines) {
|
|
168
|
+
if (line.startsWith('#CHROM')) {
|
|
169
|
+
const headerFields = line.trim().split('\t');
|
|
170
|
+
if (headerFields.length < 9) {
|
|
171
|
+
throw new Error('No samples in VCF file');
|
|
172
|
+
}
|
|
173
|
+
sampleNames = headerFields.slice(9);
|
|
174
|
+
firstSampleIdx = 9;
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (sampleNames.length === 0) {
|
|
179
|
+
throw new Error('No header line found in VCF file');
|
|
180
|
+
}
|
|
181
|
+
if (sampleIndex >= sampleNames.length) {
|
|
182
|
+
throw new Error(`Sample index ${sampleIndex} out of range. Only ${sampleNames.length} samples in VCF.`);
|
|
183
|
+
}
|
|
184
|
+
const absoluteSampleIdx = firstSampleIdx + sampleIndex;
|
|
185
|
+
const candidateSNPs = [];
|
|
186
|
+
// Parse variant lines
|
|
187
|
+
for (const line of lines) {
|
|
188
|
+
if (line.startsWith('#')) {
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
const fields = line.trim().split('\t');
|
|
192
|
+
if (fields.length <= absoluteSampleIdx) {
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
// Filter: only PASS variants
|
|
196
|
+
const filterField = fields[6];
|
|
197
|
+
if (filterField !== 'PASS') {
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
// Filter: only SNPs (single nucleotide)
|
|
201
|
+
const ref = fields[3];
|
|
202
|
+
const alt = fields[4].split(',')[0];
|
|
203
|
+
if (ref.length !== 1 || alt.length !== 1 || ref === '.' || alt === '.') {
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
// Get genotype
|
|
207
|
+
const formatField = fields[8].split(':');
|
|
208
|
+
if (!formatField.includes('GT')) {
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
const sampleData = fields[absoluteSampleIdx].split(':');
|
|
212
|
+
const gtIdx = formatField.indexOf('GT');
|
|
213
|
+
if (gtIdx >= sampleData.length) {
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
const gt = sampleData[gtIdx];
|
|
217
|
+
// Skip reference homozygous and missing genotypes
|
|
218
|
+
if (['0/0', '0|0', './.', '.|.'].includes(gt)) {
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
// Filter by depth if available
|
|
222
|
+
if (formatField.includes('DP')) {
|
|
223
|
+
const dpIdx = formatField.indexOf('DP');
|
|
224
|
+
if (dpIdx < sampleData.length && sampleData[dpIdx] !== '.') {
|
|
225
|
+
try {
|
|
226
|
+
const depth = parseInt(sampleData[dpIdx]);
|
|
227
|
+
if (depth < 10) {
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
catch (e) {
|
|
232
|
+
// Skip if can't parse depth
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
const chrom = fields[0];
|
|
237
|
+
const pos = parseInt(fields[1]);
|
|
238
|
+
const variantId = fields[2] !== '.' ? fields[2] : `${chrom}:${pos}_${ref}>${alt}`;
|
|
239
|
+
candidateSNPs.push({ chrom, pos, variantId, gt, ref, alt });
|
|
240
|
+
}
|
|
241
|
+
// Select distributed SNPs
|
|
242
|
+
const selectedSNPs = this.selectDistributedSNPs(candidateSNPs, numSnps);
|
|
243
|
+
return this.generateFingerprintFromSNPs(selectedSNPs);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Select evenly distributed SNPs across genome
|
|
247
|
+
*/
|
|
248
|
+
selectDistributedSNPs(candidateSNPs, numSnps) {
|
|
249
|
+
if (candidateSNPs.length <= numSnps) {
|
|
250
|
+
return candidateSNPs;
|
|
251
|
+
}
|
|
252
|
+
// Sort by chromosome and position
|
|
253
|
+
candidateSNPs.sort((a, b) => {
|
|
254
|
+
if (a.chrom !== b.chrom) {
|
|
255
|
+
return a.chrom.localeCompare(b.chrom);
|
|
256
|
+
}
|
|
257
|
+
return a.pos - b.pos;
|
|
258
|
+
});
|
|
259
|
+
// Take evenly spaced SNPs
|
|
260
|
+
const step = Math.max(1, Math.floor(candidateSNPs.length / numSnps));
|
|
261
|
+
const selected = [];
|
|
262
|
+
for (let i = 0; i < candidateSNPs.length && selected.length < numSnps; i += step) {
|
|
263
|
+
selected.push(candidateSNPs[i]);
|
|
264
|
+
}
|
|
265
|
+
// If we don't have enough, add more randomly
|
|
266
|
+
if (selected.length < numSnps) {
|
|
267
|
+
const remaining = candidateSNPs.filter(snp => !selected.includes(snp));
|
|
268
|
+
const shuffled = remaining.sort(() => Math.random() - 0.5);
|
|
269
|
+
selected.push(...shuffled.slice(0, numSnps - selected.length));
|
|
270
|
+
}
|
|
271
|
+
return selected;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Generate fingerprint from SNP list using bloom filter
|
|
275
|
+
*/
|
|
276
|
+
generateFingerprintFromSNPs(snps) {
|
|
277
|
+
if (snps.length === 0) {
|
|
278
|
+
throw new Error('No SNPs provided for fingerprinting');
|
|
279
|
+
}
|
|
280
|
+
// Create bloom filter
|
|
281
|
+
const bloom = new bloom_filters_1.BloomFilter(10000, 4); // 10k capacity, 4 hash functions
|
|
282
|
+
// Sort SNPs for consistency
|
|
283
|
+
snps.sort((a, b) => {
|
|
284
|
+
if (a.chrom !== b.chrom) {
|
|
285
|
+
return a.chrom.localeCompare(b.chrom);
|
|
286
|
+
}
|
|
287
|
+
return a.pos - b.pos;
|
|
288
|
+
});
|
|
289
|
+
// Add each SNP to bloom filter
|
|
290
|
+
for (const snp of snps) {
|
|
291
|
+
const snpKey = `${snp.chrom}:${snp.pos}:${snp.gt}:${snp.ref}:${snp.alt}`;
|
|
292
|
+
bloom.add(snpKey);
|
|
293
|
+
}
|
|
294
|
+
// Export bloom filter to buffer
|
|
295
|
+
const exported = bloom.saveAsJSON();
|
|
296
|
+
const bloomString = JSON.stringify(exported);
|
|
297
|
+
// Hash the bloom filter to get fingerprint
|
|
298
|
+
return crypto.createHash('sha256').update(bloomString).digest('hex');
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Generate bloom filter-based fingerprint from SNP genotype data
|
|
302
|
+
*/
|
|
303
|
+
generateBloomFingerprint(snpData) {
|
|
304
|
+
if (Object.keys(snpData).length === 0) {
|
|
305
|
+
throw new Error('No SNP data provided for fingerprinting');
|
|
306
|
+
}
|
|
307
|
+
// Create bloom filter
|
|
308
|
+
const bloom = new bloom_filters_1.BloomFilter(1000, 4); // 1k capacity, 4 hash functions
|
|
309
|
+
// Add each SNP to bloom filter (sorted for consistency)
|
|
310
|
+
const sortedRsids = Object.keys(snpData).sort();
|
|
311
|
+
for (const rsid of sortedRsids) {
|
|
312
|
+
const genotype = snpData[rsid];
|
|
313
|
+
// Add both rsid:genotype and just rsid
|
|
314
|
+
bloom.add(`${rsid}:${genotype}`);
|
|
315
|
+
bloom.add(rsid);
|
|
316
|
+
}
|
|
317
|
+
// Export and hash
|
|
318
|
+
const exported = bloom.saveAsJSON();
|
|
319
|
+
const bloomString = JSON.stringify(exported);
|
|
320
|
+
return crypto.createHash('sha256').update(bloomString).digest('hex');
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Calculate file hash (SHA256)
|
|
324
|
+
*/
|
|
325
|
+
static calculateFileHash(filePath) {
|
|
326
|
+
const content = fs.readFileSync(filePath);
|
|
327
|
+
return crypto.createHash('sha256').update(content).digest('hex');
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Calculate file hash from buffer
|
|
331
|
+
*/
|
|
332
|
+
static calculateBufferHash(buffer) {
|
|
333
|
+
return crypto.createHash('sha256').update(buffer).digest('hex');
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
exports.VCFFingerprint = VCFFingerprint;
|
|
337
|
+
//# sourceMappingURL=vcf-fingerprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vcf-fingerprint.js","sourceRoot":"","sources":["../../../src/lib/genomics/vcf-fingerprint.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAAiC;AACjC,uCAAyB;AACzB,2CAA6B;AAC7B,iDAA4C;AAW5C,MAAa,cAA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AQ,CAAC,CAAC;QAC1C,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,MAAc;QACvC,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAClE,CAAC;CACF;AA3UD,wCA2UC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BioFiles Cache Manager
|
|
3
|
+
*
|
|
4
|
+
* Maintains a local registry of all user biofiles across:
|
|
5
|
+
* - Story Protocol IP Assets
|
|
6
|
+
* - Avalanche Biosamples
|
|
7
|
+
* - S3 Storage
|
|
8
|
+
* - BioCID Registry
|
|
9
|
+
* - BioIP Registry
|
|
10
|
+
* - Local Files
|
|
11
|
+
*
|
|
12
|
+
* Updated during login and on-demand with `biofs files --update`
|
|
13
|
+
*/
|
|
14
|
+
export interface BioFileLocation {
|
|
15
|
+
s3?: string;
|
|
16
|
+
biocid?: string;
|
|
17
|
+
story_ip?: string;
|
|
18
|
+
avalanche_biosample?: string;
|
|
19
|
+
local_path?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface BioFileMetadata {
|
|
22
|
+
file_type?: string;
|
|
23
|
+
size?: number;
|
|
24
|
+
created_at?: string;
|
|
25
|
+
uploaded_at?: string;
|
|
26
|
+
tokenized?: boolean;
|
|
27
|
+
shared_with?: string[];
|
|
28
|
+
license_type?: string;
|
|
29
|
+
fingerprint?: string;
|
|
30
|
+
file_hash?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface BioFile {
|
|
33
|
+
filename: string;
|
|
34
|
+
locations: BioFileLocation;
|
|
35
|
+
metadata: BioFileMetadata;
|
|
36
|
+
}
|
|
37
|
+
export interface BioFilesCache {
|
|
38
|
+
wallet_address: string;
|
|
39
|
+
last_updated: string;
|
|
40
|
+
biofiles: BioFile[];
|
|
41
|
+
}
|
|
42
|
+
export declare class BioFilesCacheManager {
|
|
43
|
+
private cacheDir;
|
|
44
|
+
private cacheFile;
|
|
45
|
+
constructor();
|
|
46
|
+
/**
|
|
47
|
+
* Load cache from disk
|
|
48
|
+
*/
|
|
49
|
+
load(): BioFilesCache | null;
|
|
50
|
+
/**
|
|
51
|
+
* Save cache to disk
|
|
52
|
+
*/
|
|
53
|
+
save(cache: BioFilesCache): void;
|
|
54
|
+
/**
|
|
55
|
+
* Update cache with new biofiles data
|
|
56
|
+
*/
|
|
57
|
+
update(walletAddress: string, biofiles: BioFile[]): void;
|
|
58
|
+
/**
|
|
59
|
+
* Get all biofiles from cache
|
|
60
|
+
*/
|
|
61
|
+
getAll(): BioFile[];
|
|
62
|
+
/**
|
|
63
|
+
* Find biofile by filename
|
|
64
|
+
*/
|
|
65
|
+
findByFilename(filename: string): BioFile | null;
|
|
66
|
+
/**
|
|
67
|
+
* Find biofile by any identifier (filename, BioCID, IP Asset ID)
|
|
68
|
+
*/
|
|
69
|
+
findByIdentifier(identifier: string): BioFile | null;
|
|
70
|
+
/**
|
|
71
|
+
* Find all biofiles in a specific location type
|
|
72
|
+
*/
|
|
73
|
+
findByLocationType(locationType: keyof BioFileLocation): BioFile[];
|
|
74
|
+
/**
|
|
75
|
+
* Get cache age in milliseconds
|
|
76
|
+
*/
|
|
77
|
+
getCacheAge(): number | null;
|
|
78
|
+
/**
|
|
79
|
+
* Check if cache needs update (older than 1 hour)
|
|
80
|
+
*/
|
|
81
|
+
needsUpdate(maxAgeMs?: number): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Merge new biofiles with existing cache
|
|
84
|
+
* Preserves local_path and other local-only metadata
|
|
85
|
+
*/
|
|
86
|
+
merge(walletAddress: string, newBiofiles: BioFile[]): void;
|
|
87
|
+
/**
|
|
88
|
+
* Add or update a single biofile in cache
|
|
89
|
+
*/
|
|
90
|
+
upsertBioFile(biofile: BioFile): void;
|
|
91
|
+
/**
|
|
92
|
+
* Clear cache
|
|
93
|
+
*/
|
|
94
|
+
clear(): void;
|
|
95
|
+
/**
|
|
96
|
+
* Get cache statistics
|
|
97
|
+
*/
|
|
98
|
+
getStats(): {
|
|
99
|
+
total: number;
|
|
100
|
+
tokenized: number;
|
|
101
|
+
with_biocid: number;
|
|
102
|
+
with_story_ip: number;
|
|
103
|
+
with_avalanche: number;
|
|
104
|
+
in_s3: number;
|
|
105
|
+
local: number;
|
|
106
|
+
last_updated: string | null;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=biofiles-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"biofiles-cache.d.ts","sourceRoot":"","sources":["../../../src/lib/storage/biofiles-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,MAAM,WAAW,eAAe;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,eAAe,CAAC;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