@helia/unixfs 1.2.2 → 1.2.3

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 (97) hide show
  1. package/dist/index.min.js +1 -1
  2. package/dist/src/commands/add.d.ts +2 -2
  3. package/dist/src/commands/add.d.ts.map +1 -1
  4. package/dist/src/commands/add.js +1 -1
  5. package/dist/src/commands/add.js.map +1 -1
  6. package/dist/src/commands/cat.d.ts +1 -1
  7. package/dist/src/commands/cat.d.ts.map +1 -1
  8. package/dist/src/commands/cat.js +1 -1
  9. package/dist/src/commands/cat.js.map +1 -1
  10. package/dist/src/commands/chmod.d.ts.map +1 -1
  11. package/dist/src/commands/chmod.js +12 -12
  12. package/dist/src/commands/chmod.js.map +1 -1
  13. package/dist/src/commands/cp.d.ts +1 -1
  14. package/dist/src/commands/cp.d.ts.map +1 -1
  15. package/dist/src/commands/cp.js +2 -2
  16. package/dist/src/commands/cp.js.map +1 -1
  17. package/dist/src/commands/ls.d.ts +2 -2
  18. package/dist/src/commands/ls.d.ts.map +1 -1
  19. package/dist/src/commands/ls.js +1 -1
  20. package/dist/src/commands/ls.js.map +1 -1
  21. package/dist/src/commands/mkdir.d.ts.map +1 -1
  22. package/dist/src/commands/mkdir.js +5 -5
  23. package/dist/src/commands/mkdir.js.map +1 -1
  24. package/dist/src/commands/rm.d.ts +1 -1
  25. package/dist/src/commands/rm.d.ts.map +1 -1
  26. package/dist/src/commands/rm.js +2 -2
  27. package/dist/src/commands/rm.js.map +1 -1
  28. package/dist/src/commands/stat.d.ts +1 -1
  29. package/dist/src/commands/stat.d.ts.map +1 -1
  30. package/dist/src/commands/stat.js +4 -4
  31. package/dist/src/commands/stat.js.map +1 -1
  32. package/dist/src/commands/touch.d.ts.map +1 -1
  33. package/dist/src/commands/touch.js +12 -12
  34. package/dist/src/commands/touch.js.map +1 -1
  35. package/dist/src/commands/utils/add-link.d.ts +3 -3
  36. package/dist/src/commands/utils/add-link.d.ts.map +1 -1
  37. package/dist/src/commands/utils/add-link.js +8 -8
  38. package/dist/src/commands/utils/add-link.js.map +1 -1
  39. package/dist/src/commands/utils/cid-to-directory.d.ts +3 -3
  40. package/dist/src/commands/utils/cid-to-directory.d.ts.map +1 -1
  41. package/dist/src/commands/utils/cid-to-directory.js.map +1 -1
  42. package/dist/src/commands/utils/cid-to-pblink.d.ts +3 -3
  43. package/dist/src/commands/utils/cid-to-pblink.d.ts.map +1 -1
  44. package/dist/src/commands/utils/cid-to-pblink.js +1 -1
  45. package/dist/src/commands/utils/cid-to-pblink.js.map +1 -1
  46. package/dist/src/commands/utils/consumable-hash.js +9 -0
  47. package/dist/src/commands/utils/consumable-hash.js.map +1 -1
  48. package/dist/src/commands/utils/dir-sharded.d.ts +3 -3
  49. package/dist/src/commands/utils/dir-sharded.d.ts.map +1 -1
  50. package/dist/src/commands/utils/dir-sharded.js +19 -4
  51. package/dist/src/commands/utils/dir-sharded.js.map +1 -1
  52. package/dist/src/commands/utils/errors.js +2 -0
  53. package/dist/src/commands/utils/errors.js.map +1 -1
  54. package/dist/src/commands/utils/hamt-utils.d.ts +5 -5
  55. package/dist/src/commands/utils/hamt-utils.d.ts.map +1 -1
  56. package/dist/src/commands/utils/hamt-utils.js +5 -5
  57. package/dist/src/commands/utils/hamt-utils.js.map +1 -1
  58. package/dist/src/commands/utils/is-over-shard-threshold.d.ts +1 -1
  59. package/dist/src/commands/utils/is-over-shard-threshold.d.ts.map +1 -1
  60. package/dist/src/commands/utils/is-over-shard-threshold.js +1 -1
  61. package/dist/src/commands/utils/is-over-shard-threshold.js.map +1 -1
  62. package/dist/src/commands/utils/persist.d.ts +1 -1
  63. package/dist/src/commands/utils/persist.d.ts.map +1 -1
  64. package/dist/src/commands/utils/persist.js +1 -1
  65. package/dist/src/commands/utils/persist.js.map +1 -1
  66. package/dist/src/commands/utils/remove-link.d.ts +3 -3
  67. package/dist/src/commands/utils/remove-link.d.ts.map +1 -1
  68. package/dist/src/commands/utils/remove-link.js +6 -6
  69. package/dist/src/commands/utils/remove-link.js.map +1 -1
  70. package/dist/src/commands/utils/resolve.d.ts +2 -2
  71. package/dist/src/commands/utils/resolve.d.ts.map +1 -1
  72. package/dist/src/commands/utils/resolve.js +2 -2
  73. package/dist/src/commands/utils/resolve.js.map +1 -1
  74. package/dist/src/index.d.ts +3 -3
  75. package/dist/src/index.d.ts.map +1 -1
  76. package/dist/src/index.js +14 -13
  77. package/dist/src/index.js.map +1 -1
  78. package/package.json +3 -3
  79. package/src/commands/add.ts +4 -4
  80. package/src/commands/cat.ts +4 -4
  81. package/src/commands/chmod.ts +15 -15
  82. package/src/commands/cp.ts +5 -5
  83. package/src/commands/ls.ts +5 -5
  84. package/src/commands/mkdir.ts +7 -7
  85. package/src/commands/rm.ts +5 -5
  86. package/src/commands/stat.ts +8 -8
  87. package/src/commands/touch.ts +15 -15
  88. package/src/commands/utils/add-link.ts +14 -14
  89. package/src/commands/utils/cid-to-directory.ts +4 -4
  90. package/src/commands/utils/cid-to-pblink.ts +4 -4
  91. package/src/commands/utils/dir-sharded.ts +6 -6
  92. package/src/commands/utils/hamt-utils.ts +9 -9
  93. package/src/commands/utils/is-over-shard-threshold.ts +3 -3
  94. package/src/commands/utils/persist.ts +2 -2
  95. package/src/commands/utils/remove-link.ts +11 -11
  96. package/src/commands/utils/resolve.ts +4 -4
  97. package/src/index.ts +18 -18
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC1F,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAE3C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;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E,UAA8B,EAAE;QACpD,KAAM,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IACtD,CAAC;IAED,KAAK,CAAC,KAAK,CAAE,GAAQ,EAAE,OAAe,EAAE,UAAiC,EAAE;QACzE,OAAO,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IACjE,CAAC;IAED,KAAK,CAAC,EAAE,CAAE,GAAQ,EAAE,IAAY,EAAE,UAA8B,EAAE;QAChE,OAAO,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IAC3D,CAAC;IAED,KAAK,CAAC,IAAI,CAAE,GAAQ,EAAE,UAAgC,EAAE;QACtD,OAAO,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IACvD,CAAC;IAED,KAAK,CAAC,KAAK,CAAE,GAAQ,EAAE,UAAiC,EAAE;QACxD,OAAO,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IACxD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,MAAM,CAAE,KAA6B;IACnD,OAAO,IAAI,aAAa,CAAC,KAAK,CAAC,CAAA;AACjC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helia/unixfs",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "A Helia-compatible wrapper for UnixFS",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/ipfs/helia-unixfs/tree/master/packages/unixfs#readme",
@@ -157,9 +157,9 @@
157
157
  "sparse-array": "^1.3.2"
158
158
  },
159
159
  "devDependencies": {
160
- "aegir": "^38.1.0",
160
+ "aegir": "^39.0.8",
161
161
  "blockstore-core": "^4.0.1",
162
- "delay": "^5.0.0",
162
+ "delay": "^6.0.0",
163
163
  "it-all": "^3.0.1",
164
164
  "it-drain": "^3.0.1",
165
165
  "it-first": "^3.0.1",
@@ -1,8 +1,8 @@
1
- import type { CID } from 'multiformats/cid'
2
- import type { Blocks } from '@helia/interface/blocks'
3
- import { ByteStream, DirectoryCandidate, FileCandidate, importBytes, importByteStream, ImportCandidateStream, importDirectory, importer, ImporterOptions, importFile, ImportResult } from 'ipfs-unixfs-importer'
4
- import { balanced } from 'ipfs-unixfs-importer/layout'
1
+ import { type ByteStream, type DirectoryCandidate, type FileCandidate, importBytes, importByteStream, type ImportCandidateStream, importDirectory, importer, type ImporterOptions, importFile, type ImportResult } from 'ipfs-unixfs-importer'
5
2
  import { fixedSize } from 'ipfs-unixfs-importer/chunker'
3
+ import { balanced } from 'ipfs-unixfs-importer/layout'
4
+ import type { Blocks } from '@helia/interface/blocks'
5
+ import type { CID } from 'multiformats/cid'
6
6
 
7
7
  /**
8
8
  * Default importer settings match Filecoin
@@ -1,10 +1,10 @@
1
1
  import { exporter } from 'ipfs-unixfs-exporter'
2
- import type { CID } from 'multiformats/cid'
3
- import type { CatOptions } from '../index.js'
4
- import { resolve } from './utils/resolve.js'
5
2
  import mergeOpts from 'merge-options'
6
- import type { Blocks } from '@helia/interface/blocks'
7
3
  import { NoContentError, NotAFileError } from './utils/errors.js'
4
+ import { resolve } from './utils/resolve.js'
5
+ import type { CatOptions } from '../index.js'
6
+ import type { Blocks } from '@helia/interface/blocks'
7
+ import type { CID } from 'multiformats/cid'
8
8
 
9
9
  const mergeOptions = mergeOpts.bind({ ignoreUndefined: true })
10
10
 
@@ -1,21 +1,21 @@
1
- import { recursive } from 'ipfs-unixfs-exporter'
2
- import { CID } from 'multiformats/cid'
3
- import type { ChmodOptions } from '../index.js'
4
- import mergeOpts from 'merge-options'
1
+ import * as dagPB from '@ipld/dag-pb'
5
2
  import { logger } from '@libp2p/logger'
6
3
  import { UnixFS } from 'ipfs-unixfs'
7
- import { pipe } from 'it-pipe'
8
- import { InvalidPBNodeError, NotUnixFSError, UnknownError } from './utils/errors.js'
9
- import * as dagPB from '@ipld/dag-pb'
10
- import type { PBNode, PBLink } from '@ipld/dag-pb'
4
+ import { recursive } from 'ipfs-unixfs-exporter'
11
5
  import { importer } from 'ipfs-unixfs-importer'
12
- import { persist } from './utils/persist.js'
13
- import type { Blocks } from '@helia/interface/blocks'
14
6
  import last from 'it-last'
15
- import { sha256 } from 'multiformats/hashes/sha2'
16
- import { resolve, updatePathCids } from './utils/resolve.js'
7
+ import { pipe } from 'it-pipe'
8
+ import mergeOpts from 'merge-options'
9
+ import { CID } from 'multiformats/cid'
17
10
  import * as raw from 'multiformats/codecs/raw'
11
+ import { sha256 } from 'multiformats/hashes/sha2'
18
12
  import { SHARD_SPLIT_THRESHOLD_BYTES } from './utils/constants.js'
13
+ import { InvalidPBNodeError, NotUnixFSError, UnknownError } from './utils/errors.js'
14
+ import { persist } from './utils/persist.js'
15
+ import { resolve, updatePathCids } from './utils/resolve.js'
16
+ import type { ChmodOptions } from '../index.js'
17
+ import type { Blocks } from '@helia/interface/blocks'
18
+ import type { PBNode, PBLink } from '@ipld/dag-pb'
19
19
 
20
20
  const mergeOptions = mergeOpts.bind({ ignoreUndefined: true })
21
21
  const log = logger('helia:unixfs:chmod')
@@ -94,14 +94,14 @@ export async function chmod (cid: CID, mode: number, blockstore: Blocks, options
94
94
  }
95
95
  }
96
96
  }),
97
- async (nodes) => await last(nodes)
97
+ async (nodes) => last(nodes)
98
98
  )
99
99
 
100
100
  if (root == null) {
101
101
  throw new UnknownError(`Could not chmod ${resolved.cid.toString()}`)
102
102
  }
103
103
 
104
- return await updatePathCids(root.cid, resolved, blockstore, opts)
104
+ return updatePathCids(root.cid, resolved, blockstore, opts)
105
105
  }
106
106
 
107
107
  const block = await blockstore.get(resolved.cid)
@@ -133,5 +133,5 @@ export async function chmod (cid: CID, mode: number, blockstore: Blocks, options
133
133
 
134
134
  await blockstore.put(updatedCid, updatedBlock)
135
135
 
136
- return await updatePathCids(updatedCid, resolved, blockstore, opts)
136
+ return updatePathCids(updatedCid, resolved, blockstore, opts)
137
137
  }
@@ -1,13 +1,13 @@
1
- import type { Blocks } from '@helia/interface/blocks'
2
- import type { CID } from 'multiformats/cid'
3
- import type { CpOptions } from '../index.js'
4
- import mergeOpts from 'merge-options'
5
1
  import { logger } from '@libp2p/logger'
2
+ import mergeOpts from 'merge-options'
6
3
  import { addLink } from './utils/add-link.js'
7
- import { cidToPBLink } from './utils/cid-to-pblink.js'
8
4
  import { cidToDirectory } from './utils/cid-to-directory.js'
5
+ import { cidToPBLink } from './utils/cid-to-pblink.js'
9
6
  import { SHARD_SPLIT_THRESHOLD_BYTES } from './utils/constants.js'
10
7
  import { InvalidParametersError } from './utils/errors.js'
8
+ import type { CpOptions } from '../index.js'
9
+ import type { Blocks } from '@helia/interface/blocks'
10
+ import type { CID } from 'multiformats/cid'
11
11
 
12
12
  const mergeOptions = mergeOpts.bind({ ignoreUndefined: true })
13
13
  const log = logger('helia:unixfs:cp')
@@ -1,10 +1,10 @@
1
- import { exporter, UnixFSEntry } from 'ipfs-unixfs-exporter'
2
- import type { CID } from 'multiformats/cid'
3
- import type { LsOptions } from '../index.js'
4
- import { resolve } from './utils/resolve.js'
1
+ import { exporter, type UnixFSEntry } from 'ipfs-unixfs-exporter'
5
2
  import mergeOpts from 'merge-options'
6
- import type { Blocks } from '@helia/interface/blocks'
7
3
  import { NoContentError, NotADirectoryError } from './utils/errors.js'
4
+ import { resolve } from './utils/resolve.js'
5
+ import type { LsOptions } from '../index.js'
6
+ import type { Blocks } from '@helia/interface/blocks'
7
+ import type { CID } from 'multiformats/cid'
8
8
 
9
9
  const mergeOptions = mergeOpts.bind({ ignoreUndefined: true })
10
10
 
@@ -1,17 +1,17 @@
1
- import { CID } from 'multiformats/cid'
2
- import mergeOpts from 'merge-options'
3
- import { logger } from '@libp2p/logger'
4
- import type { MkdirOptions } from '../index.js'
5
1
  import * as dagPB from '@ipld/dag-pb'
6
- import { addLink } from './utils/add-link.js'
7
- import type { Blocks } from '@helia/interface/blocks'
2
+ import { logger } from '@libp2p/logger'
8
3
  import { UnixFS } from 'ipfs-unixfs'
9
- import { sha256 } from 'multiformats/hashes/sha2'
10
4
  import { exporter } from 'ipfs-unixfs-exporter'
5
+ import mergeOpts from 'merge-options'
6
+ import { CID } from 'multiformats/cid'
7
+ import { sha256 } from 'multiformats/hashes/sha2'
8
+ import { addLink } from './utils/add-link.js'
11
9
  import { cidToDirectory } from './utils/cid-to-directory.js'
12
10
  import { cidToPBLink } from './utils/cid-to-pblink.js'
13
11
  import { SHARD_SPLIT_THRESHOLD_BYTES } from './utils/constants.js'
14
12
  import { InvalidParametersError, NotADirectoryError } from './utils/errors.js'
13
+ import type { MkdirOptions } from '../index.js'
14
+ import type { Blocks } from '@helia/interface/blocks'
15
15
 
16
16
  const mergeOptions = mergeOpts.bind({ ignoreUndefined: true })
17
17
  const log = logger('helia:unixfs:mkdir')
@@ -1,12 +1,12 @@
1
- import type { Blocks } from '@helia/interface/blocks'
2
- import type { CID } from 'multiformats/cid'
3
- import type { RmOptions } from '../index.js'
4
- import mergeOpts from 'merge-options'
5
1
  import { logger } from '@libp2p/logger'
6
- import { removeLink } from './utils/remove-link.js'
2
+ import mergeOpts from 'merge-options'
7
3
  import { cidToDirectory } from './utils/cid-to-directory.js'
8
4
  import { SHARD_SPLIT_THRESHOLD_BYTES } from './utils/constants.js'
9
5
  import { InvalidParametersError } from './utils/errors.js'
6
+ import { removeLink } from './utils/remove-link.js'
7
+ import type { RmOptions } from '../index.js'
8
+ import type { Blocks } from '@helia/interface/blocks'
9
+ import type { CID } from 'multiformats/cid'
10
10
 
11
11
  const mergeOptions = mergeOpts.bind({ ignoreUndefined: true })
12
12
  const log = logger('helia:unixfs:rm')
@@ -1,16 +1,16 @@
1
- import { exporter } from 'ipfs-unixfs-exporter'
2
- import type { CID } from 'multiformats/cid'
3
- import type { StatOptions, UnixFSStats } from '../index.js'
4
- import mergeOpts from 'merge-options'
1
+ import * as dagPb from '@ipld/dag-pb'
5
2
  import { logger } from '@libp2p/logger'
6
3
  import { UnixFS } from 'ipfs-unixfs'
4
+ import { exporter } from 'ipfs-unixfs-exporter'
5
+ import mergeOpts from 'merge-options'
6
+ import * as raw from 'multiformats/codecs/raw'
7
7
  import { InvalidPBNodeError, NotUnixFSError, UnknownError } from './utils/errors.js'
8
- import * as dagPb from '@ipld/dag-pb'
9
- import type { AbortOptions } from '@libp2p/interfaces'
10
- import type { Mtime } from 'ipfs-unixfs'
11
8
  import { resolve } from './utils/resolve.js'
12
- import * as raw from 'multiformats/codecs/raw'
9
+ import type { StatOptions, UnixFSStats } from '../index.js'
13
10
  import type { Blocks } from '@helia/interface/blocks'
11
+ import type { AbortOptions } from '@libp2p/interfaces'
12
+ import type { Mtime } from 'ipfs-unixfs'
13
+ import type { CID } from 'multiformats/cid'
14
14
 
15
15
  const mergeOptions = mergeOpts.bind({ ignoreUndefined: true })
16
16
  const log = logger('helia:unixfs:stat')
@@ -1,21 +1,21 @@
1
- import { recursive } from 'ipfs-unixfs-exporter'
2
- import { CID } from 'multiformats/cid'
3
- import type { TouchOptions } from '../index.js'
4
- import mergeOpts from 'merge-options'
1
+ import * as dagPB from '@ipld/dag-pb'
5
2
  import { logger } from '@libp2p/logger'
6
3
  import { UnixFS } from 'ipfs-unixfs'
7
- import { pipe } from 'it-pipe'
8
- import { InvalidPBNodeError, NotUnixFSError, UnknownError } from './utils/errors.js'
9
- import * as dagPB from '@ipld/dag-pb'
10
- import type { PBNode, PBLink } from '@ipld/dag-pb'
4
+ import { recursive } from 'ipfs-unixfs-exporter'
11
5
  import { importer } from 'ipfs-unixfs-importer'
12
- import { persist } from './utils/persist.js'
13
- import type { Blocks } from '@helia/interface/blocks'
14
6
  import last from 'it-last'
15
- import { sha256 } from 'multiformats/hashes/sha2'
16
- import { resolve, updatePathCids } from './utils/resolve.js'
7
+ import { pipe } from 'it-pipe'
8
+ import mergeOpts from 'merge-options'
9
+ import { CID } from 'multiformats/cid'
17
10
  import * as raw from 'multiformats/codecs/raw'
11
+ import { sha256 } from 'multiformats/hashes/sha2'
18
12
  import { SHARD_SPLIT_THRESHOLD_BYTES } from './utils/constants.js'
13
+ import { InvalidPBNodeError, NotUnixFSError, UnknownError } from './utils/errors.js'
14
+ import { persist } from './utils/persist.js'
15
+ import { resolve, updatePathCids } from './utils/resolve.js'
16
+ import type { TouchOptions } from '../index.js'
17
+ import type { Blocks } from '@helia/interface/blocks'
18
+ import type { PBNode, PBLink } from '@ipld/dag-pb'
19
19
 
20
20
  const mergeOptions = mergeOpts.bind({ ignoreUndefined: true })
21
21
  const log = logger('helia:unixfs:touch')
@@ -98,14 +98,14 @@ export async function touch (cid: CID, blockstore: Blocks, options: Partial<Touc
98
98
  }
99
99
  }
100
100
  }),
101
- async (nodes) => await last(nodes)
101
+ async (nodes) => last(nodes)
102
102
  )
103
103
 
104
104
  if (root == null) {
105
105
  throw new UnknownError(`Could not chmod ${resolved.cid.toString()}`)
106
106
  }
107
107
 
108
- return await updatePathCids(root.cid, resolved, blockstore, opts)
108
+ return updatePathCids(root.cid, resolved, blockstore, opts)
109
109
  }
110
110
 
111
111
  const block = await blockstore.get(resolved.cid)
@@ -136,5 +136,5 @@ export async function touch (cid: CID, blockstore: Blocks, options: Partial<Touc
136
136
 
137
137
  await blockstore.put(updatedCid, updatedBlock)
138
138
 
139
- return await updatePathCids(updatedCid, resolved, blockstore, opts)
139
+ return updatePathCids(updatedCid, resolved, blockstore, opts)
140
140
  }
@@ -1,26 +1,26 @@
1
1
  import * as dagPB from '@ipld/dag-pb'
2
- import { CID, Version } from 'multiformats/cid'
3
2
  import { logger } from '@libp2p/logger'
4
3
  import { UnixFS } from 'ipfs-unixfs'
4
+ import { CID, type Version } from 'multiformats/cid'
5
+ import { sha256 } from 'multiformats/hashes/sha2'
6
+ // @ts-expect-error no types
7
+ import SparseArray from 'sparse-array'
8
+ import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
9
+ import { wrapHash } from './consumable-hash.js'
10
+ import { AlreadyExistsError, InvalidParametersError, InvalidPBNodeError } from './errors.js'
11
+ import { hamtBucketBits, hamtHashFn } from './hamt-constants.js'
5
12
  import {
6
13
  createShard,
7
14
  recreateShardedDirectory,
8
15
  toPrefix,
9
16
  updateShardedDirectory
10
17
  } from './hamt-utils.js'
11
- import type { PBNode, PBLink } from '@ipld/dag-pb/interface'
12
- import { sha256 } from 'multiformats/hashes/sha2'
13
- import { AlreadyExistsError, InvalidParametersError, InvalidPBNodeError } from './errors.js'
14
- import type { ImportResult } from 'ipfs-unixfs-importer'
15
- import type { AbortOptions } from '@libp2p/interfaces'
18
+ import { isOverShardThreshold } from './is-over-shard-threshold.js'
16
19
  import type { Directory } from './cid-to-directory.js'
17
20
  import type { Blocks } from '@helia/interface/blocks'
18
- import { isOverShardThreshold } from './is-over-shard-threshold.js'
19
- import { hamtBucketBits, hamtHashFn } from './hamt-constants.js'
20
- // @ts-expect-error no types
21
- import SparseArray from 'sparse-array'
22
- import { wrapHash } from './consumable-hash.js'
23
- import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
21
+ import type { PBNode, PBLink } from '@ipld/dag-pb/interface'
22
+ import type { AbortOptions } from '@libp2p/interfaces'
23
+ import type { ImportResult } from 'ipfs-unixfs-importer'
24
24
 
25
25
  const log = logger('helia:unixfs:components:utils:add-link')
26
26
 
@@ -45,7 +45,7 @@ export async function addLink (parent: Directory, child: Required<PBLink>, block
45
45
  if (meta.type === 'hamt-sharded-directory') {
46
46
  log('adding link to sharded directory')
47
47
 
48
- return await addToShardedDirectory(parent, child, blockstore, options)
48
+ return addToShardedDirectory(parent, child, blockstore, options)
49
49
  }
50
50
 
51
51
  log(`adding ${child.Name} (${child.Hash}) to regular directory`)
@@ -253,5 +253,5 @@ const addToShardedDirectory = async (parent: Directory, child: Required<PBLink>,
253
253
  log('adding %s to existing sub-shard', linkName)
254
254
  }
255
255
 
256
- return await updateShardedDirectory(path, blockstore, options)
256
+ return updateShardedDirectory(path, blockstore, options)
257
257
  }
@@ -1,8 +1,8 @@
1
- import { exporter, ExporterOptions } from 'ipfs-unixfs-exporter'
2
- import type { CID } from 'multiformats/cid'
3
- import type { PBNode } from '@ipld/dag-pb'
4
- import type { Blocks } from '@helia/interface/blocks'
1
+ import { exporter, type ExporterOptions } from 'ipfs-unixfs-exporter'
5
2
  import { NotADirectoryError } from './errors.js'
3
+ import type { Blocks } from '@helia/interface/blocks'
4
+ import type { PBNode } from '@ipld/dag-pb'
5
+ import type { CID } from 'multiformats/cid'
6
6
 
7
7
  export interface Directory {
8
8
  cid: CID
@@ -1,9 +1,9 @@
1
- import { exporter, ExporterOptions } from 'ipfs-unixfs-exporter'
2
- import type { CID } from 'multiformats/cid'
3
- import { NotUnixFSError } from './errors.js'
4
1
  import * as dagPb from '@ipld/dag-pb'
5
- import type { PBNode, PBLink } from '@ipld/dag-pb'
2
+ import { exporter, type ExporterOptions } from 'ipfs-unixfs-exporter'
3
+ import { NotUnixFSError } from './errors.js'
6
4
  import type { Blocks } from '@helia/interface/blocks'
5
+ import type { PBNode, PBLink } from '@ipld/dag-pb'
6
+ import type { CID } from 'multiformats/cid'
7
7
 
8
8
  export async function cidToPBLink (cid: CID, name: string, blockstore: Blocks, options?: ExporterOptions): Promise<Required<PBLink>> {
9
9
  const sourceEntry = await exporter(cid, blockstore, options)
@@ -1,14 +1,14 @@
1
- import { encode, PBLink, prepare } from '@ipld/dag-pb'
1
+ import { encode, type PBLink, prepare } from '@ipld/dag-pb'
2
+ import { createHAMT, Bucket, type BucketChild } from 'hamt-sharding'
2
3
  import { UnixFS } from 'ipfs-unixfs'
3
- import { persist, PersistOptions } from './persist.js'
4
- import { createHAMT, Bucket, BucketChild } from 'hamt-sharding'
4
+ import { CID } from 'multiformats/cid'
5
5
  import {
6
6
  hamtHashCode,
7
7
  hamtHashFn
8
8
  } from './hamt-constants.js'
9
- import { CID } from 'multiformats/cid'
10
- import type { Mtime } from 'ipfs-unixfs'
9
+ import { persist, type PersistOptions } from './persist.js'
11
10
  import type { Blocks } from '@helia/interface/blocks'
11
+ import type { Mtime } from 'ipfs-unixfs'
12
12
 
13
13
  interface InProgressImportResult extends ImportResult {
14
14
  single?: boolean
@@ -95,7 +95,7 @@ export class DirSharded extends Dir {
95
95
  }
96
96
 
97
97
  async get (name: string): Promise<InProgressImportResult | Dir | undefined> {
98
- return await this._bucket.get(name)
98
+ return this._bucket.get(name)
99
99
  }
100
100
 
101
101
  childCount (): number {
@@ -1,24 +1,24 @@
1
1
  import * as dagPB from '@ipld/dag-pb'
2
- import { DirSharded } from './dir-sharded.js'
3
2
  import { logger } from '@libp2p/logger'
4
3
  import { UnixFS } from 'ipfs-unixfs'
5
4
  import last from 'it-last'
6
- import type { CID, Version } from 'multiformats/cid'
5
+ // @ts-expect-error no types
6
+ import SparseArray from 'sparse-array'
7
+ import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
8
+ import { type InfiniteHash, wrapHash } from './consumable-hash.js'
9
+ import { DirSharded } from './dir-sharded.js'
7
10
  import {
8
11
  hamtHashCode,
9
12
  hamtHashFn,
10
13
  hamtBucketBits
11
14
  } from './hamt-constants.js'
15
+ import { persist } from './persist.js'
16
+ import type { PersistOptions } from './persist.js'
12
17
  import type { Blocks } from '@helia/interface/blocks'
13
- import type { Mtime } from 'ipfs-unixfs'
14
18
  import type { AbortOptions } from '@libp2p/interfaces'
19
+ import type { Mtime } from 'ipfs-unixfs'
15
20
  import type { ImportResult } from 'ipfs-unixfs-importer'
16
- import { persist } from './persist.js'
17
- import { InfiniteHash, wrapHash } from './consumable-hash.js'
18
- import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
19
- // @ts-expect-error no types
20
- import SparseArray from 'sparse-array'
21
- import type { PersistOptions } from './persist.js'
21
+ import type { CID, Version } from 'multiformats/cid'
22
22
 
23
23
  const log = logger('helia:unixfs:commands:utils:hamt-utils')
24
24
 
@@ -1,8 +1,8 @@
1
- import type { PBNode } from '@ipld/dag-pb'
2
- import type { Blocks } from '@helia/interface/blocks'
3
- import { UnixFS } from 'ipfs-unixfs'
4
1
  import * as dagPb from '@ipld/dag-pb'
2
+ import { UnixFS } from 'ipfs-unixfs'
5
3
  import { CID_V0, CID_V1 } from './dir-sharded.js'
4
+ import type { Blocks } from '@helia/interface/blocks'
5
+ import type { PBNode } from '@ipld/dag-pb'
6
6
 
7
7
  /**
8
8
  * Estimate node size only based on DAGLink name and CID byte lengths
@@ -1,9 +1,9 @@
1
- import { CID } from 'multiformats/cid'
2
1
  import * as dagPb from '@ipld/dag-pb'
2
+ import { CID } from 'multiformats/cid'
3
3
  import { sha256 } from 'multiformats/hashes/sha2'
4
4
  import type { Blocks } from '@helia/interface/blocks'
5
- import type { BlockCodec } from 'multiformats/codecs/interface'
6
5
  import type { Version as CIDVersion } from 'multiformats/cid'
6
+ import type { BlockCodec } from 'multiformats/codecs/interface'
7
7
 
8
8
  export interface PersistOptions {
9
9
  codec?: BlockCodec<any, any>
@@ -1,21 +1,21 @@
1
1
 
2
2
  import * as dagPB from '@ipld/dag-pb'
3
- import type { CID, Version } from 'multiformats/cid'
4
3
  import { logger } from '@libp2p/logger'
5
4
  import { UnixFS } from 'ipfs-unixfs'
5
+ import { exporter } from 'ipfs-unixfs-exporter'
6
+ import { InvalidParametersError, InvalidPBNodeError } from './errors.js'
6
7
  import {
7
8
  recreateShardedDirectory,
8
- UpdateHamtDirectoryOptions,
9
+ type UpdateHamtDirectoryOptions,
9
10
  updateShardedDirectory
10
11
  } from './hamt-utils.js'
11
- import type { PBNode } from '@ipld/dag-pb'
12
- import type { Blocks } from '@helia/interface/blocks'
12
+ import { isOverShardThreshold } from './is-over-shard-threshold.js'
13
+ import { persist } from './persist.js'
13
14
  import type { Directory } from './cid-to-directory.js'
15
+ import type { Blocks } from '@helia/interface/blocks'
16
+ import type { PBNode } from '@ipld/dag-pb'
14
17
  import type { AbortOptions } from '@libp2p/interfaces'
15
- import { InvalidParametersError, InvalidPBNodeError } from './errors.js'
16
- import { exporter } from 'ipfs-unixfs-exporter'
17
- import { persist } from './persist.js'
18
- import { isOverShardThreshold } from './is-over-shard-threshold.js'
18
+ import type { CID, Version } from 'multiformats/cid'
19
19
 
20
20
  const log = logger('helia:unixfs:utils:remove-link')
21
21
 
@@ -44,7 +44,7 @@ export async function removeLink (parent: Directory, name: string, blockstore: B
44
44
  if (!(await isOverShardThreshold(result.node, blockstore, options.shardSplitThresholdBytes))) {
45
45
  log('converting shard to flat directory %c', parent.cid)
46
46
 
47
- return await convertToFlatDirectory(result, blockstore, options)
47
+ return convertToFlatDirectory(result, blockstore, options)
48
48
  }
49
49
 
50
50
  return result
@@ -52,7 +52,7 @@ export async function removeLink (parent: Directory, name: string, blockstore: B
52
52
 
53
53
  log(`removing link ${name} regular directory`)
54
54
 
55
- return await removeFromDirectory(parent, name, blockstore, options)
55
+ return removeFromDirectory(parent, name, blockstore, options)
56
56
  }
57
57
 
58
58
  const removeFromDirectory = async (parent: Directory, name: string, blockstore: Blocks, options: AbortOptions): Promise<RemoveLinkResult> => {
@@ -129,7 +129,7 @@ const removeFromShardedDirectory = async (parent: Directory, name: string, block
129
129
  }
130
130
  }
131
131
 
132
- return await updateShardedDirectory(path, blockstore, options)
132
+ return updateShardedDirectory(path, blockstore, options)
133
133
  }
134
134
 
135
135
  const convertToFlatDirectory = async (parent: Directory, blockstore: Blocks, options: RmLinkOptions): Promise<RemoveLinkResult> => {
@@ -1,12 +1,12 @@
1
- import type { CID } from 'multiformats/cid'
2
- import { exporter } from 'ipfs-unixfs-exporter'
3
- import type { AbortOptions } from '@libp2p/interfaces'
4
1
  import { logger } from '@libp2p/logger'
5
- import { DoesNotExistError, InvalidParametersError } from './errors.js'
2
+ import { exporter } from 'ipfs-unixfs-exporter'
6
3
  import { addLink } from './add-link.js'
7
4
  import { cidToDirectory } from './cid-to-directory.js'
8
5
  import { cidToPBLink } from './cid-to-pblink.js'
6
+ import { DoesNotExistError, InvalidParametersError } from './errors.js'
9
7
  import type { Blocks } from '@helia/interface/blocks'
8
+ import type { AbortOptions } from '@libp2p/interfaces'
9
+ import type { CID } from 'multiformats/cid'
10
10
 
11
11
  const log = logger('helia:unixfs:components:utils:resolve')
12
12
 
package/src/index.ts CHANGED
@@ -31,21 +31,21 @@
31
31
  * ```
32
32
  */
33
33
 
34
- import type { CID, Version } from 'multiformats/cid'
35
- import type { Blocks, GetBlockProgressEvents, PutBlockProgressEvents } from '@helia/interface/blocks'
36
- import type { AbortOptions } from '@libp2p/interfaces'
37
34
  import { addAll, addBytes, addByteStream, addDirectory, addFile } from './commands/add.js'
38
35
  import { cat } from './commands/cat.js'
39
- import { mkdir } from './commands/mkdir.js'
40
- import type { Mtime } from 'ipfs-unixfs'
36
+ import { chmod } from './commands/chmod.js'
41
37
  import { cp } from './commands/cp.js'
38
+ import { ls } from './commands/ls.js'
39
+ import { mkdir } from './commands/mkdir.js'
42
40
  import { rm } from './commands/rm.js'
43
41
  import { stat } from './commands/stat.js'
44
42
  import { touch } from './commands/touch.js'
45
- import { chmod } from './commands/chmod.js'
43
+ import type { Blocks, GetBlockProgressEvents, PutBlockProgressEvents } from '@helia/interface/blocks'
44
+ import type { AbortOptions } from '@libp2p/interfaces'
45
+ import type { Mtime, UnixFS as IPFSUnixFS } from 'ipfs-unixfs'
46
46
  import type { ExporterProgressEvents, UnixFSEntry } from 'ipfs-unixfs-exporter'
47
- import { ls } from './commands/ls.js'
48
47
  import type { ByteStream, DirectoryCandidate, FileCandidate, ImportCandidateStream, ImporterOptions, ImporterProgressEvents, ImportResult } from 'ipfs-unixfs-importer'
48
+ import type { CID, Version } from 'multiformats/cid'
49
49
  import type { ProgressOptions } from 'progress-events'
50
50
 
51
51
  export interface UnixFSComponents {
@@ -248,7 +248,7 @@ export interface UnixFSStats {
248
248
  * UnixFS metadata about this file or directory. Will not be present
249
249
  * if the node is a `raw` type.
250
250
  */
251
- unixfs?: import('ipfs-unixfs').UnixFS
251
+ unixfs?: IPFSUnixFS
252
252
  }
253
253
 
254
254
  /**
@@ -505,19 +505,19 @@ class DefaultUnixFS implements UnixFS {
505
505
  }
506
506
 
507
507
  async addBytes (bytes: Uint8Array, options: Partial<AddOptions> = {}): Promise<CID> {
508
- return await addBytes(bytes, this.components.blockstore, options)
508
+ return addBytes(bytes, this.components.blockstore, options)
509
509
  }
510
510
 
511
511
  async addByteStream (bytes: ByteStream, options: Partial<AddOptions> = {}): Promise<CID> {
512
- return await addByteStream(bytes, this.components.blockstore, options)
512
+ return addByteStream(bytes, this.components.blockstore, options)
513
513
  }
514
514
 
515
515
  async addFile (file: FileCandidate, options: Partial<AddOptions> = {}): Promise<CID> {
516
- return await addFile(file, this.components.blockstore, options)
516
+ return addFile(file, this.components.blockstore, options)
517
517
  }
518
518
 
519
519
  async addDirectory (dir: Partial<DirectoryCandidate> = {}, options: Partial<AddOptions> = {}): Promise<CID> {
520
- return await addDirectory(dir, this.components.blockstore, options)
520
+ return addDirectory(dir, this.components.blockstore, options)
521
521
  }
522
522
 
523
523
  async * cat (cid: CID, options: Partial<CatOptions> = {}): AsyncIterable<Uint8Array> {
@@ -525,11 +525,11 @@ class DefaultUnixFS implements UnixFS {
525
525
  }
526
526
 
527
527
  async chmod (cid: CID, mode: number, options: Partial<ChmodOptions> = {}): Promise<CID> {
528
- return await chmod(cid, mode, this.components.blockstore, options)
528
+ return chmod(cid, mode, this.components.blockstore, options)
529
529
  }
530
530
 
531
531
  async cp (source: CID, target: CID, name: string, options: Partial<CpOptions> = {}): Promise<CID> {
532
- return await cp(source, target, name, this.components.blockstore, options)
532
+ return cp(source, target, name, this.components.blockstore, options)
533
533
  }
534
534
 
535
535
  async * ls (cid: CID, options: Partial<LsOptions> = {}): AsyncIterable<UnixFSEntry> {
@@ -537,19 +537,19 @@ class DefaultUnixFS implements UnixFS {
537
537
  }
538
538
 
539
539
  async mkdir (cid: CID, dirname: string, options: Partial<MkdirOptions> = {}): Promise<CID> {
540
- return await mkdir(cid, dirname, this.components.blockstore, options)
540
+ return mkdir(cid, dirname, this.components.blockstore, options)
541
541
  }
542
542
 
543
543
  async rm (cid: CID, path: string, options: Partial<RmOptions> = {}): Promise<CID> {
544
- return await rm(cid, path, this.components.blockstore, options)
544
+ return rm(cid, path, this.components.blockstore, options)
545
545
  }
546
546
 
547
547
  async stat (cid: CID, options: Partial<StatOptions> = {}): Promise<UnixFSStats> {
548
- return await stat(cid, this.components.blockstore, options)
548
+ return stat(cid, this.components.blockstore, options)
549
549
  }
550
550
 
551
551
  async touch (cid: CID, options: Partial<TouchOptions> = {}): Promise<CID> {
552
- return await touch(cid, this.components.blockstore, options)
552
+ return touch(cid, this.components.blockstore, options)
553
553
  }
554
554
  }
555
555