@streamr/cli-tools 6.0.2 → 7.0.0-beta.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.
- package/.eslintrc +1 -1
- package/CHANGELOG.md +24 -4
- package/README.md +15 -7
- 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 +1 -1
- 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 +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.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-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/package.json +5 -13
- package/dist/src/client.d.ts +2 -2
- package/dist/src/client.js +4 -3
- 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 +5 -13
- package/src/client.ts +7 -5
- 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.d.ts +0 -2
- package/dist/bin/streamr-storage-node-list-stream-parts.js +0 -26
- package/dist/bin/streamr-storage-node-list-stream-parts.js.map +0 -1
- package/dist/bin/streamr-whoami.d.ts +0 -2
- package/dist/bin/streamr-whoami.js +0 -11
- package/dist/bin/streamr-whoami.js.map +0 -1
package/.eslintrc
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -5,10 +5,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Replace command `storage-node list-stream-parts` with `storage-node list-streams` and change the output format
|
|
14
|
+
|
|
15
|
+
### Deprecated
|
|
16
|
+
|
|
17
|
+
### Removed
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
### Security
|
|
22
|
+
|
|
23
|
+
## [6.0.0] - 2022-02-23
|
|
8
24
|
- Add new command `stream wallet whoami` to display Ethereum address
|
|
9
|
-
- Add permission commands: `stream grant-permission` and `stream revoke-permission`
|
|
10
|
-
- Remove `typescript` and `ts-node` as run-time dependencies
|
|
11
|
-
- (Breaking) Remove `--msg-chain-id` parameter from `stream resend from`
|
|
12
25
|
- (Breaking) `stream create` argument is a stream ID, not a name
|
|
13
26
|
- Support path notation when defining a stream ID
|
|
14
27
|
- (Breaking) Remove `misc get-session-token` command
|
|
@@ -28,6 +41,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
28
41
|
- Bump dependency streamr-client to 6.1.0
|
|
29
42
|
- Bump dependency commander to 8.3.0
|
|
30
43
|
|
|
44
|
+
## 5.0.1 - 2021-06-04
|
|
45
|
+
|
|
46
|
+
- Add permission commands: `stream grant-permission` and `stream revoke-permission`
|
|
47
|
+
- Remove `typescript` and `ts-node` as run-time dependencies
|
|
48
|
+
- (Breaking) Remove `--msg-chain-id` parameter from `stream resend from`
|
|
49
|
+
|
|
31
50
|
## [5.0.0] - 2021-05-05
|
|
32
51
|
### Added
|
|
33
52
|
- Add storage node commands under `streamr storage-node`
|
|
@@ -88,7 +107,8 @@ ordering and gap filling.
|
|
|
88
107
|
- Bump dependency commander to ^4.0.1.
|
|
89
108
|
- Re-organize README.md and a few touches to Developing section paragraphs.
|
|
90
109
|
|
|
91
|
-
[Unreleased]: https://github.com/streamr-dev/
|
|
110
|
+
[Unreleased]: https://github.com/streamr-dev/network-monorepo/compare/cli-tools%2fv6.0.0...HEAD
|
|
111
|
+
[6.0.0]: https://github.com/streamr-dev/network-monorepo/compare/cli-tools%2fv5.0.1...cli-tools%2fv6.0.0
|
|
92
112
|
[5.0.0]: https://github.com/streamr-dev/cli-tools/compare/v4.1.1...v5.0.0
|
|
93
113
|
[4.1.1]: https://github.com/streamr-dev/cli-tools/compare/v4.1.0...v4.1.1
|
|
94
114
|
[4.1.0]: https://github.com/streamr-dev/cli-tools/compare/v4.0.0...v4.1.0
|
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
|
|
@@ -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.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()
|
|
@@ -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()
|
|
@@ -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()
|
|
@@ -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,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Module", { 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"}
|
|
@@ -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;A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AO,EAAE,MAAM,EAAE,EAAE;QACnC,OAAO,CAAC,KAAK;aACR,IAAI,CAAC,sBAAE,CAAC,KAAK,EAAE,CAAC;aAChB,IAAI,CAAC,EAAE,CAAC;aACR,IAAI,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;YACvB,iFAAiF;YACjF,2EAA2E;YAC3E,iFAAiF;YACjF,2EAA2E;YAC3E,sFAAsF;YACtF,uDAAuD;YACvD,MAAM,IAAA,YAAI,EAAC,IAAI,CAAC,CAAA;YAChB,OAAO,CAAC,SAAS,CAAC,CAAA;QACtB,CAAC,CAAC;aACD,IAAI,CAAC,OAAO,EAAE,CAAC,GAAQ,EAAE,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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EAAE,IAAwB,EAAE,OAAY,EAAG,EAAE;IACzF,MAAM,gBAAgB,GAAG,MAAM,sBAAsB,CACjD,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,MAAM,EACd,OAAO,CAAC,GAAG,EACX,OAAO,CAAC,GAAG,EACX,MAAM,CACT,CAAA;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;IAC5D,IAAI,KAAK,EAAE,MAAM,MAAM,IAAI,OAAO,EAAE;QAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;KACzB;AACL,CAAC,CAAC;KACG,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"}
|
package/dist/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamr/cli-tools",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-beta.0",
|
|
4
4
|
"description": "Command line tools for Streamr.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"streamr": "dist/bin/streamr.js"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
9
|
"check": "tsc -p ./tsconfig.json --noEmit",
|
|
10
|
+
"clean": "jest --clearCache || true; rm -rf dist *.tsbuildinfo node_modules/.cache || true",
|
|
10
11
|
"eslint": "eslint --cache --cache-location=node_modules/.cache/.eslintcache/ '*/**/*.{js,ts}'",
|
|
11
|
-
"prepare": "npm run eslint && npm run build",
|
|
12
12
|
"build": "tsc -b tsconfig.json",
|
|
13
13
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
14
14
|
},
|
|
@@ -30,24 +30,16 @@
|
|
|
30
30
|
},
|
|
31
31
|
"homepage": "https://github.com/streamr-dev/cli-tools#readme",
|
|
32
32
|
"dependencies": {
|
|
33
|
+
"@streamr/utils": "^1.0.0",
|
|
33
34
|
"commander": "^8.3.0",
|
|
34
35
|
"easy-table": "^1.1.1",
|
|
35
36
|
"event-stream": "^4.0.1",
|
|
36
37
|
"lodash": "^4.17.21",
|
|
37
|
-
"streamr-client": "
|
|
38
|
-
"streamr-client-protocol": "^12.0.0",
|
|
39
|
-
"streamr-test-utils": "^2.0.0"
|
|
38
|
+
"streamr-client": "7.0.0-beta.0"
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
42
|
-
"@streamr/dev-config": "^1.0.0",
|
|
43
41
|
"@types/easy-table": "0.0.32",
|
|
44
42
|
"@types/event-stream": "^3.3.34",
|
|
45
|
-
"@types/lodash": "^4.14.175"
|
|
46
|
-
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
47
|
-
"@typescript-eslint/parser": "^5.0.0",
|
|
48
|
-
"eslint": "^7.32.0",
|
|
49
|
-
"eslint-config-streamr-ts": "^4.0.1",
|
|
50
|
-
"eslint-plugin-promise": "^5.1.0",
|
|
51
|
-
"typescript": "^4.5.2"
|
|
43
|
+
"@types/lodash": "^4.14.175"
|
|
52
44
|
}
|
|
53
45
|
}
|
package/dist/src/client.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StreamrClientConfig, StreamrClient } from 'streamr-client';
|
|
2
2
|
import { GlobalCommandLineArgs } from './common';
|
|
3
|
-
export declare const createClient: (commandLineArgs: GlobalCommandLineArgs, overridenOptions?:
|
|
3
|
+
export declare const createClient: (commandLineArgs: GlobalCommandLineArgs, overridenOptions?: StreamrClientConfig) => StreamrClient;
|
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
|
};
|
|
@@ -16,7 +15,9 @@ const addInterruptHandler = (client) => {
|
|
|
16
15
|
try {
|
|
17
16
|
await client.destroy();
|
|
18
17
|
}
|
|
19
|
-
catch {
|
|
18
|
+
catch {
|
|
19
|
+
// no-op
|
|
20
|
+
}
|
|
20
21
|
process.exit();
|
|
21
22
|
});
|
|
22
23
|
};
|
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;AAEpC,MAAM,eAAe,GAAG,CAAC,eAAsC,EAAE,gBAAqC,EAAE,EAAE
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AACpC,mDAA+E;AAE/E,qCAAoC;AAEpC,MAAM,eAAe,GAAG,CAAC,eAAsC,EAAE,gBAAqC,EAAE,EAAE;IACtG,MAAM,kBAAkB,GAAG,CAAC,eAAe,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,IAAA,aAAI,EAAC,2BAAU,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IACrG,MAAM,cAAc,GAAG,IAAA,kBAAS,EAAC,eAAe,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IAChE,MAAM,qBAAqB,GAAG,CAAC,eAAe,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,eAAe,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;IAC3I,OAAO,IAAA,cAAK,EACR,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,CACnB,CAAA;AACL,CAAC,CAAA;AAED,MAAM,mBAAmB,GAAG,CAAC,MAAqB,EAAE,EAAE;IAClD,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;QAC5B,IAAI;YACA,MAAM,MAAM,CAAC,OAAO,EAAE,CAAA;SACzB;QAAC,MAAM;YACJ,QAAQ;SACX;QACD,OAAO,CAAC,IAAI,EAAE,CAAA;IAClB,CAAC,CAAC,CAAA;AACN,CAAC,CAAA;AAEM,MAAM,YAAY,GAAG,CAAC,eAAsC,EAAE,mBAAwC,EAAE,EAAiB,EAAE;IAC9H,MAAM,MAAM,GAAG,eAAe,CAAC,eAAe,EAAE,gBAAgB,CAAC,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 {};
|
package/dist/src/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAuB;AACvB,4CAAmB;AACnB,2BAAiC;AAOjC;;;;;;;;GAQG;AACH,MAAM,cAAc,GAAG,CAAC,MAAW,EAAE,QAAgB,EAAgB,EAAE;IACnE,MAAM,mBAAmB,GAAG,QAAQ,CAAA;IACpC,IAAI,MAAM,CAAC,mBAAmB,CAAC,KAAK,SAAS,EAAE;QAC3C,MAAM,IAAI,KAAK,CAAC,yBAAyB,mBAAmB,QAAQ,QAAQ,EAAE,CAAC,CAAA;KAClF;AACL,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,CAAC,QAAgB,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAuB;AACvB,4CAAmB;AACnB,2BAAiC;AAOjC;;;;;;;;GAQG;AACH,MAAM,cAAc,GAAG,CAAC,MAAW,EAAE,QAAgB,EAAgB,EAAE;IACnE,MAAM,mBAAmB,GAAG,QAAQ,CAAA;IACpC,IAAI,MAAM,CAAC,mBAAmB,CAAC,KAAK,SAAS,EAAE;QAC3C,MAAM,IAAI,KAAK,CAAC,yBAAyB,mBAAmB,QAAQ,QA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
|
|
7
7
|
* the files which call createClientCommand()).
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
process.env.LOG_LEVEL = (_a = process.env.LOG_LEVEL) !== null && _a !== void 0 ? _a : 'error';
|
|
9
|
+
process.env.LOG_LEVEL = process.env.LOG_LEVEL ?? 'error';
|
|
11
10
|
//# sourceMappingURL=logLevel.js.map
|
package/dist/src/logLevel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logLevel.js","sourceRoot":"","sources":["../../src/logLevel.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG
|
|
1
|
+
{"version":3,"file":"logLevel.js","sourceRoot":"","sources":["../../src/logLevel.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;AAEH,OAAO,CAAC,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,OAAO,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission.js","sourceRoot":"","sources":["../../src/permission.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,mDAA8F;AAC9F,uCAA+C;AAE/C,MAAM,cAAc,GAAG,QAAQ,CAAA;AAElB,QAAA,WAAW,GAAG,IAAI,GAAG,
|
|
1
|
+
{"version":3,"file":"permission.js","sourceRoot":"","sources":["../../src/permission.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,mDAA8F;AAC9F,uCAA+C;AAE/C,MAAM,cAAc,GAAG,QAAQ,CAAA;AAElB,QAAA,WAAW,GAAG,IAAI,GAAG,CAA2B;IACzD,CAAC,WAAW,EAAE,iCAAgB,CAAC,SAAS,CAAC;IACzC,CAAC,SAAS,EAAE,iCAAgB,CAAC,OAAO,CAAC;IACrC,CAAC,MAAM,EAAE,iCAAgB,CAAC,IAAI,CAAC;IAC/B,CAAC,QAAQ,EAAE,iCAAgB,CAAC,MAAM,CAAC;IACnC,CAAC,OAAO,EAAE,iCAAgB,CAAC,KAAK,CAAC;CACp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