@helia/unixfs 5.0.1 → 5.0.2-60fbbc2

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.
Files changed (56) hide show
  1. package/dist/index.min.js +1 -1
  2. package/dist/index.min.js.map +4 -4
  3. package/dist/src/commands/cat.js +1 -1
  4. package/dist/src/commands/cat.js.map +1 -1
  5. package/dist/src/commands/chmod.js +1 -1
  6. package/dist/src/commands/chmod.js.map +1 -1
  7. package/dist/src/commands/cp.js +1 -1
  8. package/dist/src/commands/cp.js.map +1 -1
  9. package/dist/src/commands/ls.d.ts +1 -1
  10. package/dist/src/commands/ls.d.ts.map +1 -1
  11. package/dist/src/commands/ls.js +1 -1
  12. package/dist/src/commands/ls.js.map +1 -1
  13. package/dist/src/commands/mkdir.js +1 -1
  14. package/dist/src/commands/mkdir.js.map +1 -1
  15. package/dist/src/commands/rm.js +1 -1
  16. package/dist/src/commands/rm.js.map +1 -1
  17. package/dist/src/commands/stat.d.ts.map +1 -1
  18. package/dist/src/commands/stat.js +1 -1
  19. package/dist/src/commands/stat.js.map +1 -1
  20. package/dist/src/commands/touch.js +1 -1
  21. package/dist/src/commands/touch.js.map +1 -1
  22. package/dist/src/commands/utils/add-link.d.ts +3 -2
  23. package/dist/src/commands/utils/add-link.d.ts.map +1 -1
  24. package/dist/src/commands/utils/add-link.js.map +1 -1
  25. package/dist/src/commands/utils/cid-to-directory.d.ts +1 -1
  26. package/dist/src/commands/utils/cid-to-directory.d.ts.map +1 -1
  27. package/dist/src/commands/utils/cid-to-directory.js.map +1 -1
  28. package/dist/src/commands/utils/cid-to-pblink.d.ts +1 -1
  29. package/dist/src/commands/utils/cid-to-pblink.d.ts.map +1 -1
  30. package/dist/src/commands/utils/cid-to-pblink.js.map +1 -1
  31. package/dist/src/commands/utils/dir-sharded.d.ts +3 -2
  32. package/dist/src/commands/utils/dir-sharded.d.ts.map +1 -1
  33. package/dist/src/commands/utils/dir-sharded.js +1 -1
  34. package/dist/src/commands/utils/dir-sharded.js.map +1 -1
  35. package/dist/src/commands/utils/hamt-utils.d.ts +2 -2
  36. package/dist/src/commands/utils/hamt-utils.d.ts.map +1 -1
  37. package/dist/src/commands/utils/hamt-utils.js.map +1 -1
  38. package/dist/src/commands/utils/persist.d.ts.map +1 -1
  39. package/dist/src/commands/utils/remove-link.d.ts.map +1 -1
  40. package/dist/src/commands/utils/remove-link.js.map +1 -1
  41. package/package.json +3 -4
  42. package/src/commands/cat.ts +1 -1
  43. package/src/commands/chmod.ts +1 -1
  44. package/src/commands/cp.ts +1 -1
  45. package/src/commands/ls.ts +3 -2
  46. package/src/commands/mkdir.ts +1 -1
  47. package/src/commands/rm.ts +1 -1
  48. package/src/commands/stat.ts +3 -2
  49. package/src/commands/touch.ts +1 -1
  50. package/src/commands/utils/add-link.ts +3 -2
  51. package/src/commands/utils/cid-to-directory.ts +2 -1
  52. package/src/commands/utils/cid-to-pblink.ts +2 -1
  53. package/src/commands/utils/dir-sharded.ts +7 -4
  54. package/src/commands/utils/hamt-utils.ts +2 -1
  55. package/src/commands/utils/remove-link.ts +2 -1
  56. package/dist/typedoc-urls.json +0 -76
@@ -1,5 +1,5 @@
1
1
  import { logger } from '@libp2p/logger'
2
- import mergeOpts from 'merge-options'
2
+ import { mergeOptions as mergeOpts } from '@libp2p/utils/merge-options'
3
3
  import { InvalidParametersError } from '../errors.js'
4
4
  import { addLink } from './utils/add-link.js'
5
5
  import { cidToDirectory } from './utils/cid-to-directory.js'
@@ -1,9 +1,10 @@
1
- import { exporter, type UnixFSEntry } from 'ipfs-unixfs-exporter'
2
- import mergeOpts from 'merge-options'
1
+ import { mergeOptions as mergeOpts } from '@libp2p/utils/merge-options'
2
+ import { exporter } from 'ipfs-unixfs-exporter'
3
3
  import { NoContentError, NotADirectoryError } from '../errors.js'
4
4
  import { resolve } from './utils/resolve.js'
5
5
  import type { LsOptions } from '../index.js'
6
6
  import type { GetStore } from '../unixfs.js'
7
+ import type { UnixFSEntry } from 'ipfs-unixfs-exporter'
7
8
  import type { CID } from 'multiformats/cid'
8
9
 
9
10
  const mergeOptions = mergeOpts.bind({ ignoreUndefined: true })
@@ -1,8 +1,8 @@
1
1
  import * as dagPB from '@ipld/dag-pb'
2
2
  import { logger } from '@libp2p/logger'
3
+ import { mergeOptions as mergeOpts } from '@libp2p/utils/merge-options'
3
4
  import { UnixFS } from 'ipfs-unixfs'
4
5
  import { exporter } from 'ipfs-unixfs-exporter'
5
- import mergeOpts from 'merge-options'
6
6
  import { CID } from 'multiformats/cid'
7
7
  import { sha256 } from 'multiformats/hashes/sha2'
8
8
  import { InvalidParametersError, NotADirectoryError } from '../errors.js'
@@ -1,5 +1,5 @@
1
1
  import { logger } from '@libp2p/logger'
2
- import mergeOpts from 'merge-options'
2
+ import { mergeOptions as mergeOpts } from '@libp2p/utils/merge-options'
3
3
  import { InvalidParametersError } from '../errors.js'
4
4
  import { cidToDirectory } from './utils/cid-to-directory.js'
5
5
  import { SHARD_SPLIT_THRESHOLD_BYTES } from './utils/constants.js'
@@ -1,15 +1,16 @@
1
1
  import * as dagPb from '@ipld/dag-pb'
2
2
  import { logger } from '@libp2p/logger'
3
3
  import { ScalableCuckooFilter } from '@libp2p/utils/filters'
4
+ import { mergeOptions as mergeOpts } from '@libp2p/utils/merge-options'
4
5
  import { UnixFS } from 'ipfs-unixfs'
5
- import { exporter, type RawNode, type UnixFSDirectory, type UnixFSFile } from 'ipfs-unixfs-exporter'
6
- import mergeOpts from 'merge-options'
6
+ import { exporter } from 'ipfs-unixfs-exporter'
7
7
  import * as raw from 'multiformats/codecs/raw'
8
8
  import { InvalidPBNodeError, NotUnixFSError, UnknownError } from '../errors.js'
9
9
  import { resolve } from './utils/resolve.js'
10
10
  import type { ExtendedStatOptions, ExtendedDirectoryStats, ExtendedFileStats, StatOptions, DirectoryStats, FileStats, RawStats, ExtendedRawStats } from '../index.js'
11
11
  import type { GetStore, HasStore } from '../unixfs.js'
12
12
  import type { Filter } from '@libp2p/utils/filters'
13
+ import type { RawNode, UnixFSDirectory, UnixFSFile } from 'ipfs-unixfs-exporter'
13
14
  import type { CID } from 'multiformats/cid'
14
15
 
15
16
  // https://github.com/ipfs/specs/blob/main/UNIXFS.md#metadata
@@ -1,11 +1,11 @@
1
1
  import * as dagPB from '@ipld/dag-pb'
2
2
  import { logger } from '@libp2p/logger'
3
+ import { mergeOptions as mergeOpts } from '@libp2p/utils/merge-options'
3
4
  import { UnixFS } from 'ipfs-unixfs'
4
5
  import { recursive } from 'ipfs-unixfs-exporter'
5
6
  import { importer } from 'ipfs-unixfs-importer'
6
7
  import last from 'it-last'
7
8
  import { pipe } from 'it-pipe'
8
- import mergeOpts from 'merge-options'
9
9
  import { CID } from 'multiformats/cid'
10
10
  import * as raw from 'multiformats/codecs/raw'
11
11
  import { sha256 } from 'multiformats/hashes/sha2'
@@ -1,7 +1,7 @@
1
1
  import * as dagPB from '@ipld/dag-pb'
2
2
  import { logger } from '@libp2p/logger'
3
3
  import { UnixFS } from 'ipfs-unixfs'
4
- import { CID, type Version } from 'multiformats/cid'
4
+ import { CID } from 'multiformats/cid'
5
5
  import { sha256 } from 'multiformats/hashes/sha2'
6
6
  // @ts-expect-error no types
7
7
  import SparseArray from 'sparse-array'
@@ -18,9 +18,10 @@ import {
18
18
  import { isOverShardThreshold } from './is-over-shard-threshold.js'
19
19
  import type { Directory } from './cid-to-directory.js'
20
20
  import type { GetStore, PutStore } from '../../unixfs.js'
21
- import type { PBNode, PBLink } from '@ipld/dag-pb/interface'
21
+ import type { PBNode, PBLink } from '@ipld/dag-pb'
22
22
  import type { AbortOptions } from '@libp2p/interface'
23
23
  import type { ImportResult } from 'ipfs-unixfs-importer'
24
+ import type { Version } from 'multiformats/cid'
24
25
 
25
26
  const log = logger('helia:unixfs:components:utils:add-link')
26
27
 
@@ -1,7 +1,8 @@
1
- import { exporter, type ExporterOptions } from 'ipfs-unixfs-exporter'
1
+ import { exporter } from 'ipfs-unixfs-exporter'
2
2
  import { NotADirectoryError } from '../../errors.js'
3
3
  import type { GetStore } from '../../unixfs.js'
4
4
  import type { PBNode } from '@ipld/dag-pb'
5
+ import type { ExporterOptions } from 'ipfs-unixfs-exporter'
5
6
  import type { CID } from 'multiformats/cid'
6
7
 
7
8
  export interface Directory {
@@ -1,8 +1,9 @@
1
1
  import * as dagPb from '@ipld/dag-pb'
2
- import { exporter, type ExporterOptions } from 'ipfs-unixfs-exporter'
2
+ import { exporter } from 'ipfs-unixfs-exporter'
3
3
  import { NotUnixFSError } from '../../errors.js'
4
4
  import type { GetStore } from '../../unixfs.js'
5
5
  import type { PBNode, PBLink } from '@ipld/dag-pb'
6
+ import type { ExporterOptions } from 'ipfs-unixfs-exporter'
6
7
  import type { CID } from 'multiformats/cid'
7
8
 
8
9
  export async function cidToPBLink (cid: CID, name: string, blockstore: GetStore, options?: ExporterOptions): Promise<Required<PBLink>> {
@@ -1,13 +1,16 @@
1
- import { encode, type PBLink, prepare } from '@ipld/dag-pb'
2
- import { createHAMT, Bucket, type BucketChild } from 'hamt-sharding'
1
+ import { encode, prepare } from '@ipld/dag-pb'
2
+ import { createHAMT, Bucket } from 'hamt-sharding'
3
3
  import { UnixFS } from 'ipfs-unixfs'
4
4
  import { CID } from 'multiformats/cid'
5
5
  import {
6
6
  hamtHashCode,
7
7
  hamtHashFn
8
8
  } from './hamt-constants.js'
9
- import { persist, type PersistOptions } from './persist.js'
9
+ import { persist } from './persist.js'
10
+ import type { PersistOptions } from './persist.js'
10
11
  import type { PutStore } from '../../unixfs.js'
12
+ import type { PBLink } from '@ipld/dag-pb'
13
+ import type { BucketChild } from 'hamt-sharding'
11
14
  import type { Mtime } from 'ipfs-unixfs'
12
15
 
13
16
  interface InProgressImportResult extends ImportResult {
@@ -111,7 +114,7 @@ export class DirSharded extends Dir {
111
114
  }
112
115
 
113
116
  async * eachChildSeries (): AsyncGenerator<{ key: string, child: InProgressImportResult | Dir }> {
114
- for await (const { key, value } of this._bucket.eachLeafSeries()) {
117
+ for (const { key, value } of this._bucket.eachLeafSeries()) {
115
118
  yield {
116
119
  key,
117
120
  child: value
@@ -5,7 +5,7 @@ import last from 'it-last'
5
5
  // @ts-expect-error no types
6
6
  import SparseArray from 'sparse-array'
7
7
  import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
8
- import { type InfiniteHash, wrapHash } from './consumable-hash.js'
8
+ import { wrapHash } from './consumable-hash.js'
9
9
  import { DirSharded } from './dir-sharded.js'
10
10
  import {
11
11
  hamtHashCode,
@@ -13,6 +13,7 @@ import {
13
13
  hamtBucketBits
14
14
  } from './hamt-constants.js'
15
15
  import { persist } from './persist.js'
16
+ import type { InfiniteHash } from './consumable-hash.js'
16
17
  import type { PersistOptions } from './persist.js'
17
18
  import type { GetStore, PutStore } from '../../unixfs.js'
18
19
  import type { AbortOptions } from '@libp2p/interface'
@@ -5,12 +5,13 @@ import { exporter } from 'ipfs-unixfs-exporter'
5
5
  import { InvalidParametersError, InvalidPBNodeError } from '../../errors.js'
6
6
  import {
7
7
  recreateShardedDirectory,
8
- type UpdateHamtDirectoryOptions,
8
+
9
9
  updateShardedDirectory
10
10
  } from './hamt-utils.js'
11
11
  import { isOverShardThreshold } from './is-over-shard-threshold.js'
12
12
  import { persist } from './persist.js'
13
13
  import type { Directory } from './cid-to-directory.js'
14
+ import type { UpdateHamtDirectoryOptions } from './hamt-utils.js'
14
15
  import type { GetStore, PutStore } from '../../unixfs.js'
15
16
  import type { PBNode } from '@ipld/dag-pb'
16
17
  import type { AbortOptions } from '@libp2p/interface'
@@ -1,76 +0,0 @@
1
- {
2
- "AlreadyExistsError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.AlreadyExistsError.html",
3
- "./errors:AlreadyExistsError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.AlreadyExistsError.html",
4
- "DoesNotExistError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.DoesNotExistError.html",
5
- "./errors:DoesNotExistError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.DoesNotExistError.html",
6
- "InvalidPBNodeError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.InvalidPBNodeError.html",
7
- "./errors:InvalidPBNodeError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.InvalidPBNodeError.html",
8
- "InvalidParametersError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.InvalidParametersError.html",
9
- "./errors:InvalidParametersError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.InvalidParametersError.html",
10
- "NoContentError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.NoContentError.html",
11
- "./errors:NoContentError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.NoContentError.html",
12
- "NotADirectoryError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.NotADirectoryError.html",
13
- "./errors:NotADirectoryError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.NotADirectoryError.html",
14
- "NotAFileError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.NotAFileError.html",
15
- "./errors:NotAFileError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.NotAFileError.html",
16
- "NotUnixFSError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.NotUnixFSError.html",
17
- "./errors:NotUnixFSError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.NotUnixFSError.html",
18
- "UnixFSError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.UnixFSError.html",
19
- "./errors:UnixFSError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.UnixFSError.html",
20
- "UnknownError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.UnknownError.html",
21
- "./errors:UnknownError": "https://ipfs.github.io/helia/classes/_helia_unixfs.errors.UnknownError.html",
22
- "AddOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.AddOptions.html",
23
- ".:AddOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.AddOptions.html",
24
- "CatOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.CatOptions.html",
25
- ".:CatOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.CatOptions.html",
26
- "ChmodOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.ChmodOptions.html",
27
- ".:ChmodOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.ChmodOptions.html",
28
- "CpOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.CpOptions.html",
29
- ".:CpOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.CpOptions.html",
30
- "DirectoryStats": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.DirectoryStats.html",
31
- ".:DirectoryStats": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.DirectoryStats.html",
32
- "ExtendedDirectoryStats": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.ExtendedDirectoryStats.html",
33
- ".:ExtendedDirectoryStats": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.ExtendedDirectoryStats.html",
34
- "ExtendedFileStats": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.ExtendedFileStats.html",
35
- ".:ExtendedFileStats": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.ExtendedFileStats.html",
36
- "ExtendedRawStats": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.ExtendedRawStats.html",
37
- ".:ExtendedRawStats": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.ExtendedRawStats.html",
38
- "ExtendedStatOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.ExtendedStatOptions.html",
39
- ".:ExtendedStatOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.ExtendedStatOptions.html",
40
- "ExtendedStats": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.ExtendedStats.html",
41
- ".:ExtendedStats": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.ExtendedStats.html",
42
- "FileCandidate": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.FileCandidate.html",
43
- ".:FileCandidate": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.FileCandidate.html",
44
- "FileStats": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.FileStats.html",
45
- ".:FileStats": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.FileStats.html",
46
- "GlobSourceOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.GlobSourceOptions.html",
47
- "GlobSourceResult": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.GlobSourceResult.html",
48
- "LsOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.LsOptions.html",
49
- ".:LsOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.LsOptions.html",
50
- "MkdirOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.MkdirOptions.html",
51
- ".:MkdirOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.MkdirOptions.html",
52
- "RawStats": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.RawStats.html",
53
- ".:RawStats": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.RawStats.html",
54
- "RmOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.RmOptions.html",
55
- ".:RmOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.RmOptions.html",
56
- "StatOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.StatOptions.html",
57
- ".:StatOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.StatOptions.html",
58
- "Stats": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.Stats.html",
59
- ".:Stats": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.Stats.html",
60
- "TouchOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.TouchOptions.html",
61
- ".:TouchOptions": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.TouchOptions.html",
62
- "UnixFS": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.UnixFS.html",
63
- ".:UnixFS": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.UnixFS.html",
64
- "UnixFSComponents": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.UnixFSComponents.html",
65
- ".:UnixFSComponents": "https://ipfs.github.io/helia/interfaces/_helia_unixfs.index.UnixFSComponents.html",
66
- "AddEvents": "https://ipfs.github.io/helia/types/_helia_unixfs.index.AddEvents.html",
67
- ".:AddEvents": "https://ipfs.github.io/helia/types/_helia_unixfs.index.AddEvents.html",
68
- "AddFileOptions": "https://ipfs.github.io/helia/types/_helia_unixfs.index.AddFileOptions.html",
69
- ".:AddFileOptions": "https://ipfs.github.io/helia/types/_helia_unixfs.index.AddFileOptions.html",
70
- "GetEvents": "https://ipfs.github.io/helia/types/_helia_unixfs.index.GetEvents.html",
71
- ".:GetEvents": "https://ipfs.github.io/helia/types/_helia_unixfs.index.GetEvents.html",
72
- "globSource": "https://ipfs.github.io/helia/functions/_helia_unixfs.index.globSource.html",
73
- "unixfs": "https://ipfs.github.io/helia/functions/_helia_unixfs.index.unixfs-1.html",
74
- ".:unixfs": "https://ipfs.github.io/helia/functions/_helia_unixfs.index.unixfs-1.html",
75
- "urlSource": "https://ipfs.github.io/helia/functions/_helia_unixfs.index.urlSource.html"
76
- }