@streamr/cli-tools 6.1.1 → 7.0.0-beta.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.
- package/.eslintrc +1 -1
- package/CHANGELOG.md +5 -15
- package/README.md +15 -7
- package/bin/streamr-governance-vote.ts +0 -1
- package/bin/streamr-mock-data-generate.ts +3 -14
- package/bin/{streamr-storage-node-list-stream-parts.ts → streamr-storage-node-list-streams.ts} +5 -7
- package/bin/streamr-storage-node-list.ts +1 -10
- package/bin/streamr-storage-node.ts +1 -1
- package/bin/streamr-stream-create.ts +2 -2
- package/bin/streamr-stream-publish.ts +3 -3
- package/bin/streamr-stream-resend-last.ts +1 -1
- package/bin/streamr-stream-resend.ts +1 -1
- package/bin/streamr-stream-search.ts +2 -2
- package/bin/streamr-stream-show.ts +2 -2
- package/dist/bin/streamr-governance-vote.js +0 -1
- package/dist/bin/streamr-governance-vote.js.map +1 -1
- package/dist/bin/streamr-mock-data-generate.js +3 -10
- package/dist/bin/streamr-mock-data-generate.js.map +1 -1
- package/dist/bin/{streamr-storage-node-list-stream-parts.d.ts → streamr-storage-node-list-streams.d.ts} +0 -0
- package/dist/bin/{streamr-storage-node-list-stream-parts.js → streamr-storage-node-list-streams.js} +6 -8
- package/dist/bin/streamr-storage-node-list-streams.js.map +1 -0
- package/dist/bin/streamr-storage-node-list.js +1 -10
- package/dist/bin/streamr-storage-node-list.js.map +1 -1
- package/dist/bin/streamr-storage-node.js +1 -1
- package/dist/bin/streamr-storage-node.js.map +1 -1
- package/dist/bin/streamr-stream-create.js +1 -1
- package/dist/bin/streamr-stream-create.js.map +1 -1
- package/dist/bin/streamr-stream-publish.js +3 -3
- package/dist/bin/streamr-stream-publish.js.map +1 -1
- package/dist/bin/streamr-stream-search.js +1 -1
- package/dist/bin/streamr-stream-search.js.map +1 -1
- package/dist/bin/streamr-stream-show.js +1 -1
- package/dist/bin/streamr-stream-show.js.map +1 -1
- package/dist/package.json +4 -12
- package/dist/src/client.js +1 -2
- package/dist/src/client.js.map +1 -1
- package/dist/src/command.d.ts +2 -2
- package/dist/src/config.d.ts +3 -3
- package/dist/src/config.js.map +1 -1
- package/dist/src/logLevel.js +1 -2
- package/dist/src/logLevel.js.map +1 -1
- package/dist/src/permission.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -12
- package/src/command.ts +3 -3
- package/src/common.ts +1 -1
- package/src/config.ts +5 -5
- package/src/logLevel.ts +1 -1
- package/src/permission.ts +2 -2
- package/src/resend.ts +1 -1
- package/tsconfig.json +2 -1
- package/dist/bin/streamr-storage-node-list-stream-parts.js.map +0 -1
package/.eslintrc
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -8,8 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
8
8
|
|
|
9
9
|
### Added
|
|
10
10
|
|
|
11
|
+
- Added command `governance vote` for casting votes on Streamr governance proposals
|
|
12
|
+
|
|
11
13
|
### Changed
|
|
12
14
|
|
|
15
|
+
- Replace command `storage-node list-stream-parts` with `storage-node list-streams` and change the output format
|
|
16
|
+
|
|
13
17
|
### Deprecated
|
|
14
18
|
|
|
15
19
|
### Removed
|
|
@@ -18,18 +22,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
18
22
|
|
|
19
23
|
### Security
|
|
20
24
|
|
|
21
|
-
## [6.1.1] - 2022-11-03
|
|
22
|
-
|
|
23
|
-
### Fixed
|
|
24
|
-
|
|
25
|
-
- Fix `streamr governance vote` command
|
|
26
|
-
|
|
27
|
-
## [6.1.0] - 2022-10-31
|
|
28
|
-
|
|
29
|
-
### Added
|
|
30
|
-
|
|
31
|
-
- Add command `streamr governance vote` for casting votes on Streamr governance proposals
|
|
32
|
-
|
|
33
25
|
## [6.0.0] - 2022-02-23
|
|
34
26
|
- Add new command `stream wallet whoami` to display Ethereum address
|
|
35
27
|
- (Breaking) `stream create` argument is a stream ID, not a name
|
|
@@ -117,9 +109,7 @@ ordering and gap filling.
|
|
|
117
109
|
- Bump dependency commander to ^4.0.1.
|
|
118
110
|
- Re-organize README.md and a few touches to Developing section paragraphs.
|
|
119
111
|
|
|
120
|
-
[Unreleased]: https://github.com/streamr-dev/network-monorepo/compare/cli-tools%2fv6.
|
|
121
|
-
[6.1.1]: https://github.com/streamr-dev/network-monorepo/compare/cli-tools%2fv6.1.0...cli-tools%2fv6.1.1
|
|
122
|
-
[6.1.0]: https://github.com/streamr-dev/network-monorepo/compare/cli-tools%2fv6.0.0...cli-tools%2fv6.1.0
|
|
112
|
+
[Unreleased]: https://github.com/streamr-dev/network-monorepo/compare/cli-tools%2fv6.0.0...HEAD
|
|
123
113
|
[6.0.0]: https://github.com/streamr-dev/network-monorepo/compare/cli-tools%2fv5.0.1...cli-tools%2fv6.0.0
|
|
124
114
|
[5.0.0]: https://github.com/streamr-dev/cli-tools/compare/v4.1.1...v5.0.0
|
|
125
115
|
[4.1.1]: https://github.com/streamr-dev/cli-tools/compare/v4.1.0...v4.1.1
|
package/README.md
CHANGED
|
@@ -18,6 +18,8 @@ See [Changelog](CHANGELOG.md) for version information and changes.
|
|
|
18
18
|
- [Contribute](#contribute)
|
|
19
19
|
|
|
20
20
|
## Install
|
|
21
|
+
| NodeJS version `16.13.x` and NPM version `8.x` is required |
|
|
22
|
+
| --- |
|
|
21
23
|
|
|
22
24
|
```
|
|
23
25
|
npm install -g @streamr/cli-tools
|
|
@@ -36,7 +38,7 @@ Run `streamr <command> <subcommand> --help` to get more information about a a co
|
|
|
36
38
|
|
|
37
39
|
If there is a stream parameter in a command, it can be defined as a full id (e.g. `0x1234567890123456789012345678901234567890/foo/bar`) or a path (e.g. `/foo/bar`). If path notation is used, the stream ID is made by prefixing the authenticated Ethereum address (`--private-key <key>`) to the path.
|
|
38
40
|
|
|
39
|
-
###
|
|
41
|
+
### Subscribe
|
|
40
42
|
Used to subscribe to a stream and output real-time JSON objects to stdout line-by-line.
|
|
41
43
|
|
|
42
44
|
For example, to subscribe to a public stream such as the tram demo do
|
|
@@ -50,7 +52,13 @@ To subscribe to a private stream and authenticate with an Ethereum private key:
|
|
|
50
52
|
streamr stream subscribe streamId --private-key <key>
|
|
51
53
|
```
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
To subscribe to a particular [stream partition](https://streamr.network/docs/streams/partitioning), use the partition flag:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
streamr stream subscribe streamId -p <partition_number>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Publish
|
|
54
62
|
Used to publish events to a stream from stdin line-by-line. Each line should be a valid JSON object.
|
|
55
63
|
|
|
56
64
|
Example of use:
|
|
@@ -59,7 +67,7 @@ streamr stream publish <streamId> --private-key <key>
|
|
|
59
67
|
```
|
|
60
68
|
|
|
61
69
|
|
|
62
|
-
###
|
|
70
|
+
### Generate
|
|
63
71
|
Generate random JSON objects to stdout line-by-line.
|
|
64
72
|
|
|
65
73
|
Useful for generating test data to be published to a stream with `publish`, e.g.:
|
|
@@ -67,7 +75,7 @@ Useful for generating test data to be published to a stream with `publish`, e.g.
|
|
|
67
75
|
streamr mock-data generate | streamr stream publish <streamId> --private-key <key>
|
|
68
76
|
```
|
|
69
77
|
|
|
70
|
-
###
|
|
78
|
+
### Search
|
|
71
79
|
Query a list of streams by a search term and/or permissions. E.g.:
|
|
72
80
|
```
|
|
73
81
|
streamr stream search foobar --user 0x1234567890123456789012345678901234567890
|
|
@@ -105,13 +113,13 @@ streamr stream search --user --public --all subscribe --private-key <key>
|
|
|
105
113
|
|
|
106
114
|
If more than one permission is needed, specify the permissions in a comma-separated list (e.g. `--all subscribe,publish`). It returns streams where _all_ listed permissions are granted. If just _any_ of the permissions is required, use `--any` instead of `--all`. Please prefer `--all` to `--any` when possible as it has better query performance.
|
|
107
115
|
|
|
108
|
-
###
|
|
116
|
+
### Show
|
|
109
117
|
Show detailed information about a specific stream
|
|
110
118
|
```
|
|
111
119
|
streamr stream show <streamId> --private-key <key>
|
|
112
120
|
```
|
|
113
121
|
|
|
114
|
-
###
|
|
122
|
+
### Create
|
|
115
123
|
Create a new stream
|
|
116
124
|
```
|
|
117
125
|
streamr stream create <streamId> --private-key <key>
|
|
@@ -124,7 +132,7 @@ streamr stream create yourdomain.ens/foobar
|
|
|
124
132
|
```
|
|
125
133
|
|
|
126
134
|
|
|
127
|
-
###
|
|
135
|
+
### Resend
|
|
128
136
|
Request a resend of historical data printed as JSON objects to stdout line-by-line.
|
|
129
137
|
|
|
130
138
|
For example, to fetch the 10 latest messages of a public stream such as the tram demo do
|
|
@@ -11,7 +11,6 @@ const vote = async (privateKey: string, proposal: string, choice: number) => {
|
|
|
11
11
|
const wallet = new Wallet(privateKey)
|
|
12
12
|
try {
|
|
13
13
|
console.log(`Wallet ${wallet.address} voting for choice ${choice} on proposal ${proposal}...`)
|
|
14
|
-
// @ts-expect-error Wallet import issue
|
|
15
14
|
await snapshotClient.vote(wallet, wallet.address, {
|
|
16
15
|
space: 'streamr.eth',
|
|
17
16
|
proposal,
|
|
@@ -2,22 +2,11 @@
|
|
|
2
2
|
import pkg from '../package.json'
|
|
3
3
|
import { createFnParseInt } from '../src/common'
|
|
4
4
|
import { createCommand } from '../src/command'
|
|
5
|
-
|
|
6
|
-
// From: https://stackoverflow.com/questions/10726909/random-alpha-numeric-string-in-javascript
|
|
7
|
-
function randomString(
|
|
8
|
-
length: number,
|
|
9
|
-
chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
|
10
|
-
): string {
|
|
11
|
-
let result = ''
|
|
12
|
-
for (let i = length; i > 0; --i) {
|
|
13
|
-
result += chars[Math.floor(Math.random() * chars.length)]
|
|
14
|
-
}
|
|
15
|
-
return result
|
|
16
|
-
}
|
|
5
|
+
import { randomString } from '@streamr/utils'
|
|
17
6
|
|
|
18
7
|
function genArray<T>(size: number, elementFn: () => T): T[] {
|
|
19
8
|
const arr = []
|
|
20
|
-
for (let i=0; i < size; ++i) {
|
|
9
|
+
for (let i = 0; i < size; ++i) {
|
|
21
10
|
arr.push(elementFn())
|
|
22
11
|
}
|
|
23
12
|
return arr
|
|
@@ -44,4 +33,4 @@ createCommand()
|
|
|
44
33
|
.action((options: any) => {
|
|
45
34
|
generate(options.rate)
|
|
46
35
|
})
|
|
47
|
-
.parse()
|
|
36
|
+
.parse()
|
package/bin/{streamr-storage-node-list-stream-parts.ts → streamr-storage-node-list-streams.ts}
RENAMED
|
@@ -3,16 +3,14 @@ import '../src/logLevel'
|
|
|
3
3
|
import EasyTable from 'easy-table'
|
|
4
4
|
import StreamrClient from 'streamr-client'
|
|
5
5
|
import { createClientCommand } from '../src/command'
|
|
6
|
-
import { StreamPartIDUtils } from 'streamr-client-protocol'
|
|
7
6
|
|
|
8
7
|
createClientCommand((async (client: StreamrClient, storageNodeAddress: string) => {
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
console.info(EasyTable.print(
|
|
12
|
-
const [streamId, streamPartition] = StreamPartIDUtils.getStreamIDAndPartition(streamPartId)
|
|
8
|
+
const { streams } = await client.getStoredStreams(storageNodeAddress)
|
|
9
|
+
if (streams.length > 0) {
|
|
10
|
+
console.info(EasyTable.print(streams.map((stream) => {
|
|
13
11
|
return {
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
id: stream.id,
|
|
13
|
+
partitions: stream.getMetadata().partitions
|
|
16
14
|
}
|
|
17
15
|
})))
|
|
18
16
|
}
|
|
@@ -4,18 +4,9 @@ import { StreamrClient } from 'streamr-client'
|
|
|
4
4
|
import EasyTable from 'easy-table'
|
|
5
5
|
import { createClientCommand } from '../src/command'
|
|
6
6
|
|
|
7
|
-
const getStorageNodes = async (streamId: string | undefined, client: StreamrClient): Promise<string[]> => {
|
|
8
|
-
if (streamId !== undefined) {
|
|
9
|
-
const stream = await client.getStream(streamId)
|
|
10
|
-
return stream.getStorageNodes()
|
|
11
|
-
} else {
|
|
12
|
-
return client.getAllStorageNodes()
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
7
|
createClientCommand(async (client: StreamrClient, options: any) => {
|
|
17
8
|
const streamId = options.stream
|
|
18
|
-
const addresses = await getStorageNodes(streamId
|
|
9
|
+
const addresses = await client.getStorageNodes(streamId)
|
|
19
10
|
if (addresses.length > 0) {
|
|
20
11
|
console.info(EasyTable.print(addresses.map((address: string) => ({
|
|
21
12
|
address
|
|
@@ -9,5 +9,5 @@ program
|
|
|
9
9
|
.command('list', 'list storage nodes')
|
|
10
10
|
.command('add-stream', 'add stream')
|
|
11
11
|
.command('remove-stream', 'remove stream')
|
|
12
|
-
.command('list-
|
|
12
|
+
.command('list-streams', 'list stream in a storage node')
|
|
13
13
|
.parse()
|
|
@@ -12,7 +12,7 @@ createClientCommand(async (client: StreamrClient, streamIdOrPath: string, option
|
|
|
12
12
|
partitions: options.partitions
|
|
13
13
|
}
|
|
14
14
|
const stream = await client.createStream(body)
|
|
15
|
-
console.info(
|
|
15
|
+
console.info({ id: stream.id, ...stream.getMetadata() }, null, 2)
|
|
16
16
|
})
|
|
17
17
|
.arguments('<streamId>')
|
|
18
18
|
.description('create a new stream')
|
|
@@ -20,4 +20,4 @@ createClientCommand(async (client: StreamrClient, streamIdOrPath: string, option
|
|
|
20
20
|
.option('-c, --stream-config <config>', 'define a configuration as JSON', (s: string) => JSON.parse(s))
|
|
21
21
|
.option('-p, --partitions <count>', 'define a partition count',
|
|
22
22
|
createFnParseInt('--partitions'))
|
|
23
|
-
.parseAsync()
|
|
23
|
+
.parseAsync()
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import '../src/logLevel'
|
|
3
3
|
import { Writable } from 'stream'
|
|
4
4
|
import { StreamrClient } from 'streamr-client'
|
|
5
|
-
import { wait } from 'streamr
|
|
5
|
+
import { wait } from '@streamr/utils'
|
|
6
6
|
import es from 'event-stream'
|
|
7
7
|
import { createClientCommand } from '../src/command'
|
|
8
8
|
|
|
@@ -28,7 +28,7 @@ const publishStream = (
|
|
|
28
28
|
return
|
|
29
29
|
}
|
|
30
30
|
const partitionKey = (partitionKeyField !== undefined) ? json[partitionKeyField] : undefined
|
|
31
|
-
client.publish(stream, json,
|
|
31
|
+
client.publish(stream, json, { partitionKey }).then(
|
|
32
32
|
() => done(),
|
|
33
33
|
(err) => done(err)
|
|
34
34
|
)
|
|
@@ -59,4 +59,4 @@ createClientCommand(async (client: StreamrClient, streamId: string, options: any
|
|
|
59
59
|
.arguments('<streamId>')
|
|
60
60
|
.description('publish to a stream by reading JSON messages from stdin line-by-line')
|
|
61
61
|
.option('-k, --partition-key-field <string>', 'field name in each message to use for assigning the message to a stream partition')
|
|
62
|
-
.parseAsync()
|
|
62
|
+
.parseAsync()
|
|
@@ -22,4 +22,4 @@ createClientCommand(async (client: StreamrClient, n: string, streamId: string, o
|
|
|
22
22
|
.description('request last N messages')
|
|
23
23
|
.option('-d, --disable-ordering', 'disable ordering of messages by OrderingUtil', false)
|
|
24
24
|
.option('-s, --subscribe', 'subscribe in addition to resend', false)
|
|
25
|
-
.parseAsync()
|
|
25
|
+
.parseAsync()
|
|
@@ -12,7 +12,7 @@ const createPermissionFilter = async (
|
|
|
12
12
|
allOf: StreamPermission[] | undefined,
|
|
13
13
|
anyOf: StreamPermission[] | undefined,
|
|
14
14
|
client: StreamrClient
|
|
15
|
-
): Promise<SearchStreamsPermissionFilter| undefined> => {
|
|
15
|
+
): Promise<SearchStreamsPermissionFilter | undefined> => {
|
|
16
16
|
if (user !== undefined) {
|
|
17
17
|
return {
|
|
18
18
|
user: (getOptionType(user) === OptionType.ARGUMENT) ? user as string : await client.getAddress(),
|
|
@@ -51,4 +51,4 @@ createClientCommand(async (client: StreamrClient, term: string | undefined, opti
|
|
|
51
51
|
.option('--public', 'the permission can be implicit (a public permission to the stream)')
|
|
52
52
|
.addOption(createPermissionListOption('all'))
|
|
53
53
|
.addOption(createPermissionListOption('any'))
|
|
54
|
-
.parseAsync()
|
|
54
|
+
.parseAsync()
|
|
@@ -6,7 +6,7 @@ import { getPermissionId } from '../src/permission'
|
|
|
6
6
|
|
|
7
7
|
createClientCommand(async (client: StreamrClient, streamId: string, options: any) => {
|
|
8
8
|
const stream = await client.getStream(streamId)
|
|
9
|
-
const obj: any = stream.
|
|
9
|
+
const obj: any = { id: stream.id, ...stream.getMetadata() }
|
|
10
10
|
if (options.includePermissions) {
|
|
11
11
|
const assigments = await stream.getPermissions()
|
|
12
12
|
obj.permissions = assigments.map((assignment) => {
|
|
@@ -21,4 +21,4 @@ createClientCommand(async (client: StreamrClient, streamId: string, options: any
|
|
|
21
21
|
.arguments('<streamId>')
|
|
22
22
|
.description('show detailed information about a stream')
|
|
23
23
|
.option('--include-permissions', 'include list of permissions')
|
|
24
|
-
.parseAsync()
|
|
24
|
+
.parseAsync()
|
|
@@ -14,7 +14,6 @@ const vote = async (privateKey, proposal, choice) => {
|
|
|
14
14
|
const wallet = new wallet_1.Wallet(privateKey);
|
|
15
15
|
try {
|
|
16
16
|
console.log(`Wallet ${wallet.address} voting for choice ${choice} on proposal ${proposal}...`);
|
|
17
|
-
// @ts-expect-error Wallet import issue
|
|
18
17
|
await snapshotClient.vote(wallet, wallet.address, {
|
|
19
18
|
space: 'streamr.eth',
|
|
20
19
|
proposal,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamr-governance-vote.js","sourceRoot":"","sources":["../../bin/streamr-governance-vote.ts"],"names":[],"mappings":";;;;;;AACA,4CAA8C;AAC9C,0CAA+C;AAC/C,6EAAiD;AACjD,kDAA8C;AAE9C,MAAM,GAAG,GAAG,0BAA0B,CAAA;AACtC,MAAM,cAAc,GAAG,IAAI,qBAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;AAElD,MAAM,IAAI,GAAG,KAAK,EAAE,UAAkB,EAAE,QAAgB,EAAE,MAAc,EAAE,EAAE;IACxE,MAAM,MAAM,GAAG,IAAI,eAAM,CAAC,UAAU,CAAC,CAAA;IACrC,IAAI;QACA,OAAO,CAAC,GAAG,CAA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F,MAAM,CAAC,KAAK,EAAE,UAAkB,EAAE,QAAgB,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IACrE,MAAM,MAAM,GAAG,IAAA,wBAAe,EAAC,OAAO,CAAC,CAAA;IACvC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE;QACzC,OAAO,CAAC,KAAK,CAAC,0FAA0F,CAAC,CAAA;QACzG,OAAO,CAAC,IAAI,EAAE,CAAA;QACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KAClB;IAED,MAAM,gBAAgB,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAC3C,IAAI,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,gBAAgB,IAAI,CAAC,EAAE;QACzD,OAAO,CAAC,KAAK,CAAC,0BAA0B,QAAQ,kDAAkD,CAAC,CAAA;QACnG,OAAO,CAAC,IAAI,EAAE,CAAA;QACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KAClB;IAED,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAA;AACpE,CAAC,CAAC;KACD,UAAU,EAAE,CAAA"}
|
|
@@ -8,14 +8,7 @@ exports.generate = void 0;
|
|
|
8
8
|
const package_json_1 = __importDefault(require("../package.json"));
|
|
9
9
|
const common_1 = require("../src/common");
|
|
10
10
|
const command_1 = require("../src/command");
|
|
11
|
-
|
|
12
|
-
function randomString(length, chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') {
|
|
13
|
-
let result = '';
|
|
14
|
-
for (let i = length; i > 0; --i) {
|
|
15
|
-
result += chars[Math.floor(Math.random() * chars.length)];
|
|
16
|
-
}
|
|
17
|
-
return result;
|
|
18
|
-
}
|
|
11
|
+
const utils_1 = require("@streamr/utils");
|
|
19
12
|
function genArray(size, elementFn) {
|
|
20
13
|
const arr = [];
|
|
21
14
|
for (let i = 0; i < size; ++i) {
|
|
@@ -26,11 +19,11 @@ function genArray(size, elementFn) {
|
|
|
26
19
|
const generate = (rate) => {
|
|
27
20
|
setInterval(() => {
|
|
28
21
|
console.info(JSON.stringify({
|
|
29
|
-
someText: randomString(64),
|
|
22
|
+
someText: (0, utils_1.randomString)(64),
|
|
30
23
|
aNumber: Math.random() * 10000,
|
|
31
24
|
bNumber: Math.random(),
|
|
32
25
|
yesOrNo: Math.random() > 0.5,
|
|
33
|
-
arrayOfStrings: genArray(Math.floor(Math.random() * 20), () => randomString(8)),
|
|
26
|
+
arrayOfStrings: genArray(Math.floor(Math.random() * 20), () => (0, utils_1.randomString)(8)),
|
|
34
27
|
arrayOfIntegers: genArray(Math.floor(Math.random() * 10), () => Math.floor(Math.random() * 100))
|
|
35
28
|
}));
|
|
36
29
|
}, rate);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamr-mock-data-generate.js","sourceRoot":"","sources":["../../bin/streamr-mock-data-generate.ts"],"names":[],"mappings":";;;;;;;AACA,mEAAiC;AACjC,0CAAgD;AAChD,4CAA8C;
|
|
1
|
+
{"version":3,"file":"streamr-mock-data-generate.js","sourceRoot":"","sources":["../../bin/streamr-mock-data-generate.ts"],"names":[],"mappings":";;;;;;;AACA,mEAAiC;AACjC,0CAAgD;AAChD,4CAA8C;AAC9C,0CAA6C;AAE7C,SAAS,QAAQ,CAAI,IAAY,EAAE,SAAkB;IACjD,MAAM,GAAG,GAAG,EAAE,CAAA;IACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;QAC3B,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAA;KACxB;IACD,OAAO,GAAG,CAAA;AACd,CAAC;AAEM,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAQ,EAAE;IAC3C,WAAW,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;YACxB,QAAQ,EAAE,IAAA,oBAAY,EAAC,EAAE,CAAC;YAC1B,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK;YAC9B,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE;YACtB,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG;YAC5B,cAAc,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,IAAA,oBAAY,EAAC,CAAC,CAAC,CAAC;YAC/E,eAAe,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC;SAEnG,CAAC,CAAC,CAAA;IACP,CAAC,EAAE,IAAI,CAAC,CAAA;AACZ,CAAC,CAAA;AAZY,QAAA,QAAQ,YAYpB;AAED,IAAA,uBAAa,GAAE;KACV,WAAW,CAAC,oDAAoD,CAAC;KACjE,MAAM,CAAC,gBAAgB,EAAE,sBAAsB,EAAE,IAAA,yBAAgB,EAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;KACjF,OAAO,CAAC,sBAAG,CAAC,OAAO,CAAC;KACpB,MAAM,CAAC,CAAC,OAAY,EAAE,EAAE;IACrB,IAAA,gBAAQ,EAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AAC1B,CAAC,CAAC;KACD,KAAK,EAAE,CAAA"}
|
|
File without changes
|
package/dist/bin/{streamr-storage-node-list-stream-parts.js → streamr-storage-node-list-streams.js}
RENAMED
|
@@ -7,15 +7,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
require("../src/logLevel");
|
|
8
8
|
const easy_table_1 = __importDefault(require("easy-table"));
|
|
9
9
|
const command_1 = require("../src/command");
|
|
10
|
-
const streamr_client_protocol_1 = require("streamr-client-protocol");
|
|
11
10
|
(0, command_1.createClientCommand)((async (client, storageNodeAddress) => {
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
14
|
-
console.info(easy_table_1.default.print(
|
|
15
|
-
const [streamId, streamPartition] = streamr_client_protocol_1.StreamPartIDUtils.getStreamIDAndPartition(streamPartId);
|
|
11
|
+
const { streams } = await client.getStoredStreams(storageNodeAddress);
|
|
12
|
+
if (streams.length > 0) {
|
|
13
|
+
console.info(easy_table_1.default.print(streams.map((stream) => {
|
|
16
14
|
return {
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
id: stream.id,
|
|
16
|
+
partitions: stream.getMetadata().partitions
|
|
19
17
|
};
|
|
20
18
|
})));
|
|
21
19
|
}
|
|
@@ -23,4 +21,4 @@ const streamr_client_protocol_1 = require("streamr-client-protocol");
|
|
|
23
21
|
.arguments('<storageNodeAddress>')
|
|
24
22
|
.description('list stream parts in a storage node')
|
|
25
23
|
.parseAsync();
|
|
26
|
-
//# sourceMappingURL=streamr-storage-node-list-
|
|
24
|
+
//# sourceMappingURL=streamr-storage-node-list-streams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamr-storage-node-list-streams.js","sourceRoot":"","sources":["../../bin/streamr-storage-node-list-streams.ts"],"names":[],"mappings":";;;;;;AACA,2BAAwB;AACxB,4DAAkC;AAElC,4CAAoD;AAEpD,IAAA,6BAAmB,EAAC,CAAC,KAAK,EAAE,MAAqB,EAAE,kBAA0B,EAAE,EAAE;IAC7E,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAA;IACrE,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;QACpB,OAAO,CAAC,IAAI,CAAC,oBAAS,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YAChD,OAAO;gBACH,EAAE,EAAE,MAAM,CAAC,EAAE;gBACb,UAAU,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC,UAAU;aAC9C,CAAA;QACL,CAAC,CAAC,CAAC,CAAC,CAAA;KACP;AACL,CAAC,CAAC,CAAC;KACE,SAAS,CAAC,sBAAsB,CAAC;KACjC,WAAW,CAAC,qCAAqC,CAAC;KAClD,UAAU,EAAE,CAAA"}
|
|
@@ -7,18 +7,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
require("../src/logLevel");
|
|
8
8
|
const easy_table_1 = __importDefault(require("easy-table"));
|
|
9
9
|
const command_1 = require("../src/command");
|
|
10
|
-
const getStorageNodes = async (streamId, client) => {
|
|
11
|
-
if (streamId !== undefined) {
|
|
12
|
-
const stream = await client.getStream(streamId);
|
|
13
|
-
return stream.getStorageNodes();
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
return client.getAllStorageNodes();
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
10
|
(0, command_1.createClientCommand)(async (client, options) => {
|
|
20
11
|
const streamId = options.stream;
|
|
21
|
-
const addresses = await getStorageNodes(streamId
|
|
12
|
+
const addresses = await client.getStorageNodes(streamId);
|
|
22
13
|
if (addresses.length > 0) {
|
|
23
14
|
console.info(easy_table_1.default.print(addresses.map((address) => ({
|
|
24
15
|
address
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamr-storage-node-list.js","sourceRoot":"","sources":["../../bin/streamr-storage-node-list.ts"],"names":[],"mappings":";;;;;;AACA,2BAAwB;AAExB,4DAAkC;AAClC,4CAAoD;AAEpD,
|
|
1
|
+
{"version":3,"file":"streamr-storage-node-list.js","sourceRoot":"","sources":["../../bin/streamr-storage-node-list.ts"],"names":[],"mappings":";;;;;;AACA,2BAAwB;AAExB,4DAAkC;AAClC,4CAAoD;AAEpD,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,OAAY,EAAE,EAAE;IAC9D,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAA;IAC/B,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAA;IACxD,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;QACtB,OAAO,CAAC,IAAI,CAAC,oBAAS,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,OAAe,EAAE,EAAE,CAAC,CAAC;YAC7D,OAAO;SACV,CAAC,CAAC,CAAC,CAAC,CAAA;KACR;AACL,CAAC,CAAC;KACG,WAAW,CAAC,+BAA+B,CAAC;KAC5C,MAAM,CAAC,yBAAyB,EAAE,wEAAwE,CAAC;KAC3G,UAAU,EAAE,CAAA"}
|
|
@@ -13,6 +13,6 @@ commander_1.program
|
|
|
13
13
|
.command('list', 'list storage nodes')
|
|
14
14
|
.command('add-stream', 'add stream')
|
|
15
15
|
.command('remove-stream', 'remove stream')
|
|
16
|
-
.command('list-
|
|
16
|
+
.command('list-streams', 'list stream in a storage node')
|
|
17
17
|
.parse();
|
|
18
18
|
//# sourceMappingURL=streamr-storage-node.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamr-storage-node.js","sourceRoot":"","sources":["../../bin/streamr-storage-node.ts"],"names":[],"mappings":";;;;;;AACA,yCAAmC;AACnC,mEAAiC;AAEjC,mBAAO;KACF,OAAO,CAAC,sBAAG,CAAC,OAAO,CAAC;KACpB,KAAK,CAAC,oBAAoB,CAAC;KAC3B,WAAW,CAAC,0BAA0B,CAAC;KACvC,OAAO,CAAC,MAAM,EAAE,oBAAoB,CAAC;KACrC,OAAO,CAAC,YAAY,EAAE,YAAY,CAAC;KACnC,OAAO,CAAC,eAAe,EAAE,eAAe,CAAC;KACzC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"streamr-storage-node.js","sourceRoot":"","sources":["../../bin/streamr-storage-node.ts"],"names":[],"mappings":";;;;;;AACA,yCAAmC;AACnC,mEAAiC;AAEjC,mBAAO;KACF,OAAO,CAAC,sBAAG,CAAC,OAAO,CAAC;KACpB,KAAK,CAAC,oBAAoB,CAAC;KAC3B,WAAW,CAAC,0BAA0B,CAAC;KACvC,OAAO,CAAC,MAAM,EAAE,oBAAoB,CAAC;KACrC,OAAO,CAAC,YAAY,EAAE,YAAY,CAAC;KACnC,OAAO,CAAC,eAAe,EAAE,eAAe,CAAC;KACzC,OAAO,CAAC,cAAc,EAAE,+BAA+B,CAAC;KACxD,KAAK,EAAE,CAAA"}
|
|
@@ -12,7 +12,7 @@ const command_1 = require("../src/command");
|
|
|
12
12
|
partitions: options.partitions
|
|
13
13
|
};
|
|
14
14
|
const stream = await client.createStream(body);
|
|
15
|
-
console.info(
|
|
15
|
+
console.info({ id: stream.id, ...stream.getMetadata() }, null, 2);
|
|
16
16
|
})
|
|
17
17
|
.arguments('<streamId>')
|
|
18
18
|
.description('create a new stream')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamr-stream-create.js","sourceRoot":"","sources":["../../bin/streamr-stream-create.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,0CAAgD;AAChD,4CAAoD;AAEpD,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,cAAsB,EAAE,OAAY,EAAE,EAAE;IACtF,MAAM,IAAI,GAAQ;QACd,EAAE,EAAE,cAAc;QAClB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,MAAM,EAAE,OAAO,CAAC,YAAY;QAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;KACjC,CAAA;IACD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;IAC9C,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"streamr-stream-create.js","sourceRoot":"","sources":["../../bin/streamr-stream-create.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,0CAAgD;AAChD,4CAAoD;AAEpD,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,cAAsB,EAAE,OAAY,EAAE,EAAE;IACtF,MAAM,IAAI,GAAQ;QACd,EAAE,EAAE,cAAc;QAClB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,MAAM,EAAE,OAAO,CAAC,YAAY;QAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;KACjC,CAAA;IACD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;IAC9C,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,MAAM,CAAC,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AACrE,CAAC,CAAC;KACG,SAAS,CAAC,YAAY,CAAC;KACvB,WAAW,CAAC,qBAAqB,CAAC;KAClC,MAAM,CAAC,iCAAiC,EAAE,sBAAsB,CAAC;KACjE,MAAM,CAAC,8BAA8B,EAAE,gCAAgC,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACtG,MAAM,CAAC,0BAA0B,EAAE,0BAA0B,EAC1D,IAAA,yBAAgB,EAAC,cAAc,CAAC,CAAC;KACpC,UAAU,EAAE,CAAA"}
|
|
@@ -6,7 +6,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
require("../src/logLevel");
|
|
8
8
|
const stream_1 = require("stream");
|
|
9
|
-
const
|
|
9
|
+
const utils_1 = require("@streamr/utils");
|
|
10
10
|
const event_stream_1 = __importDefault(require("event-stream"));
|
|
11
11
|
const command_1 = require("../src/command");
|
|
12
12
|
const publishStream = (stream, partitionKeyField, client) => {
|
|
@@ -28,7 +28,7 @@ const publishStream = (stream, partitionKeyField, client) => {
|
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
const partitionKey = (partitionKeyField !== undefined) ? json[partitionKeyField] : undefined;
|
|
31
|
-
client.publish(stream, json,
|
|
31
|
+
client.publish(stream, json, { partitionKey }).then(() => done(), (err) => done(err));
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
return writable;
|
|
@@ -46,7 +46,7 @@ const publishStream = (stream, partitionKeyField, client) => {
|
|
|
46
46
|
// the message is put to the propagation queue (activeTaskStore.add call in
|
|
47
47
|
// network Propagation.ts:59) and the client.publish() promise resolves immeditatelly.
|
|
48
48
|
// TODO Remove this wait when NET-604 has been resolved
|
|
49
|
-
await (0,
|
|
49
|
+
await (0, utils_1.wait)(2000);
|
|
50
50
|
resolve(undefined);
|
|
51
51
|
})
|
|
52
52
|
.once('error', (err) => reject(err));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamr-stream-publish.js","sourceRoot":"","sources":["../../bin/streamr-stream-publish.ts"],"names":[],"mappings":";;;;;;AACA,2BAAwB;AACxB,mCAAiC;AAEjC,
|
|
1
|
+
{"version":3,"file":"streamr-stream-publish.js","sourceRoot":"","sources":["../../bin/streamr-stream-publish.ts"],"names":[],"mappings":";;;;;;AACA,2BAAwB;AACxB,mCAAiC;AAEjC,0CAAqC;AACrC,gEAA6B;AAC7B,4CAAoD;AAEpD,MAAM,aAAa,GAAG,CAClB,MAAc,EACd,iBAAqC,EACrC,MAAqB,EACb,EAAE;IACV,MAAM,QAAQ,GAAG,IAAI,iBAAQ,CAAC;QAC1B,UAAU,EAAE,IAAI;QAChB,KAAK,EAAE,CAAC,IAAS,EAAE,CAAM,EAAE,IAAS,EAAE,EAAE;YACpC,IAAI,IAAI,GAAG,IAAI,CAAA;YACf,uBAAuB;YACvB,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;gBACrC,IAAI,EAAE,CAAA;gBACN,OAAM;aACT;YACD,IAAI;gBACA,IAAI,GA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,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAE,CAAA;IAClD,CAAC,CAAC,CAAA;AACN,CAAC,CAAC;KACG,SAAS,CAAC,YAAY,CAAC;KACvB,WAAW,CAAC,sEAAsE,CAAC;KACnF,MAAM,CAAC,oCAAoC,EAAE,mFAAmF,CAAC;KACjI,UAAU,EAAE,CAAA"}
|
|
@@ -10,7 +10,7 @@ const createPermissionFilter = async (user, allowPublic, allOf, anyOf, client) =
|
|
|
10
10
|
if (user !== undefined) {
|
|
11
11
|
return {
|
|
12
12
|
user: ((0, common_1.getOptionType)(user) === common_1.OptionType.ARGUMENT) ? user : await client.getAddress(),
|
|
13
|
-
allowPublic: allowPublic
|
|
13
|
+
allowPublic: allowPublic ?? false,
|
|
14
14
|
allOf,
|
|
15
15
|
anyOf
|
|
16
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamr-stream-search.js","sourceRoot":"","sources":["../../bin/streamr-stream-search.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,4CAAoD;AACpD,yCAAkC;AAClC,kDAA8D;AAC9D,0CAAyD;AAEzD,MAAM,sBAAsB,GAAG,KAAK,EAChC,IAAkC,EAClC,WAAgC,EAChC,KAAqC,EACrC,KAAqC,EACrC,MAAqB,
|
|
1
|
+
{"version":3,"file":"streamr-stream-search.js","sourceRoot":"","sources":["../../bin/streamr-stream-search.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,4CAAoD;AACpD,yCAAkC;AAClC,kDAA8D;AAC9D,0CAAyD;AAEzD,MAAM,sBAAsB,GAAG,KAAK,EAChC,IAAkC,EAClC,WAAgC,EAChC,KAAqC,EACrC,KAAqC,EACrC,MAAqB,EAC6B,EAAE;IACpD,IAAI,IAAI,KAAK,SAAS,EAAE;QACpB,OAAO;YACH,IAAI,EAAE,CAAC,IAAA,sBAAa,EAAC,IAAI,CAAC,KAAK,mBAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAA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SAAS,CAAC,QAAQ,CAAC;KACnB,WAAW,CAAC,gBAAgB,CAAC;KAC7B,MAAM,CAAC,eAAe,EAAE,uFAAuF,CAAC;KAChH,MAAM,CAAC,UAAU,EAAE,oEAAoE,CAAC;KACxF,SAAS,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;KAC5C,SAAS,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;KAC5C,UAAU,EAAE,CAAA"}
|
|
@@ -6,7 +6,7 @@ const command_1 = require("../src/command");
|
|
|
6
6
|
const permission_1 = require("../src/permission");
|
|
7
7
|
(0, command_1.createClientCommand)(async (client, streamId, options) => {
|
|
8
8
|
const stream = await client.getStream(streamId);
|
|
9
|
-
const obj = stream.
|
|
9
|
+
const obj = { id: stream.id, ...stream.getMetadata() };
|
|
10
10
|
if (options.includePermissions) {
|
|
11
11
|
const assigments = await stream.getPermissions();
|
|
12
12
|
obj.permissions = assigments.map((assignment) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamr-stream-show.js","sourceRoot":"","sources":["../../bin/streamr-stream-show.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,4CAAoD;AACpD,kDAAmD;AAEnD,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,QAAgB,EAAE,OAAY,EAAE,EAAE;IAChF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;IAC/C,MAAM,GAAG,GAAQ,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"streamr-stream-show.js","sourceRoot":"","sources":["../../bin/streamr-stream-show.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,4CAAoD;AACpD,kDAAmD;AAEnD,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,QAAgB,EAAE,OAAY,EAAE,EAAE;IAChF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;IAC/C,MAAM,GAAG,GAAQ,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,MAAM,CAAC,WAAW,EAAE,EAAE,CAAA;IAC3D,IAAI,OAAO,CAAC,kBAAkB,EAAE;QAC5B,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,cAAc,EAAE,CAAA;QAChD,GAAG,CAAC,WAAW,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;YAC5C,OAAO;gBACH,GAAG,UAAU;gBACb,WAAW,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,4BAAe,CAAC;aAC3D,CAAA;QACL,CAAC,CAAC,CAAA;KACL;IACD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;AAC9C,CAAC,CAAC;KACG,SAAS,CAAC,YAAY,CAAC;KACvB,WAAW,CAAC,0CAA0C,CAAC;KACvD,MAAM,CAAC,uBAAuB,EAAE,6BAA6B,CAAC;KAC9D,UAAU,EAAE,CAAA"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamr/cli-tools",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-beta.1",
|
|
4
4
|
"description": "Command line tools for Streamr.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"streamr": "dist/bin/streamr.js"
|
|
@@ -32,24 +32,16 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@ethersproject/wallet": "^5.5.0",
|
|
34
34
|
"@snapshot-labs/snapshot.js": "^0.4.43",
|
|
35
|
+
"@streamr/utils": "7.0.0-beta.1",
|
|
35
36
|
"commander": "^8.3.0",
|
|
36
37
|
"easy-table": "^1.1.1",
|
|
37
38
|
"event-stream": "^4.0.1",
|
|
38
39
|
"lodash": "^4.17.21",
|
|
39
|
-
"streamr-client": "
|
|
40
|
-
"streamr-client-protocol": "^12.0.0",
|
|
41
|
-
"streamr-test-utils": "^2.0.0"
|
|
40
|
+
"streamr-client": "7.0.0-beta.1"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
44
|
-
"@streamr/dev-config": "^1.0.0",
|
|
45
43
|
"@types/easy-table": "0.0.32",
|
|
46
44
|
"@types/event-stream": "^3.3.34",
|
|
47
|
-
"@types/lodash": "^4.14.175"
|
|
48
|
-
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
49
|
-
"@typescript-eslint/parser": "^5.0.0",
|
|
50
|
-
"eslint": "^7.32.0",
|
|
51
|
-
"eslint-config-streamr-ts": "^4.0.1",
|
|
52
|
-
"eslint-plugin-promise": "^5.1.0",
|
|
53
|
-
"typescript": "^4.5.2"
|
|
45
|
+
"@types/lodash": "^4.14.175"
|
|
54
46
|
}
|
|
55
47
|
}
|
package/dist/src/client.js
CHANGED
|
@@ -5,9 +5,8 @@ const lodash_1 = require("lodash");
|
|
|
5
5
|
const streamr_client_1 = require("streamr-client");
|
|
6
6
|
const config_1 = require("./config");
|
|
7
7
|
const getClientConfig = (commandLineArgs, overridenOptions = {}) => {
|
|
8
|
-
var _a;
|
|
9
8
|
const environmentOptions = (commandLineArgs.dev !== undefined) ? (0, lodash_1.omit)(streamr_client_1.ConfigTest, 'auth') : undefined;
|
|
10
|
-
const configFileJson = (
|
|
9
|
+
const configFileJson = (0, config_1.getConfig)(commandLineArgs.config)?.client;
|
|
11
10
|
const authenticationOptions = (commandLineArgs.privateKey !== undefined) ? { auth: { privateKey: commandLineArgs.privateKey } } : undefined;
|
|
12
11
|
return (0, lodash_1.merge)(environmentOptions, configFileJson, authenticationOptions, overridenOptions);
|
|
13
12
|
};
|
package/dist/src/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AACpC,mDAA+E;AAE/E,qCAAoC;AAE7B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AAC,CAAA;IACjE,MAAM,MAAM,GAAG,IAAI,8BAAa,CAAC,MAAM,CAAC,CAAA;IACxC,mBAAmB,CAAC,MAAM,CAAC,CAAA;IAC3B,OAAO,MAAM,CAAA;AACjB,CAAC,CAAA;AALY,QAAA,YAAY,gBAKxB"}
|
package/dist/src/command.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import commander, { Command } from 'commander';
|
|
2
|
-
import {
|
|
2
|
+
import { StreamrClientConfig } from 'streamr-client';
|
|
3
3
|
export declare const createCommand: () => commander.Command;
|
|
4
4
|
export interface CommandOpts {
|
|
5
5
|
autoDestroyClient?: boolean;
|
|
6
|
-
clientOptionsFactory?: (options: any) =>
|
|
6
|
+
clientOptionsFactory?: (options: any) => StreamrClientConfig;
|
|
7
7
|
}
|
|
8
8
|
export declare const createClientCommand: (action: (...handleArgs: any[]) => Promise<void>, opts?: CommandOpts) => commander.Command;
|
package/dist/src/config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StreamrClientConfig } from 'streamr-client';
|
|
2
2
|
interface Config {
|
|
3
|
-
client:
|
|
3
|
+
client: StreamrClientConfig;
|
|
4
4
|
}
|
|
5
|
-
export declare const getConfig: (id?: string
|
|
5
|
+
export declare const getConfig: (id?: string) => Config | undefined;
|
|
6
6
|
export {};
|