@streamr/cli-tools 5.0.1 → 6.0.0-alpha.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/CHANGELOG.md +2 -0
- package/README.md +21 -6
- package/bin/common.ts +23 -22
- package/bin/streamr-storage-node-add-stream.ts +3 -1
- package/bin/streamr-storage-node-list-stream-parts.ts +5 -5
- package/bin/streamr-storage-node-list.ts +8 -3
- package/bin/streamr-storage-node-remove-stream.ts +3 -1
- package/bin/streamr-stream-create.ts +3 -3
- package/bin/streamr-stream-grant-permission.ts +4 -2
- package/bin/streamr-stream-publish.ts +3 -2
- package/bin/streamr-stream-resend.ts +7 -4
- package/bin/streamr-stream-revoke-permission.ts +4 -2
- package/bin/streamr-stream-show.ts +3 -2
- package/bin/streamr-stream-subscribe.ts +3 -2
- package/dist/bin/common.d.ts +2 -3
- package/dist/bin/common.js +26 -23
- package/dist/bin/common.js.map +1 -1
- package/dist/bin/streamr-misc-get-session-token.js +4 -4
- package/dist/bin/streamr-misc-get-session-token.js.map +1 -1
- package/dist/bin/streamr-mock-data-generate.js +3 -3
- package/dist/bin/streamr-mock-data-generate.js.map +1 -1
- package/dist/bin/streamr-storage-node-add-stream.js +6 -5
- package/dist/bin/streamr-storage-node-add-stream.js.map +1 -1
- package/dist/bin/streamr-storage-node-list-stream-parts.js +7 -7
- package/dist/bin/streamr-storage-node-list-stream-parts.js.map +1 -1
- package/dist/bin/streamr-storage-node-list.js +9 -7
- package/dist/bin/streamr-storage-node-list.js.map +1 -1
- package/dist/bin/streamr-storage-node-remove-stream.js +6 -5
- package/dist/bin/streamr-storage-node-remove-stream.js.map +1 -1
- package/dist/bin/streamr-stream-create.js +8 -8
- package/dist/bin/streamr-stream-create.js.map +1 -1
- package/dist/bin/streamr-stream-grant-permission.js +5 -4
- package/dist/bin/streamr-stream-grant-permission.js.map +1 -1
- package/dist/bin/streamr-stream-list.js +4 -4
- package/dist/bin/streamr-stream-list.js.map +1 -1
- package/dist/bin/streamr-stream-publish.js +6 -5
- package/dist/bin/streamr-stream-publish.js.map +1 -1
- package/dist/bin/streamr-stream-resend.js +15 -12
- package/dist/bin/streamr-stream-resend.js.map +1 -1
- package/dist/bin/streamr-stream-revoke-permission.js +6 -5
- package/dist/bin/streamr-stream-revoke-permission.js.map +1 -1
- package/dist/bin/streamr-stream-show.js +6 -5
- package/dist/bin/streamr-stream-show.js.map +1 -1
- package/dist/bin/streamr-stream-subscribe.js +7 -6
- package/dist/bin/streamr-stream-subscribe.js.map +1 -1
- package/dist/bin/streamr.js +0 -0
- package/dist/package.json +11 -9
- package/dist/src/create.d.ts +1 -1
- package/dist/src/create.js +3 -2
- package/dist/src/create.js.map +1 -1
- package/dist/src/publish.js +2 -3
- package/dist/src/publish.js.map +1 -1
- package/dist/src/resend.js +2 -17
- package/dist/src/resend.js.map +1 -1
- package/dist/src/show.js +1 -1
- package/dist/src/show.js.map +1 -1
- package/dist/src/subscribe.d.ts +1 -1
- package/dist/src/subscribe.js +3 -3
- package/dist/src/subscribe.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -8525
- package/package.json +11 -9
- package/src/create.ts +5 -2
- package/src/publish.ts +2 -3
- package/src/resend.ts +2 -20
- package/src/show.ts +1 -1
- package/src/subscribe.ts +3 -3
- package/dist/commands/common.js +0 -76
- package/dist/commands/streamor.js +0 -16
- package/dist/commands/streamr-mock-data-generate.js +0 -20
- package/dist/commands/streamr-mock-data.js +0 -14
- package/dist/commands/streamr-storage-node-add-stream.js +0 -24
- package/dist/commands/streamr-storage-node-list-stream-parts.js +0 -32
- package/dist/commands/streamr-storage-node-list.js +0 -44
- package/dist/commands/streamr-storage-node-remove-stream.js +0 -24
- package/dist/commands/streamr-storage-node.js +0 -17
- package/dist/commands/streamr-stream-create.js +0 -31
- package/dist/commands/streamr-stream-grant-permission.js +0 -62
- package/dist/commands/streamr-stream-list.js +0 -33
- package/dist/commands/streamr-stream-publish.js +0 -32
- package/dist/commands/streamr-stream-resend.js +0 -101
- package/dist/commands/streamr-stream-revoke-permission.js +0 -24
- package/dist/commands/streamr-stream-show.js +0 -23
- package/dist/commands/streamr-stream-subscribe.js +0 -25
- package/dist/commands/streamr-stream.js +0 -21
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const commander_1 = require("commander");
|
|
8
|
-
const resend_1 = require("../src/resend");
|
|
9
|
-
const common_1 = require("./common");
|
|
10
|
-
const package_json_1 = __importDefault(require("../package.json"));
|
|
11
|
-
function handlePublisherIdAndMsgChainId(commandOptions, resendOptions) {
|
|
12
|
-
if ('publisherId' in commandOptions && !('msgChainId' in commandOptions)) {
|
|
13
|
-
console.error('option --publisher-id must be accompanied by option --msg-chain-id');
|
|
14
|
-
process.exit(1);
|
|
15
|
-
}
|
|
16
|
-
if ('msgChainId' in commandOptions && !('publisherId' in commandOptions)) {
|
|
17
|
-
console.error('option --msg-chain-id must be accompanied by option --publisher-id');
|
|
18
|
-
process.exit(1);
|
|
19
|
-
}
|
|
20
|
-
if ('publisherId' in commandOptions) {
|
|
21
|
-
resendOptions.publisherId = commandOptions.publisherId;
|
|
22
|
-
}
|
|
23
|
-
if ('msgChainId' in commandOptions) {
|
|
24
|
-
resendOptions.msgChainId = commandOptions.msgChainId;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
const program = new commander_1.Command();
|
|
28
|
-
program
|
|
29
|
-
.usage('<command> [<args>]')
|
|
30
|
-
.description('request resend of stream and print JSON messages to stdout line-by-line');
|
|
31
|
-
program
|
|
32
|
-
.command('last <n> <streamId>')
|
|
33
|
-
.description('request last N messages')
|
|
34
|
-
.option('-d, --disable-ordering', 'disable ordering of messages by OrderingUtil', false)
|
|
35
|
-
.option('-s, --subscribe', 'subscribe in addition to resend', false)
|
|
36
|
-
.action((n, streamId, options, command) => {
|
|
37
|
-
// @ts-expect-error
|
|
38
|
-
if (isNaN(n)) {
|
|
39
|
-
console.error('argument n is not a number');
|
|
40
|
-
process.exit(1);
|
|
41
|
-
}
|
|
42
|
-
const resendOptions = {
|
|
43
|
-
last: parseInt(n)
|
|
44
|
-
};
|
|
45
|
-
const clientOptions = common_1.formStreamrOptionsWithEnv(command.parent.opts());
|
|
46
|
-
clientOptions.orderMessages = !options.disableOrdering;
|
|
47
|
-
clientOptions.subscribe = options.subscribe;
|
|
48
|
-
resend_1.resend(streamId, resendOptions, clientOptions);
|
|
49
|
-
});
|
|
50
|
-
program
|
|
51
|
-
.command('from <from> <streamId>')
|
|
52
|
-
.description('request messages starting from given date-time (format: "YYYY-MM-DDTHH:mm:ss.sssZ")')
|
|
53
|
-
.option('--publisher-id <string>', 'filter results by publisher')
|
|
54
|
-
.option('--msg-chain-id <string>', 'filter results by message chain')
|
|
55
|
-
.option('-d, --disable-ordering', 'disable ordering of messages by OrderingUtil', false)
|
|
56
|
-
.option('-s, --subscribe', 'subscribe in addition to resend', false)
|
|
57
|
-
.action((from, streamId, options, command) => {
|
|
58
|
-
const resendOptions = {
|
|
59
|
-
from: {
|
|
60
|
-
timestamp: Date.parse(from),
|
|
61
|
-
sequenceNumber: 0
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
handlePublisherIdAndMsgChainId(options, resendOptions);
|
|
65
|
-
const clientOptions = common_1.formStreamrOptionsWithEnv(command.parent.opts());
|
|
66
|
-
clientOptions.orderMessages = !options.disableOrdering;
|
|
67
|
-
clientOptions.subscribe = options.subscribe;
|
|
68
|
-
resend_1.resend(streamId, resendOptions, clientOptions);
|
|
69
|
-
});
|
|
70
|
-
program
|
|
71
|
-
.command('range <from> <to> <streamId>')
|
|
72
|
-
.description('request messages between two given date-times (format: "YYYY-MM-DDTHH:mm:ss.sssZ")')
|
|
73
|
-
.option('--publisher-id <string>', 'filter results by publisher')
|
|
74
|
-
.option('--msg-chain-id <string>', 'filter results by message chain')
|
|
75
|
-
.option('-d, --disable-ordering', 'disable ordering of messages by OrderingUtil', false)
|
|
76
|
-
.action((from, to, streamId, options, command) => {
|
|
77
|
-
const resendOptions = {
|
|
78
|
-
from: {
|
|
79
|
-
timestamp: Date.parse(from),
|
|
80
|
-
sequenceNumber: 0
|
|
81
|
-
},
|
|
82
|
-
to: {
|
|
83
|
-
timestamp: Date.parse(to),
|
|
84
|
-
sequenceNumber: 0
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
handlePublisherIdAndMsgChainId(options, resendOptions);
|
|
88
|
-
const clientOptions = common_1.formStreamrOptionsWithEnv(command.parent.opts());
|
|
89
|
-
clientOptions.orderMessages = !options.disableOrdering;
|
|
90
|
-
resend_1.resend(streamId, resendOptions, clientOptions);
|
|
91
|
-
});
|
|
92
|
-
program
|
|
93
|
-
.on('command:*', (invalidCommand) => {
|
|
94
|
-
console.error(`invalid command: ${invalidCommand}`);
|
|
95
|
-
process.exit(1);
|
|
96
|
-
});
|
|
97
|
-
common_1.authOptions(program);
|
|
98
|
-
common_1.envOptions(program)
|
|
99
|
-
.version(package_json_1.default.version)
|
|
100
|
-
.parse(process.argv);
|
|
101
|
-
common_1.exitWithHelpIfArgsNotBetween(program, 1, Number.MAX_VALUE);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node -r ts-node/register
|
|
2
|
-
"use strict";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const commander_1 = require("commander");
|
|
8
|
-
const common_1 = require("./common");
|
|
9
|
-
const package_json_1 = __importDefault(require("../package.json"));
|
|
10
|
-
const streamr_client_1 = require("streamr-client");
|
|
11
|
-
const program = new commander_1.Command();
|
|
12
|
-
program
|
|
13
|
-
.arguments('<streamId> <permissionId>')
|
|
14
|
-
.description('revoke permission');
|
|
15
|
-
common_1.authOptions(program);
|
|
16
|
-
common_1.envOptions(program)
|
|
17
|
-
.version(package_json_1.default.version)
|
|
18
|
-
.action(async (streamId, permissionId, options) => {
|
|
19
|
-
const client = new streamr_client_1.StreamrClient(common_1.formStreamrOptionsWithEnv(options));
|
|
20
|
-
const stream = await client.getStream(streamId);
|
|
21
|
-
stream.revokePermission(permissionId);
|
|
22
|
-
})
|
|
23
|
-
.parseAsync(process.argv);
|
|
24
|
-
common_1.exitWithHelpIfArgsNotBetween(program, 2, 2);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const commander_1 = require("commander");
|
|
8
|
-
const show_1 = require("../src/show");
|
|
9
|
-
const common_1 = require("./common");
|
|
10
|
-
const package_json_1 = __importDefault(require("../package.json"));
|
|
11
|
-
const program = new commander_1.Command();
|
|
12
|
-
program
|
|
13
|
-
.arguments('<streamId>')
|
|
14
|
-
.description('show detailed information about a stream')
|
|
15
|
-
.option('--include-permissions', 'include list of permissions (requires SHARE permission)');
|
|
16
|
-
common_1.authOptions(program);
|
|
17
|
-
common_1.envOptions(program)
|
|
18
|
-
.version(package_json_1.default.version)
|
|
19
|
-
.action((streamId, options) => {
|
|
20
|
-
show_1.show(streamId, options.includePermissions, common_1.formStreamrOptionsWithEnv(options));
|
|
21
|
-
})
|
|
22
|
-
.parse(process.argv);
|
|
23
|
-
common_1.exitWithHelpIfArgsNotBetween(program, 1, 1);
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const commander_1 = require("commander");
|
|
8
|
-
const subscribe_1 = require("../src/subscribe");
|
|
9
|
-
const common_1 = require("./common");
|
|
10
|
-
const package_json_1 = __importDefault(require("../package.json"));
|
|
11
|
-
const program = new commander_1.Command();
|
|
12
|
-
program
|
|
13
|
-
.arguments('<streamId>')
|
|
14
|
-
.description('subscribe to a stream, prints JSON messages to stdout line-by-line')
|
|
15
|
-
.option('-p, --partition [partition]', 'partition', common_1.createFnParseInt('--partition'), 0)
|
|
16
|
-
.option('-d, --disable-ordering', 'disable ordering of messages by OrderingUtil', false);
|
|
17
|
-
common_1.authOptions(program);
|
|
18
|
-
common_1.envOptions(program)
|
|
19
|
-
.version(package_json_1.default.version)
|
|
20
|
-
.action((streamId, options) => {
|
|
21
|
-
options.orderMessages = !options.disableOrdering;
|
|
22
|
-
subscribe_1.subscribe(streamId, options.partition, common_1.formStreamrOptionsWithEnv(options));
|
|
23
|
-
})
|
|
24
|
-
.parse(process.argv);
|
|
25
|
-
common_1.exitWithHelpIfArgsNotBetween(program, 1, 1);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const commander_1 = require("commander");
|
|
8
|
-
const package_json_1 = __importDefault(require("../package.json"));
|
|
9
|
-
commander_1.program
|
|
10
|
-
.version(package_json_1.default.version)
|
|
11
|
-
.usage('<command> [<args>]')
|
|
12
|
-
.description('stream subcommands')
|
|
13
|
-
.command('subscribe', 'subscribe to a stream')
|
|
14
|
-
.command('publish', 'publish to a stream')
|
|
15
|
-
.command('list', 'fetch a list of streams')
|
|
16
|
-
.command('show', 'info about a stream')
|
|
17
|
-
.command("create", "create a new stream")
|
|
18
|
-
.command('resend', 'request resend of a stream')
|
|
19
|
-
.command('grant-permission', 'grant permission')
|
|
20
|
-
.command('revoke-permission', 'revoke permission')
|
|
21
|
-
.parse(process.argv);
|