@streamr/cli-tools 102.2.0-rc.3 → 103.0.0-rc.1

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 (60) hide show
  1. package/dist/package.json +13 -7
  2. package/package.json +13 -7
  3. package/bin/streamr-internal-node-info.ts +0 -81
  4. package/bin/streamr-internal-operator-delegate.ts +0 -18
  5. package/bin/streamr-internal-operator-stake.ts +0 -18
  6. package/bin/streamr-internal-operator-undelegate.ts +0 -17
  7. package/bin/streamr-internal-operator-unstake.ts +0 -16
  8. package/bin/streamr-internal-show-sdk-config.ts +0 -11
  9. package/bin/streamr-internal-sponsorship-sponsor.ts +0 -18
  10. package/bin/streamr-internal-token-mint.ts +0 -21
  11. package/bin/streamr-internal-visualize-topology.ts +0 -122
  12. package/bin/streamr-internal.ts +0 -18
  13. package/bin/streamr-mock-data-generate.ts +0 -51
  14. package/bin/streamr-mock-data.ts +0 -10
  15. package/bin/streamr-storage-node-add-stream.ts +0 -13
  16. package/bin/streamr-storage-node-list-streams.ts +0 -21
  17. package/bin/streamr-storage-node-list.ts +0 -23
  18. package/bin/streamr-storage-node-register.ts +0 -14
  19. package/bin/streamr-storage-node-remove-stream.ts +0 -13
  20. package/bin/streamr-storage-node-show.ts +0 -13
  21. package/bin/streamr-storage-node-unregister.ts +0 -11
  22. package/bin/streamr-storage-node.ts +0 -16
  23. package/bin/streamr-stream-create.ts +0 -30
  24. package/bin/streamr-stream-grant-permission.ts +0 -10
  25. package/bin/streamr-stream-publish.ts +0 -78
  26. package/bin/streamr-stream-resend-from.ts +0 -33
  27. package/bin/streamr-stream-resend-last.ts +0 -31
  28. package/bin/streamr-stream-resend-range.ts +0 -39
  29. package/bin/streamr-stream-resend.ts +0 -12
  30. package/bin/streamr-stream-revoke-permission.ts +0 -10
  31. package/bin/streamr-stream-search.ts +0 -62
  32. package/bin/streamr-stream-show.ts +0 -37
  33. package/bin/streamr-stream-subscribe.ts +0 -43
  34. package/bin/streamr-stream.ts +0 -17
  35. package/bin/streamr-wallet-whoami.ts +0 -11
  36. package/bin/streamr-wallet.ts +0 -10
  37. package/bin/streamr.ts +0 -14
  38. package/jest.config.ts +0 -1
  39. package/src/client.ts +0 -34
  40. package/src/command.ts +0 -53
  41. package/src/common.ts +0 -43
  42. package/src/config.ts +0 -56
  43. package/src/logLevel.ts +0 -9
  44. package/src/permission.ts +0 -53
  45. package/src/resend.ts +0 -37
  46. package/test/environment.test.ts +0 -32
  47. package/test/internal-operator.test.ts +0 -57
  48. package/test/internal-sponsorship-sponsor.test.ts +0 -28
  49. package/test/mock-data.test.ts +0 -33
  50. package/test/storage-node.test.ts +0 -62
  51. package/test/stream-create.test.ts +0 -26
  52. package/test/stream-permission.test.ts +0 -29
  53. package/test/stream-publish-subscribe.test.ts +0 -108
  54. package/test/stream-resend.test.ts +0 -66
  55. package/test/stream-search.test.ts +0 -24
  56. package/test/stream-show.test.ts +0 -31
  57. package/test/utils.ts +0 -86
  58. package/test/wallet.test.ts +0 -11
  59. package/tsconfig.json +0 -3
  60. package/tsconfig.node.json +0 -16
package/test/utils.ts DELETED
@@ -1,86 +0,0 @@
1
- import { Stream, StreamrClient } from '@streamr/sdk'
2
- import { collect, until } from '@streamr/utils'
3
- import { spawn } from 'child_process'
4
- import merge2 from 'merge2'
5
-
6
- export const DOCKER_DEV_STORAGE_NODE = '0xde1112f631486CfC759A50196853011528bC5FA0'
7
-
8
- export interface StartCommandOptions {
9
- privateKey?: string
10
- devEnvironment?: boolean
11
- inputLines?: string[]
12
- abortSignal?: AbortSignal
13
- }
14
-
15
- export const runCommand = async (commandLine: string, opts?: StartCommandOptions): Promise<string[]> => {
16
- const lines = startCommand(commandLine, opts)
17
- return await collect(lines)
18
- }
19
-
20
- export async function* startCommand(commandLine: string, opts?: StartCommandOptions): AsyncGenerator<string> {
21
- // TODO: --no-deprecation needed to get around deprecation warning for "punycode" in Node.js 22, remove when warning has gone away (NET-1409)
22
- const args: string[] = ['--no-deprecation', 'dist/bin/streamr.js']
23
- args.push(...commandLine.split(' '))
24
- if (opts?.privateKey !== undefined) {
25
- args.push('--private-key', opts.privateKey)
26
- }
27
- if (opts?.devEnvironment !== false) {
28
- args.push('--env', 'dev2')
29
- }
30
- const executable = spawn(`node`, args, {
31
- signal: opts?.abortSignal,
32
- env: {
33
- PATH: process.env.PATH,
34
- STREAMR_DOCKER_DEV_HOST: process.env.STREAMR_DOCKER_DEV_HOST
35
- }
36
- })
37
- executable.on('error', (err: any) => {
38
- // expected error when AbortSignal#abort is called
39
- if (err.code !== 'ABORT_ERR') {
40
- console.error(err)
41
- }
42
- })
43
- const outputs = merge2(executable.stdout, executable.stderr)
44
- if (opts?.inputLines !== undefined) {
45
- setImmediate(() => {
46
- executable.stdin.write(opts.inputLines!.join('\n') + '\n')
47
- })
48
- }
49
- yield* lines(outputs[Symbol.asyncIterator]())
50
- }
51
-
52
- async function* lines(src: AsyncIterable<Buffer>): AsyncGenerator<string, any, any> {
53
- let buffer = ''
54
- for await (const chunk of src) {
55
- buffer += chunk.toString()
56
- while (true) {
57
- const delimeterPos = buffer.indexOf('\n')
58
- if (delimeterPos === -1) {
59
- break
60
- }
61
- const line = buffer.substring(0, delimeterPos)
62
- yield line
63
- buffer = buffer.substring(delimeterPos + 1)
64
- }
65
- }
66
- if (buffer !== '') {
67
- yield buffer
68
- }
69
- }
70
-
71
- export const createTestClient = (privateKey?: string): StreamrClient => {
72
- return new StreamrClient({
73
- environment: 'dev2',
74
- auth: (privateKey !== undefined) ? { privateKey } : undefined
75
- })
76
- }
77
-
78
- export const waitForTheGraphToHaveIndexed = async (stream: Stream, client: StreamrClient): Promise<void> => {
79
- await until(async () => {
80
- // eslint-disable-next-line no-underscore-dangle
81
- for await (const _msg of client.searchStreams(stream.id, undefined)) {
82
- return true
83
- }
84
- return false
85
- }, 15 * 1000, 600)
86
- }
@@ -1,11 +0,0 @@
1
- import { runCommand } from './utils'
2
-
3
- describe('wallet', () => {
4
-
5
- it('whoami', async () => {
6
- const outputLines = await runCommand('wallet whoami')
7
- expect(outputLines.length).toBe(1)
8
- expect(outputLines[0]).toMatch(/^0x[0-9a-f]{40}$/)
9
- })
10
-
11
- })
package/tsconfig.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "./tsconfig.jest.json"
3
- }
@@ -1,16 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.node.json",
3
- "compilerOptions": {
4
- "composite": true,
5
- "outDir": "dist"
6
- },
7
- "include": [
8
- "package.json",
9
- "src/**/*",
10
- "bin/**/*"
11
- ],
12
- "references": [
13
- { "path": "../utils/tsconfig.node.json" },
14
- { "path": "../sdk/tsconfig.node.json" }
15
- ]
16
- }