@ethersphere/bee-js 2.1.0 → 3.2.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.
Files changed (160) hide show
  1. package/README.md +3 -3
  2. package/dist/index.browser.min.js +1 -1
  3. package/dist/index.browser.min.js.map +1 -1
  4. package/dist/index.min.js +1 -1
  5. package/dist/index.min.js.map +1 -1
  6. package/dist/src/bee-debug.d.ts +5 -1
  7. package/dist/src/bee.d.ts +23 -46
  8. package/dist/src/modules/chunk.d.ts +2 -10
  9. package/dist/src/modules/debug/status.d.ts +10 -4
  10. package/dist/src/types/debug.d.ts +19 -0
  11. package/dist/src/types/index.d.ts +31 -2
  12. package/dist/src/utils/bytes.d.ts +1 -1
  13. package/dist/src/utils/error.d.ts +21 -2
  14. package/dist/src/utils/expose.d.ts +1 -0
  15. package/dist/src/utils/http.d.ts +7 -9
  16. package/dist/src/utils/stamps.d.ts +12 -0
  17. package/dist/src/utils/type.d.ts +6 -0
  18. package/package.json +28 -27
  19. package/.babelrc.js +0 -33
  20. package/.depcheckrc.json +0 -27
  21. package/.editorconfig +0 -6
  22. package/.eslintignore +0 -1
  23. package/.eslintrc.js +0 -109
  24. package/.gitattributes +0 -1
  25. package/.github/config.yaml +0 -23
  26. package/.github/workflows/check.yaml +0 -57
  27. package/.github/workflows/publish_npmjs.yaml +0 -20
  28. package/.github/workflows/release_github.yaml +0 -20
  29. package/.github/workflows/tests.yaml +0 -128
  30. package/.huskyrc +0 -5
  31. package/.prettierrc +0 -13
  32. package/.vscode/launch.json +0 -49
  33. package/.vscode/settings.json +0 -39
  34. package/CHANGELOG.md +0 -520
  35. package/CODEOWNERS +0 -1
  36. package/CODE_OF_CONDUCT.md +0 -76
  37. package/commitlint.config.js +0 -3
  38. package/dist/src/modules/stamps.d.ts +0 -4
  39. package/jest-puppeteer.config.js +0 -5
  40. package/jest.config.ts +0 -85
  41. package/src/bee-debug.ts +0 -601
  42. package/src/bee.ts +0 -1087
  43. package/src/chunk/bmt.ts +0 -55
  44. package/src/chunk/cac.ts +0 -79
  45. package/src/chunk/serialize.ts +0 -16
  46. package/src/chunk/signer.ts +0 -141
  47. package/src/chunk/soc.ts +0 -190
  48. package/src/chunk/span.ts +0 -33
  49. package/src/feed/index.ts +0 -217
  50. package/src/feed/json.ts +0 -33
  51. package/src/feed/topic.ts +0 -23
  52. package/src/feed/type.ts +0 -12
  53. package/src/index.ts +0 -24
  54. package/src/modules/bytes.ts +0 -70
  55. package/src/modules/bzz.ts +0 -179
  56. package/src/modules/chunk.ts +0 -69
  57. package/src/modules/debug/balance.ts +0 -63
  58. package/src/modules/debug/chequebook.ts +0 -175
  59. package/src/modules/debug/chunk.ts +0 -39
  60. package/src/modules/debug/connectivity.ts +0 -61
  61. package/src/modules/debug/settlements.ts +0 -33
  62. package/src/modules/debug/stamps.ts +0 -96
  63. package/src/modules/debug/states.ts +0 -35
  64. package/src/modules/debug/status.ts +0 -34
  65. package/src/modules/debug/tag.ts +0 -19
  66. package/src/modules/debug/transactions.ts +0 -79
  67. package/src/modules/feed.ts +0 -105
  68. package/src/modules/pinning.ts +0 -74
  69. package/src/modules/pss.ts +0 -49
  70. package/src/modules/soc.ts +0 -40
  71. package/src/modules/stamps.ts +0 -59
  72. package/src/modules/status.ts +0 -13
  73. package/src/modules/stewardship.ts +0 -32
  74. package/src/modules/tag.ts +0 -83
  75. package/src/types/debug.ts +0 -204
  76. package/src/types/index.ts +0 -561
  77. package/src/types/ky-universal/common.d.ts +0 -17
  78. package/src/types/ky-universal/hooks.d.ts +0 -103
  79. package/src/types/ky-universal/index.d.ts +0 -125
  80. package/src/types/ky-universal/options.d.ts +0 -235
  81. package/src/types/ky-universal/response.d.ts +0 -38
  82. package/src/types/ky-universal/retry.d.ts +0 -39
  83. package/src/types/tar-js.d.ts +0 -1
  84. package/src/types/webpack-bundle-analyzer/index.d.ts +0 -13
  85. package/src/utils/bytes.ts +0 -144
  86. package/src/utils/collection.ts +0 -151
  87. package/src/utils/data.browser.ts +0 -68
  88. package/src/utils/data.ts +0 -48
  89. package/src/utils/error.ts +0 -23
  90. package/src/utils/eth.ts +0 -229
  91. package/src/utils/expose.ts +0 -48
  92. package/src/utils/file.ts +0 -40
  93. package/src/utils/hash.ts +0 -16
  94. package/src/utils/headers.ts +0 -63
  95. package/src/utils/hex.ts +0 -186
  96. package/src/utils/http.ts +0 -141
  97. package/src/utils/merge.ts +0 -34
  98. package/src/utils/pss.ts +0 -16
  99. package/src/utils/stream.ts +0 -146
  100. package/src/utils/tar.ts +0 -30
  101. package/src/utils/type.ts +0 -394
  102. package/src/utils/uint64.ts +0 -31
  103. package/src/utils/url.ts +0 -52
  104. package/test/bee.sh +0 -187
  105. package/test/data/1.txt +0 -1
  106. package/test/data/2.txt +0 -0
  107. package/test/data/empty +0 -0
  108. package/test/data/sub/3.txt +0 -1
  109. package/test/data/sub//303/251 +0 -0
  110. package/test/data/sub//360/237/230/216 +0 -0
  111. package/test/integration/bee-class.browser.spec.ts +0 -272
  112. package/test/integration/bee-class.spec.ts +0 -648
  113. package/test/integration/bee-debug-class.spec.ts +0 -114
  114. package/test/integration/chunk/bmt.spec.ts +0 -33
  115. package/test/integration/chunk/cac.spec.ts +0 -27
  116. package/test/integration/chunk/soc.spec.ts +0 -38
  117. package/test/integration/feed/index.spec.ts +0 -84
  118. package/test/integration/modules/bytes.spec.ts +0 -23
  119. package/test/integration/modules/bzz.spec.ts +0 -265
  120. package/test/integration/modules/chunk.spec.ts +0 -29
  121. package/test/integration/modules/debug/balance.spec.ts +0 -70
  122. package/test/integration/modules/debug/chequebook.spec.ts +0 -64
  123. package/test/integration/modules/debug/connectivity.spec.ts +0 -69
  124. package/test/integration/modules/debug/settlements.spec.ts +0 -34
  125. package/test/integration/modules/debug/states.spec.ts +0 -34
  126. package/test/integration/modules/debug/status.spec.ts +0 -65
  127. package/test/integration/modules/debug/tag.spec.ts +0 -27
  128. package/test/integration/modules/debug/transactions.spec.ts +0 -10
  129. package/test/integration/modules/feed.spec.ts +0 -61
  130. package/test/integration/modules/pinning.spec.ts +0 -155
  131. package/test/integration/modules/pss.spec.ts +0 -105
  132. package/test/integration/modules/status.spec.ts +0 -10
  133. package/test/integration/modules/stewardship.spec.ts +0 -32
  134. package/test/integration/modules/tag.spec.ts +0 -51
  135. package/test/test-type-sequencer.js +0 -36
  136. package/test/testpage/testpage.html +0 -20
  137. package/test/tests-setup.ts +0 -94
  138. package/test/unit/assertions.ts +0 -460
  139. package/test/unit/bee-class.spec.ts +0 -976
  140. package/test/unit/bee-debug-class.spec.ts +0 -435
  141. package/test/unit/chunk/bmt.spec.ts +0 -16
  142. package/test/unit/chunk/cac.spec.ts +0 -29
  143. package/test/unit/chunk/serialize.spec.ts +0 -24
  144. package/test/unit/chunk/signer.spec.ts +0 -140
  145. package/test/unit/chunk/soc.spec.ts +0 -25
  146. package/test/unit/chunk/span.spec.ts +0 -38
  147. package/test/unit/feed/json.spec.ts +0 -73
  148. package/test/unit/nock.ts +0 -151
  149. package/test/unit/utils/bytes.spec.ts +0 -32
  150. package/test/unit/utils/collection.spec.ts +0 -22
  151. package/test/unit/utils/eth.spec.ts +0 -224
  152. package/test/unit/utils/hex.spec.ts +0 -115
  153. package/test/unit/utils/stream.spec.ts +0 -30
  154. package/test/unit/utils/type.spec.ts +0 -32
  155. package/test/unit/utils/uint64.spec.ts +0 -102
  156. package/test/utils.ts +0 -426
  157. package/tsconfig.json +0 -18
  158. package/tsconfig.test.json +0 -11
  159. package/typedoc.json +0 -7
  160. package/webpack.config.ts +0 -141
package/webpack.config.ts DELETED
@@ -1,141 +0,0 @@
1
- /* eslint-disable no-console */
2
- import Path from 'path'
3
- import { DefinePlugin, Configuration, WebpackPluginInstance, NormalModuleReplacementPlugin } from 'webpack'
4
- import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
5
- import TerserPlugin from 'terser-webpack-plugin'
6
- import PackageJson from './package.json'
7
- import { getBrowserPathMapping } from './jest.config'
8
-
9
- interface WebpackEnvParams {
10
- target: 'web' | 'node'
11
- debug: boolean
12
- mode: 'production' | 'development'
13
- fileName: string
14
- }
15
-
16
- const base = async (env?: Partial<WebpackEnvParams>): Promise<Configuration> => {
17
- const isProduction = env?.mode === 'production'
18
- const isBrowser = env?.target === 'web'
19
- const filename =
20
- env?.fileName ||
21
- ['index', isBrowser ? '.browser' : null, isProduction ? '.min' : null, '.js'].filter(Boolean).join('')
22
- const entry = Path.resolve(__dirname, 'src')
23
- const path = Path.resolve(__dirname, 'dist')
24
- const target = env?.target || 'web' // 'node' or 'web'
25
- const plugins: WebpackPluginInstance[] = [
26
- new DefinePlugin({
27
- 'process.env.ENV': env?.mode || 'development',
28
- 'process.env.IS_WEBPACK_BUILD': 'true',
29
- }),
30
- ]
31
-
32
- if (target === 'web') {
33
- const browserPathMapping = await getBrowserPathMapping()
34
- // eslint-disable-next-line guard-for-in
35
- for (const nodeReference in browserPathMapping) {
36
- plugins.push(
37
- new NormalModuleReplacementPlugin(new RegExp(`\\${nodeReference}`), browserPathMapping[nodeReference]),
38
- )
39
- }
40
- // change node modules to browser modules according to packageJson.browser mapping
41
- // eslint-disable-next-line guard-for-in
42
- const browserModuleMapping = PackageJson.browser as { [key: string]: string }
43
- // eslint-disable-next-line guard-for-in
44
- for (const nodeReference in browserModuleMapping) {
45
- const browserReference: string = browserModuleMapping[nodeReference]
46
- plugins.push(new NormalModuleReplacementPlugin(new RegExp(`^${nodeReference}$`), browserReference))
47
- }
48
- }
49
-
50
- return {
51
- bail: Boolean(isProduction),
52
- mode: env?.mode || 'development',
53
- devtool: isProduction ? 'source-map' : 'cheap-module-source-map',
54
- entry,
55
- output: {
56
- path,
57
- filename,
58
- sourceMapFilename: filename + '.map',
59
- library: 'BeeJs',
60
- libraryTarget: 'umd',
61
- globalObject: 'this',
62
- },
63
- module: {
64
- rules: [
65
- {
66
- test: /\.(ts|js)$/,
67
- // include: entry,
68
- use: {
69
- loader: 'babel-loader',
70
- },
71
- },
72
- ],
73
- },
74
- resolve: {
75
- extensions: ['.ts', '.js'],
76
- fallback: {
77
- path: false,
78
- fs: false,
79
- stream: false,
80
- },
81
- },
82
- optimization: {
83
- minimize: isProduction,
84
- minimizer: [
85
- // This is only used in production mode
86
- new TerserPlugin({
87
- terserOptions: {
88
- parse: {
89
- // we want terser to parse ecma 8 code. However, we don't want it
90
- // to apply any minfication steps that turns valid ecma 5 code
91
- // into invalid ecma 5 code. This is why the 'compress' and 'output'
92
- // sections only apply transformations that are ecma 5 safe
93
- // https://github.com/facebook/create-react-app/pull/4234
94
- ecma: 2018,
95
- },
96
- compress: {
97
- ecma: 5,
98
- },
99
- mangle: {
100
- safari10: true,
101
- },
102
- output: {
103
- ecma: 5,
104
- comments: false,
105
- },
106
- },
107
- // Use multi-process parallel running to improve the build speed
108
- // Default number of concurrent runs: os.cpus().length - 1
109
- parallel: true,
110
- }),
111
- ],
112
- },
113
- plugins,
114
- target,
115
- node: {
116
- global: true,
117
- __filename: 'mock',
118
- __dirname: 'mock',
119
- },
120
- performance: {
121
- hints: false,
122
- },
123
- }
124
- }
125
-
126
- export default async (env?: Partial<WebpackEnvParams>): Promise<Configuration> => {
127
- // eslint-disable-next-line no-console
128
- console.log('env', env)
129
-
130
- if (env?.debug) {
131
- const config = {
132
- ...(await base(env)),
133
- plugins: [new BundleAnalyzerPlugin()],
134
- profile: true,
135
- }
136
-
137
- return config
138
- }
139
-
140
- return base(env)
141
- }