@helia/unixfs 7.0.4 → 7.1.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/dist/index.min.js +4 -4
- package/dist/index.min.js.map +4 -4
- package/dist/src/commands/add.d.ts +7 -7
- package/dist/src/commands/add.d.ts.map +1 -1
- package/dist/src/commands/add.js +12 -4
- package/dist/src/commands/add.js.map +1 -1
- package/dist/src/commands/cat.d.ts +3 -3
- package/dist/src/commands/cat.d.ts.map +1 -1
- package/dist/src/commands/cat.js +2 -2
- package/dist/src/commands/cat.js.map +1 -1
- package/dist/src/commands/chmod.d.ts +3 -3
- package/dist/src/commands/chmod.d.ts.map +1 -1
- package/dist/src/commands/chmod.js +3 -3
- package/dist/src/commands/chmod.js.map +1 -1
- package/dist/src/commands/cp.d.ts +3 -3
- package/dist/src/commands/cp.d.ts.map +1 -1
- package/dist/src/commands/cp.js +4 -4
- package/dist/src/commands/cp.js.map +1 -1
- package/dist/src/commands/ls.d.ts +3 -3
- package/dist/src/commands/ls.d.ts.map +1 -1
- package/dist/src/commands/ls.js +1 -1
- package/dist/src/commands/ls.js.map +1 -1
- package/dist/src/commands/mkdir.d.ts +3 -3
- package/dist/src/commands/mkdir.d.ts.map +1 -1
- package/dist/src/commands/mkdir.js +4 -4
- package/dist/src/commands/mkdir.js.map +1 -1
- package/dist/src/commands/rm.d.ts +3 -3
- package/dist/src/commands/rm.d.ts.map +1 -1
- package/dist/src/commands/rm.js +3 -3
- package/dist/src/commands/rm.js.map +1 -1
- package/dist/src/commands/stat.d.ts +2 -2
- package/dist/src/commands/stat.js +2 -2
- package/dist/src/commands/touch.d.ts +3 -3
- package/dist/src/commands/touch.d.ts.map +1 -1
- package/dist/src/commands/touch.js +3 -3
- package/dist/src/commands/touch.js.map +1 -1
- package/dist/src/commands/utils/add-link.d.ts +4 -6
- package/dist/src/commands/utils/add-link.d.ts.map +1 -1
- package/dist/src/commands/utils/add-link.js +23 -17
- package/dist/src/commands/utils/add-link.js.map +1 -1
- package/dist/src/commands/utils/cid-to-directory.d.ts +1 -1
- package/dist/src/commands/utils/cid-to-directory.js +1 -1
- package/dist/src/commands/utils/cid-to-pblink.d.ts +1 -1
- package/dist/src/commands/utils/cid-to-pblink.js +1 -1
- package/dist/src/commands/utils/hamt-utils.d.ts +9 -8
- package/dist/src/commands/utils/hamt-utils.d.ts.map +1 -1
- package/dist/src/commands/utils/hamt-utils.js +18 -16
- package/dist/src/commands/utils/hamt-utils.js.map +1 -1
- package/dist/src/commands/utils/is-over-shard-threshold.d.ts +6 -2
- package/dist/src/commands/utils/is-over-shard-threshold.d.ts.map +1 -1
- package/dist/src/commands/utils/is-over-shard-threshold.js +58 -13
- package/dist/src/commands/utils/is-over-shard-threshold.js.map +1 -1
- package/dist/src/commands/utils/persist.d.ts +3 -3
- package/dist/src/commands/utils/persist.d.ts.map +1 -1
- package/dist/src/commands/utils/remove-link.d.ts +5 -6
- package/dist/src/commands/utils/remove-link.d.ts.map +1 -1
- package/dist/src/commands/utils/remove-link.js +10 -9
- package/dist/src/commands/utils/remove-link.js.map +1 -1
- package/dist/src/commands/utils/resolve.d.ts +1 -1
- package/dist/src/commands/utils/resolve.js +4 -4
- package/dist/src/index.d.ts +24 -54
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/unixfs.d.ts +1 -1
- package/dist/src/unixfs.js +9 -9
- package/dist/src/utils/glob-source.js +2 -2
- package/dist/src/utils/url-source.d.ts +1 -1
- package/dist/src/utils/url-source.js +1 -1
- package/package.json +4 -5
- package/src/commands/add.ts +19 -11
- package/src/commands/cat.ts +5 -5
- package/src/commands/chmod.ts +6 -6
- package/src/commands/cp.ts +7 -7
- package/src/commands/ls.ts +4 -4
- package/src/commands/mkdir.ts +7 -7
- package/src/commands/rm.ts +6 -6
- package/src/commands/stat.ts +4 -4
- package/src/commands/touch.ts +6 -6
- package/src/commands/utils/add-link.ts +30 -24
- package/src/commands/utils/cid-to-directory.ts +2 -2
- package/src/commands/utils/cid-to-pblink.ts +2 -2
- package/src/commands/utils/hamt-utils.ts +29 -23
- package/src/commands/utils/is-over-shard-threshold.ts +88 -13
- package/src/commands/utils/persist.ts +3 -3
- package/src/commands/utils/remove-link.ts +17 -17
- package/src/commands/utils/resolve.ts +5 -5
- package/src/index.ts +25 -61
- package/src/unixfs.ts +10 -10
- package/src/utils/glob-source.ts +2 -2
- package/src/utils/url-source.ts +2 -2
- package/dist/src/commands/utils/dir-sharded.d.ts +0 -74
- package/dist/src/commands/utils/dir-sharded.d.ts.map +0 -1
- package/dist/src/commands/utils/dir-sharded.js +0 -235
- package/dist/src/commands/utils/dir-sharded.js.map +0 -1
- package/src/commands/utils/dir-sharded.ts +0 -321
package/src/index.ts
CHANGED
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
* ```
|
|
83
83
|
*/
|
|
84
84
|
|
|
85
|
-
import { UnixFS as UnixFSClass } from './unixfs.
|
|
85
|
+
import { UnixFS as UnixFSClass } from './unixfs.ts'
|
|
86
86
|
import type { GetBlockProgressEvents, ProviderOptions, PutBlockProgressEvents } from '@helia/interface/blocks'
|
|
87
87
|
import type { AbortOptions } from '@libp2p/interface'
|
|
88
88
|
import type { Filter } from '@libp2p/utils'
|
|
@@ -90,7 +90,7 @@ import type { Blockstore } from 'interface-blockstore'
|
|
|
90
90
|
import type { Mtime, UnixFS as IPFSUnixFS } from 'ipfs-unixfs'
|
|
91
91
|
import type { ExporterProgressEvents, UnixFSDirectoryEntry } from 'ipfs-unixfs-exporter'
|
|
92
92
|
import type { ByteStream, DirectoryCandidate, ImportCandidateStream, ImporterOptions, ImporterProgressEvents, ImportResult, ImportContent } from 'ipfs-unixfs-importer'
|
|
93
|
-
import type { CID
|
|
93
|
+
import type { CID } from 'multiformats/cid'
|
|
94
94
|
import type { ProgressOptions } from 'progress-events'
|
|
95
95
|
|
|
96
96
|
export interface UnixFSComponents {
|
|
@@ -111,7 +111,7 @@ export interface AddOptions extends AbortOptions, Omit<ImporterOptions, 'onProgr
|
|
|
111
111
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
export type AddFileOptions = Omit<AddOptions, 'wrapWithDirectory'>
|
|
114
|
+
export type AddFileOptions = Omit<AddOptions, 'wrapWithDirectory'> & Pick<FileCandidate, 'mode' | 'mtime'>
|
|
115
115
|
|
|
116
116
|
export type GetEvents = GetBlockProgressEvents
|
|
117
117
|
| ExporterProgressEvents
|
|
@@ -150,19 +150,13 @@ export interface ChmodOptions extends AbortOptions, ProgressOptions<GetEvents |
|
|
|
150
150
|
* If the target of the operation is a directory and this is true,
|
|
151
151
|
* apply the new mode to all directory contents
|
|
152
152
|
*/
|
|
153
|
-
recursive
|
|
153
|
+
recursive?: boolean
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
156
|
* Optional path to set the mode on directory contents
|
|
157
157
|
*/
|
|
158
158
|
path?: string
|
|
159
159
|
|
|
160
|
-
/**
|
|
161
|
-
* DAGs with a root block larger than this value will be sharded. Blocks
|
|
162
|
-
* smaller than this value will be regular UnixFS directories.
|
|
163
|
-
*/
|
|
164
|
-
shardSplitThresholdBytes: number
|
|
165
|
-
|
|
166
160
|
/**
|
|
167
161
|
* If true, do not perform any network operations and throw if blocks are
|
|
168
162
|
* missing from the local store. (default: false)
|
|
@@ -173,17 +167,11 @@ export interface ChmodOptions extends AbortOptions, ProgressOptions<GetEvents |
|
|
|
173
167
|
/**
|
|
174
168
|
* Options to pass to the cp command
|
|
175
169
|
*/
|
|
176
|
-
export interface CpOptions extends AbortOptions, ProgressOptions<GetEvents | PutBlockProgressEvents>, ProviderOptions {
|
|
170
|
+
export interface CpOptions extends AbortOptions, ProgressOptions<GetEvents | PutBlockProgressEvents>, ProviderOptions, Pick<ImporterOptions, 'shardFanoutBits' | 'shardSplitStrategy' | 'shardSplitThresholdBytes'> {
|
|
177
171
|
/**
|
|
178
172
|
* If true, allow overwriting existing directory entries (default: false)
|
|
179
173
|
*/
|
|
180
|
-
force
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* DAGs with a root block larger than this value will be sharded. Blocks
|
|
184
|
-
* smaller than this value will be regular UnixFS directories.
|
|
185
|
-
*/
|
|
186
|
-
shardSplitThresholdBytes: number
|
|
174
|
+
force?: boolean
|
|
187
175
|
|
|
188
176
|
/**
|
|
189
177
|
* If true, do not perform any network operations and throw if blocks are
|
|
@@ -222,17 +210,11 @@ export interface LsOptions extends AbortOptions, ProgressOptions<GetEvents> {
|
|
|
222
210
|
/**
|
|
223
211
|
* Options to pass to the mkdir command
|
|
224
212
|
*/
|
|
225
|
-
export interface MkdirOptions extends AbortOptions, ProgressOptions<GetEvents | PutBlockProgressEvents>, ProviderOptions {
|
|
226
|
-
/**
|
|
227
|
-
* The CID version to create the new directory with - defaults to the same
|
|
228
|
-
* version as the containing directory
|
|
229
|
-
*/
|
|
230
|
-
cidVersion: Version
|
|
231
|
-
|
|
213
|
+
export interface MkdirOptions extends AbortOptions, ProgressOptions<GetEvents | PutBlockProgressEvents>, ProviderOptions, Pick<ImporterOptions, 'profile' | 'shardFanoutBits' | 'shardSplitStrategy' | 'shardSplitThresholdBytes' | 'cidVersion'> {
|
|
232
214
|
/**
|
|
233
215
|
* If true, allow overwriting existing directory entries (default: false)
|
|
234
216
|
*/
|
|
235
|
-
force
|
|
217
|
+
force?: boolean
|
|
236
218
|
|
|
237
219
|
/**
|
|
238
220
|
* An optional mode to set on the new directory
|
|
@@ -244,12 +226,6 @@ export interface MkdirOptions extends AbortOptions, ProgressOptions<GetEvents |
|
|
|
244
226
|
*/
|
|
245
227
|
mtime?: Mtime
|
|
246
228
|
|
|
247
|
-
/**
|
|
248
|
-
* DAGs with a root block larger than this value will be sharded. Blocks
|
|
249
|
-
* smaller than this value will be regular UnixFS directories.
|
|
250
|
-
*/
|
|
251
|
-
shardSplitThresholdBytes: number
|
|
252
|
-
|
|
253
229
|
/**
|
|
254
230
|
* If true, do not perform any network operations and throw if blocks are
|
|
255
231
|
* missing from the local store. (default: false)
|
|
@@ -260,13 +236,7 @@ export interface MkdirOptions extends AbortOptions, ProgressOptions<GetEvents |
|
|
|
260
236
|
/**
|
|
261
237
|
* Options to pass to the rm command
|
|
262
238
|
*/
|
|
263
|
-
export interface RmOptions extends AbortOptions, ProgressOptions<GetEvents | PutBlockProgressEvents>, ProviderOptions {
|
|
264
|
-
/**
|
|
265
|
-
* DAGs with a root block larger than this value will be sharded. Blocks
|
|
266
|
-
* smaller than this value will be regular UnixFS directories.
|
|
267
|
-
*/
|
|
268
|
-
shardSplitThresholdBytes: number
|
|
269
|
-
|
|
239
|
+
export interface RmOptions extends AbortOptions, ProgressOptions<GetEvents | PutBlockProgressEvents>, ProviderOptions, Pick<ImporterOptions, 'shardFanoutBits' | 'shardSplitStrategy' | 'shardSplitThresholdBytes'> {
|
|
270
240
|
/**
|
|
271
241
|
* If true, do not perform any network operations and throw if blocks are
|
|
272
242
|
* missing from the local store. (default: false)
|
|
@@ -452,13 +422,7 @@ export interface TouchOptions extends AbortOptions, ProgressOptions<GetEvents |
|
|
|
452
422
|
/**
|
|
453
423
|
* If the DAG is a directory and this is true, update the mtime on all contents
|
|
454
424
|
*/
|
|
455
|
-
recursive
|
|
456
|
-
|
|
457
|
-
/**
|
|
458
|
-
* DAGs with a root block larger than this value will be sharded. Blocks
|
|
459
|
-
* smaller than this value will be regular UnixFS directories.
|
|
460
|
-
*/
|
|
461
|
-
shardSplitThresholdBytes: number
|
|
425
|
+
recursive?: boolean
|
|
462
426
|
|
|
463
427
|
/**
|
|
464
428
|
* If true, do not perform any network operations and throw if blocks are
|
|
@@ -493,7 +457,7 @@ export interface UnixFS {
|
|
|
493
457
|
* }
|
|
494
458
|
* ```
|
|
495
459
|
*/
|
|
496
|
-
addAll(source: ImportCandidateStream, options?:
|
|
460
|
+
addAll(source: ImportCandidateStream, options?: Omit<AddOptions, 'mtime' | 'mode'>): AsyncIterable<ImportResult>
|
|
497
461
|
|
|
498
462
|
/**
|
|
499
463
|
* Add a single `Uint8Array` to your Helia node and receive a CID that will
|
|
@@ -510,7 +474,7 @@ export interface UnixFS {
|
|
|
510
474
|
* console.info(cid)
|
|
511
475
|
* ```
|
|
512
476
|
*/
|
|
513
|
-
addBytes(bytes: Uint8Array, options?:
|
|
477
|
+
addBytes(bytes: Uint8Array, options?: AddFileOptions): Promise<CID>
|
|
514
478
|
|
|
515
479
|
/**
|
|
516
480
|
* Add a stream of `Uint8Array`s to your Helia node and receive a CID that
|
|
@@ -530,7 +494,7 @@ export interface UnixFS {
|
|
|
530
494
|
* console.info(cid)
|
|
531
495
|
* ```
|
|
532
496
|
*/
|
|
533
|
-
addByteStream(bytes: ByteStream, options?:
|
|
497
|
+
addByteStream(bytes: ByteStream, options?: AddFileOptions): Promise<CID>
|
|
534
498
|
|
|
535
499
|
/**
|
|
536
500
|
* Add a file to your Helia node with metadata. The returned CID will resolve
|
|
@@ -555,7 +519,7 @@ export interface UnixFS {
|
|
|
555
519
|
* console.info(cid)
|
|
556
520
|
* ```
|
|
557
521
|
*/
|
|
558
|
-
addFile(file: FileCandidate, options?:
|
|
522
|
+
addFile(file: FileCandidate, options?: AddFileOptions): Promise<CID>
|
|
559
523
|
|
|
560
524
|
/**
|
|
561
525
|
* Add a directory to your Helia node.
|
|
@@ -590,7 +554,7 @@ export interface UnixFS {
|
|
|
590
554
|
* console.info(stat.cid) // empty directory CID
|
|
591
555
|
* ```
|
|
592
556
|
*/
|
|
593
|
-
addDirectory(dir?: Partial<DirectoryCandidate>, options?:
|
|
557
|
+
addDirectory(dir?: Partial<DirectoryCandidate>, options?: AddFileOptions): Promise<CID>
|
|
594
558
|
|
|
595
559
|
/**
|
|
596
560
|
* Retrieve the contents of a file from your Helia node.
|
|
@@ -603,7 +567,7 @@ export interface UnixFS {
|
|
|
603
567
|
* }
|
|
604
568
|
* ```
|
|
605
569
|
*/
|
|
606
|
-
cat(cid: CID, options?:
|
|
570
|
+
cat(cid: CID, options?: CatOptions): AsyncIterable<Uint8Array>
|
|
607
571
|
|
|
608
572
|
/**
|
|
609
573
|
* Change the permissions on a file or directory in a DAG
|
|
@@ -621,7 +585,7 @@ export interface UnixFS {
|
|
|
621
585
|
* console.info(afterCid, afterStats)
|
|
622
586
|
* ```
|
|
623
587
|
*/
|
|
624
|
-
chmod(cid: CID, mode: number, options?:
|
|
588
|
+
chmod(cid: CID, mode: number, options?: ChmodOptions): Promise<CID>
|
|
625
589
|
|
|
626
590
|
/**
|
|
627
591
|
* Add a file or directory to a target directory.
|
|
@@ -637,7 +601,7 @@ export interface UnixFS {
|
|
|
637
601
|
* console.info(updatedCid)
|
|
638
602
|
* ```
|
|
639
603
|
*/
|
|
640
|
-
cp(source: CID, target: CID, name: string, options?:
|
|
604
|
+
cp(source: CID, target: CID, name: string, options?: CpOptions): Promise<CID>
|
|
641
605
|
|
|
642
606
|
/**
|
|
643
607
|
* List directory contents.
|
|
@@ -650,7 +614,7 @@ export interface UnixFS {
|
|
|
650
614
|
* }
|
|
651
615
|
* ```
|
|
652
616
|
*/
|
|
653
|
-
ls(cid: CID, options?:
|
|
617
|
+
ls(cid: CID, options?: LsOptions): AsyncIterable<UnixFSDirectoryEntry>
|
|
654
618
|
|
|
655
619
|
/**
|
|
656
620
|
* Make a new directory under an existing directory.
|
|
@@ -665,7 +629,7 @@ export interface UnixFS {
|
|
|
665
629
|
* console.info(updatedCid)
|
|
666
630
|
* ```
|
|
667
631
|
*/
|
|
668
|
-
mkdir(cid: CID, dirname: string, options?:
|
|
632
|
+
mkdir(cid: CID, dirname: string, options?: MkdirOptions): Promise<CID>
|
|
669
633
|
|
|
670
634
|
/**
|
|
671
635
|
* Remove a file or directory from an existing directory.
|
|
@@ -681,7 +645,7 @@ export interface UnixFS {
|
|
|
681
645
|
* console.info(finalCid)
|
|
682
646
|
* ```
|
|
683
647
|
*/
|
|
684
|
-
rm(cid: CID, path: string, options?:
|
|
648
|
+
rm(cid: CID, path: string, options?: RmOptions): Promise<CID>
|
|
685
649
|
|
|
686
650
|
/**
|
|
687
651
|
* Return statistics about a UnixFS DAG.
|
|
@@ -715,7 +679,7 @@ export interface UnixFS {
|
|
|
715
679
|
* console.info(afterCid, afterStats)
|
|
716
680
|
* ```
|
|
717
681
|
*/
|
|
718
|
-
touch(cid: CID, options?:
|
|
682
|
+
touch(cid: CID, options?: TouchOptions): Promise<CID>
|
|
719
683
|
}
|
|
720
684
|
|
|
721
685
|
/**
|
|
@@ -725,6 +689,6 @@ export function unixfs (helia: { blockstore: Pick<Blockstore, 'get' | 'put' | 'h
|
|
|
725
689
|
return new UnixFSClass(helia)
|
|
726
690
|
}
|
|
727
691
|
|
|
728
|
-
export { globSource } from './utils/glob-source.
|
|
729
|
-
export type { GlobSourceResult, GlobSourceOptions } from './utils/glob-source.
|
|
730
|
-
export { urlSource } from './utils/url-source.
|
|
692
|
+
export { globSource } from './utils/glob-source.ts'
|
|
693
|
+
export type { GlobSourceResult, GlobSourceOptions } from './utils/glob-source.ts'
|
|
694
|
+
export { urlSource } from './utils/url-source.ts'
|
package/src/unixfs.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { addAll, addBytes, addByteStream, addDirectory, addFile } from './commands/add.
|
|
2
|
-
import { cat } from './commands/cat.
|
|
3
|
-
import { chmod } from './commands/chmod.
|
|
4
|
-
import { cp } from './commands/cp.
|
|
5
|
-
import { ls } from './commands/ls.
|
|
6
|
-
import { mkdir } from './commands/mkdir.
|
|
7
|
-
import { rm } from './commands/rm.
|
|
8
|
-
import { stat } from './commands/stat.
|
|
9
|
-
import { touch } from './commands/touch.
|
|
10
|
-
import type { AddOptions, CatOptions, ChmodOptions, CpOptions, ExtendedStatOptions, ExtendedDirectoryStats, ExtendedFileStats, FileCandidate, LsOptions, MkdirOptions, RmOptions, StatOptions, TouchOptions, UnixFSComponents, DirectoryStats, FileStats, UnixFS as UnixFSInterface, RawStats, ExtendedRawStats } from './index.
|
|
1
|
+
import { addAll, addBytes, addByteStream, addDirectory, addFile } from './commands/add.ts'
|
|
2
|
+
import { cat } from './commands/cat.ts'
|
|
3
|
+
import { chmod } from './commands/chmod.ts'
|
|
4
|
+
import { cp } from './commands/cp.ts'
|
|
5
|
+
import { ls } from './commands/ls.ts'
|
|
6
|
+
import { mkdir } from './commands/mkdir.ts'
|
|
7
|
+
import { rm } from './commands/rm.ts'
|
|
8
|
+
import { stat } from './commands/stat.ts'
|
|
9
|
+
import { touch } from './commands/touch.ts'
|
|
10
|
+
import type { AddOptions, CatOptions, ChmodOptions, CpOptions, ExtendedStatOptions, ExtendedDirectoryStats, ExtendedFileStats, FileCandidate, LsOptions, MkdirOptions, RmOptions, StatOptions, TouchOptions, UnixFSComponents, DirectoryStats, FileStats, UnixFS as UnixFSInterface, RawStats, ExtendedRawStats } from './index.ts'
|
|
11
11
|
import type { Blockstore } from 'interface-blockstore'
|
|
12
12
|
import type { UnixFSDirectoryEntry } from 'ipfs-unixfs-exporter'
|
|
13
13
|
import type { ByteStream, DirectoryCandidate, ImportCandidateStream, ImportResult } from 'ipfs-unixfs-importer'
|
package/src/utils/glob-source.ts
CHANGED
|
@@ -3,8 +3,8 @@ import fsp from 'node:fs/promises'
|
|
|
3
3
|
import os from 'node:os'
|
|
4
4
|
import Path from 'path'
|
|
5
5
|
import glob from 'it-glob'
|
|
6
|
-
import { InvalidParametersError } from '../errors.
|
|
7
|
-
import { toMtime } from './to-mtime.
|
|
6
|
+
import { InvalidParametersError } from '../errors.ts'
|
|
7
|
+
import { toMtime } from './to-mtime.ts'
|
|
8
8
|
import type { MtimeLike } from 'ipfs-unixfs'
|
|
9
9
|
import type { ImportCandidate } from 'ipfs-unixfs-importer'
|
|
10
10
|
import type { Options } from 'it-glob'
|
package/src/utils/url-source.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UnknownError } from '../errors.
|
|
2
|
-
import type { FileCandidate } from '../index.
|
|
1
|
+
import { UnknownError } from '../errors.ts'
|
|
2
|
+
import type { FileCandidate } from '../index.ts'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Import a file directly from a URL. The path of the file will be the path
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { Bucket } from 'hamt-sharding';
|
|
2
|
-
import { UnixFS } from 'ipfs-unixfs';
|
|
3
|
-
import { CID } from 'multiformats/cid';
|
|
4
|
-
import type { PersistOptions } from './persist.js';
|
|
5
|
-
import type { PutStore } from '../../unixfs.js';
|
|
6
|
-
import type { BucketChild } from 'hamt-sharding';
|
|
7
|
-
import type { Mtime } from 'ipfs-unixfs';
|
|
8
|
-
interface InProgressImportResult extends ImportResult {
|
|
9
|
-
single?: boolean;
|
|
10
|
-
originalPath?: string;
|
|
11
|
-
}
|
|
12
|
-
interface ImportResult {
|
|
13
|
-
cid: CID;
|
|
14
|
-
size: bigint;
|
|
15
|
-
path?: string;
|
|
16
|
-
unixfs?: UnixFS;
|
|
17
|
-
}
|
|
18
|
-
interface DirProps {
|
|
19
|
-
root: boolean;
|
|
20
|
-
dir: boolean;
|
|
21
|
-
path: string;
|
|
22
|
-
dirty: boolean;
|
|
23
|
-
flat: boolean;
|
|
24
|
-
parent?: Dir;
|
|
25
|
-
parentKey?: string;
|
|
26
|
-
unixfs?: UnixFS;
|
|
27
|
-
mode?: number;
|
|
28
|
-
mtime?: Mtime;
|
|
29
|
-
}
|
|
30
|
-
declare abstract class Dir {
|
|
31
|
-
options: PersistOptions;
|
|
32
|
-
root: boolean;
|
|
33
|
-
dir: boolean;
|
|
34
|
-
path: string;
|
|
35
|
-
dirty: boolean;
|
|
36
|
-
flat: boolean;
|
|
37
|
-
parent?: Dir;
|
|
38
|
-
parentKey?: string;
|
|
39
|
-
unixfs?: UnixFS;
|
|
40
|
-
mode?: number;
|
|
41
|
-
mtime?: Mtime;
|
|
42
|
-
cid?: CID;
|
|
43
|
-
size?: number;
|
|
44
|
-
nodeSize?: number;
|
|
45
|
-
constructor(props: DirProps, options: PersistOptions);
|
|
46
|
-
abstract put(name: string, value: InProgressImportResult | Dir): Promise<void>;
|
|
47
|
-
abstract get(name: string): Promise<InProgressImportResult | Dir | undefined>;
|
|
48
|
-
abstract eachChildSeries(): AsyncIterable<{
|
|
49
|
-
key: string;
|
|
50
|
-
child: InProgressImportResult | Dir;
|
|
51
|
-
}>;
|
|
52
|
-
abstract flush(blockstore: PutStore): AsyncGenerator<ImportResult>;
|
|
53
|
-
abstract estimateNodeSize(): number;
|
|
54
|
-
abstract childCount(): number;
|
|
55
|
-
}
|
|
56
|
-
export declare class DirSharded extends Dir {
|
|
57
|
-
_bucket: Bucket<InProgressImportResult | Dir>;
|
|
58
|
-
constructor(props: DirProps, options: PersistOptions);
|
|
59
|
-
put(name: string, value: InProgressImportResult | Dir): Promise<void>;
|
|
60
|
-
get(name: string): Promise<InProgressImportResult | Dir | undefined>;
|
|
61
|
-
childCount(): number;
|
|
62
|
-
directChildrenCount(): number;
|
|
63
|
-
onlyChild(): Bucket<InProgressImportResult | Dir> | BucketChild<InProgressImportResult | Dir>;
|
|
64
|
-
eachChildSeries(): AsyncGenerator<{
|
|
65
|
-
key: string;
|
|
66
|
-
child: InProgressImportResult | Dir;
|
|
67
|
-
}>;
|
|
68
|
-
estimateNodeSize(): number;
|
|
69
|
-
flush(blockstore: PutStore): AsyncGenerator<ImportResult>;
|
|
70
|
-
}
|
|
71
|
-
export declare const CID_V0: CID<unknown, number, number, import("multiformats/cid").Version>;
|
|
72
|
-
export declare const CID_V1: CID<unknown, number, number, import("multiformats/cid").Version>;
|
|
73
|
-
export {};
|
|
74
|
-
//# sourceMappingURL=dir-sharded.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dir-sharded.d.ts","sourceRoot":"","sources":["../../../../src/commands/utils/dir-sharded.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,MAAM,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,C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AAE,sBAAsB,GAAG,GAAG,CAAA;KAAE,CAAC;IAShG,gBAAgB,IAAK,MAAM;IAUnB,KAAK,CAAE,UAAU,EAAE,QAAQ,GAAG,cAAc,CAAC,YAAY,CAAC;CAQnE;AAiLD,eAAO,MAAM,MAAM,kEAA8D,CAAA;AACjF,eAAO,MAAM,MAAM,kEAAiE,CAAA"}
|
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
import { encode, prepare } from '@ipld/dag-pb';
|
|
2
|
-
import { createHAMT, Bucket } from 'hamt-sharding';
|
|
3
|
-
import { UnixFS } from 'ipfs-unixfs';
|
|
4
|
-
import { CID } from 'multiformats/cid';
|
|
5
|
-
import { hamtHashCode, hamtHashFn } from './hamt-constants.js';
|
|
6
|
-
import { persist } from './persist.js';
|
|
7
|
-
class Dir {
|
|
8
|
-
options;
|
|
9
|
-
root;
|
|
10
|
-
dir;
|
|
11
|
-
path;
|
|
12
|
-
dirty;
|
|
13
|
-
flat;
|
|
14
|
-
parent;
|
|
15
|
-
parentKey;
|
|
16
|
-
unixfs;
|
|
17
|
-
mode;
|
|
18
|
-
mtime;
|
|
19
|
-
cid;
|
|
20
|
-
size;
|
|
21
|
-
nodeSize;
|
|
22
|
-
constructor(props, options) {
|
|
23
|
-
this.options = options ?? {};
|
|
24
|
-
this.root = props.root;
|
|
25
|
-
this.dir = props.dir;
|
|
26
|
-
this.path = props.path;
|
|
27
|
-
this.dirty = props.dirty;
|
|
28
|
-
this.flat = props.flat;
|
|
29
|
-
this.parent = props.parent;
|
|
30
|
-
this.parentKey = props.parentKey;
|
|
31
|
-
this.unixfs = props.unixfs;
|
|
32
|
-
this.mode = props.mode;
|
|
33
|
-
this.mtime = props.mtime;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export class DirSharded extends Dir {
|
|
37
|
-
_bucket;
|
|
38
|
-
constructor(props, options) {
|
|
39
|
-
super(props, options);
|
|
40
|
-
this._bucket = createHAMT({
|
|
41
|
-
hashFn: hamtHashFn,
|
|
42
|
-
bits: 8
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
async put(name, value) {
|
|
46
|
-
this.cid = undefined;
|
|
47
|
-
this.size = undefined;
|
|
48
|
-
this.nodeSize = undefined;
|
|
49
|
-
await this._bucket.put(name, value);
|
|
50
|
-
}
|
|
51
|
-
async get(name) {
|
|
52
|
-
return this._bucket.get(name);
|
|
53
|
-
}
|
|
54
|
-
childCount() {
|
|
55
|
-
return this._bucket.leafCount();
|
|
56
|
-
}
|
|
57
|
-
directChildrenCount() {
|
|
58
|
-
return this._bucket.childrenCount();
|
|
59
|
-
}
|
|
60
|
-
onlyChild() {
|
|
61
|
-
return this._bucket.onlyChild();
|
|
62
|
-
}
|
|
63
|
-
async *eachChildSeries() {
|
|
64
|
-
for (const { key, value } of this._bucket.eachLeafSeries()) {
|
|
65
|
-
yield {
|
|
66
|
-
key,
|
|
67
|
-
child: value
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
estimateNodeSize() {
|
|
72
|
-
if (this.nodeSize !== undefined) {
|
|
73
|
-
return this.nodeSize;
|
|
74
|
-
}
|
|
75
|
-
this.nodeSize = calculateSize(this._bucket, this, this.options);
|
|
76
|
-
return this.nodeSize;
|
|
77
|
-
}
|
|
78
|
-
async *flush(blockstore) {
|
|
79
|
-
for await (const entry of flush(this._bucket, blockstore, this, this.options)) {
|
|
80
|
-
yield {
|
|
81
|
-
...entry,
|
|
82
|
-
path: this.path
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
async function* flush(bucket, blockstore, shardRoot, options) {
|
|
88
|
-
const children = bucket._children;
|
|
89
|
-
const links = [];
|
|
90
|
-
let childrenSize = 0n;
|
|
91
|
-
for (let i = 0; i < children.length; i++) {
|
|
92
|
-
const child = children.get(i);
|
|
93
|
-
if (child == null) {
|
|
94
|
-
continue;
|
|
95
|
-
}
|
|
96
|
-
const labelPrefix = i.toString(16).toUpperCase().padStart(2, '0');
|
|
97
|
-
if (child instanceof Bucket) {
|
|
98
|
-
let shard;
|
|
99
|
-
for await (const subShard of flush(child, blockstore, null, options)) {
|
|
100
|
-
shard = subShard;
|
|
101
|
-
}
|
|
102
|
-
if (shard == null) {
|
|
103
|
-
throw new Error('Could not flush sharded directory, no sub-shard found');
|
|
104
|
-
}
|
|
105
|
-
links.push({
|
|
106
|
-
Name: labelPrefix,
|
|
107
|
-
Tsize: Number(shard.size),
|
|
108
|
-
Hash: shard.cid
|
|
109
|
-
});
|
|
110
|
-
childrenSize += shard.size;
|
|
111
|
-
}
|
|
112
|
-
else if (isDir(child.value)) {
|
|
113
|
-
const dir = child.value;
|
|
114
|
-
let flushedDir;
|
|
115
|
-
for await (const entry of dir.flush(blockstore)) {
|
|
116
|
-
flushedDir = entry;
|
|
117
|
-
yield flushedDir;
|
|
118
|
-
}
|
|
119
|
-
if (flushedDir == null) {
|
|
120
|
-
throw new Error('Did not flush dir');
|
|
121
|
-
}
|
|
122
|
-
const label = labelPrefix + child.key;
|
|
123
|
-
links.push({
|
|
124
|
-
Name: label,
|
|
125
|
-
Tsize: Number(flushedDir.size),
|
|
126
|
-
Hash: flushedDir.cid
|
|
127
|
-
});
|
|
128
|
-
childrenSize += flushedDir.size;
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
const value = child.value;
|
|
132
|
-
if (value.cid == null) {
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
|
-
const label = labelPrefix + child.key;
|
|
136
|
-
const size = value.size;
|
|
137
|
-
links.push({
|
|
138
|
-
Name: label,
|
|
139
|
-
Tsize: Number(size),
|
|
140
|
-
Hash: value.cid
|
|
141
|
-
});
|
|
142
|
-
childrenSize += BigInt(size ?? 0);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
// go-ipfs uses little endian, that's why we have to
|
|
146
|
-
// reverse the bit field before storing it
|
|
147
|
-
const data = Uint8Array.from(children.bitField().reverse());
|
|
148
|
-
const dir = new UnixFS({
|
|
149
|
-
type: 'hamt-sharded-directory',
|
|
150
|
-
data,
|
|
151
|
-
fanout: BigInt(bucket.tableSize()),
|
|
152
|
-
hashType: hamtHashCode,
|
|
153
|
-
mtime: shardRoot?.mtime,
|
|
154
|
-
mode: shardRoot?.mode
|
|
155
|
-
});
|
|
156
|
-
const node = {
|
|
157
|
-
Data: dir.marshal(),
|
|
158
|
-
Links: links
|
|
159
|
-
};
|
|
160
|
-
const buffer = encode(prepare(node));
|
|
161
|
-
const cid = await persist(buffer, blockstore, options);
|
|
162
|
-
const size = BigInt(buffer.byteLength) + childrenSize;
|
|
163
|
-
yield {
|
|
164
|
-
cid,
|
|
165
|
-
unixfs: dir,
|
|
166
|
-
size
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
function isDir(obj) {
|
|
170
|
-
return typeof obj.flush === 'function';
|
|
171
|
-
}
|
|
172
|
-
function calculateSize(bucket, shardRoot, options) {
|
|
173
|
-
const children = bucket._children;
|
|
174
|
-
const links = [];
|
|
175
|
-
for (let i = 0; i < children.length; i++) {
|
|
176
|
-
const child = children.get(i);
|
|
177
|
-
if (child == null) {
|
|
178
|
-
continue;
|
|
179
|
-
}
|
|
180
|
-
const labelPrefix = i.toString(16).toUpperCase().padStart(2, '0');
|
|
181
|
-
if (child instanceof Bucket) {
|
|
182
|
-
const size = calculateSize(child, null, options);
|
|
183
|
-
links.push({
|
|
184
|
-
Name: labelPrefix,
|
|
185
|
-
Tsize: Number(size),
|
|
186
|
-
Hash: options.cidVersion === 0 ? CID_V0 : CID_V1
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
else if (typeof child.value.flush === 'function') {
|
|
190
|
-
const dir = child.value;
|
|
191
|
-
const size = dir.nodeSize();
|
|
192
|
-
links.push({
|
|
193
|
-
Name: labelPrefix + child.key,
|
|
194
|
-
Tsize: Number(size),
|
|
195
|
-
Hash: options.cidVersion === 0 ? CID_V0 : CID_V1
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
else {
|
|
199
|
-
const value = child.value;
|
|
200
|
-
if (value.cid == null) {
|
|
201
|
-
continue;
|
|
202
|
-
}
|
|
203
|
-
const label = labelPrefix + child.key;
|
|
204
|
-
const size = value.size;
|
|
205
|
-
links.push({
|
|
206
|
-
Name: label,
|
|
207
|
-
Tsize: Number(size),
|
|
208
|
-
Hash: value.cid
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
// go-ipfs uses little endian, that's why we have to
|
|
213
|
-
// reverse the bit field before storing it
|
|
214
|
-
const data = Uint8Array.from(children.bitField().reverse());
|
|
215
|
-
const dir = new UnixFS({
|
|
216
|
-
type: 'hamt-sharded-directory',
|
|
217
|
-
data,
|
|
218
|
-
fanout: BigInt(bucket.tableSize()),
|
|
219
|
-
hashType: hamtHashCode,
|
|
220
|
-
mtime: shardRoot?.mtime,
|
|
221
|
-
mode: shardRoot?.mode
|
|
222
|
-
});
|
|
223
|
-
const buffer = encode(prepare({
|
|
224
|
-
Data: dir.marshal(),
|
|
225
|
-
Links: links
|
|
226
|
-
}));
|
|
227
|
-
return buffer.length;
|
|
228
|
-
}
|
|
229
|
-
// we use these to calculate the node size to use as a check for whether a directory
|
|
230
|
-
// should be sharded or not. Since CIDs have a constant length and We're only
|
|
231
|
-
// interested in the data length and not the actual content identifier we can use
|
|
232
|
-
// any old CID instead of having to hash the data which is expensive.
|
|
233
|
-
export const CID_V0 = CID.parse('QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn');
|
|
234
|
-
export const CID_V1 = CID.parse('zdj7WbTaiJT1fgatdet9Ei9iDB5hdCxkbVyhyh8YTUnXMiwYi');
|
|
235
|
-
//# sourceMappingURL=dir-sharded.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dir-sharded.js","sourceRoot":"","sources":["../../../../src/commands/utils/dir-sharded.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,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