@streamr/cli-tools 5.0.1 → 6.0.0-alpha.3
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/.eslintignore +0 -1
- package/CHANGELOG.md +18 -1
- package/README.md +42 -17
- package/bin/streamr-mock-data-generate.ts +38 -8
- package/bin/streamr-mock-data.ts +1 -1
- package/bin/streamr-storage-node-add-stream.ts +8 -26
- package/bin/streamr-storage-node-list-stream-parts.ts +18 -34
- package/bin/streamr-storage-node-list.ts +14 -34
- package/bin/streamr-storage-node-remove-stream.ts +8 -26
- package/bin/streamr-storage-node.ts +1 -1
- package/bin/streamr-stream-create.ts +17 -29
- package/bin/streamr-stream-grant-permission.ts +9 -66
- package/bin/streamr-stream-publish.ts +54 -21
- package/bin/streamr-stream-resend-from.ts +26 -0
- package/bin/streamr-stream-resend-last.ts +25 -0
- package/bin/streamr-stream-resend-range.ts +32 -0
- package/bin/streamr-stream-resend.ts +7 -92
- package/bin/streamr-stream-revoke-permission.ts +8 -24
- package/bin/streamr-stream-search.ts +17 -0
- package/bin/streamr-stream-show.ts +16 -16
- package/bin/streamr-stream-subscribe.ts +16 -16
- package/bin/streamr-stream.ts +2 -2
- package/bin/streamr.ts +1 -2
- package/dist/bin/streamr-mock-data-generate.d.ts +1 -1
- package/dist/bin/streamr-mock-data-generate.js +35 -9
- package/dist/bin/streamr-mock-data-generate.js.map +1 -1
- package/dist/bin/streamr-mock-data.js +1 -1
- package/dist/bin/streamr-mock-data.js.map +1 -1
- package/dist/bin/streamr-storage-node-add-stream.d.ts +1 -1
- package/dist/bin/streamr-storage-node-add-stream.js +8 -24
- package/dist/bin/streamr-storage-node-add-stream.js.map +1 -1
- package/dist/bin/streamr-storage-node-list-stream-parts.d.ts +1 -1
- package/dist/bin/streamr-storage-node-list-stream-parts.js +17 -28
- package/dist/bin/streamr-storage-node-list-stream-parts.js.map +1 -1
- package/dist/bin/streamr-storage-node-list.d.ts +1 -1
- package/dist/bin/streamr-storage-node-list.js +15 -30
- package/dist/bin/streamr-storage-node-list.js.map +1 -1
- package/dist/bin/streamr-storage-node-remove-stream.d.ts +1 -1
- package/dist/bin/streamr-storage-node-remove-stream.js +8 -24
- package/dist/bin/streamr-storage-node-remove-stream.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.d.ts +1 -1
- package/dist/bin/streamr-stream-create.js +14 -23
- package/dist/bin/streamr-stream-create.js.map +1 -1
- package/dist/bin/streamr-stream-grant-permission.d.ts +1 -1
- package/dist/bin/streamr-stream-grant-permission.js +3 -63
- package/dist/bin/streamr-stream-grant-permission.js.map +1 -1
- package/dist/bin/streamr-stream-publish.d.ts +1 -1
- package/dist/bin/streamr-stream-publish.js +49 -23
- package/dist/bin/streamr-stream-publish.js.map +1 -1
- package/dist/bin/streamr-stream-resend-from.d.ts +2 -0
- package/dist/bin/streamr-stream-resend-from.js +27 -0
- package/dist/bin/streamr-stream-resend-from.js.map +1 -0
- package/dist/bin/streamr-stream-resend-last.d.ts +2 -0
- package/dist/bin/streamr-stream-resend-last.js +26 -0
- package/dist/bin/streamr-stream-resend-last.js.map +1 -0
- package/dist/bin/streamr-stream-resend-range.d.ts +2 -0
- package/dist/bin/streamr-stream-resend-range.js +33 -0
- package/dist/bin/streamr-stream-resend-range.js.map +1 -0
- package/dist/bin/streamr-stream-resend.d.ts +1 -1
- package/dist/bin/streamr-stream-resend.js +8 -87
- package/dist/bin/streamr-stream-resend.js.map +1 -1
- package/dist/bin/streamr-stream-revoke-permission.d.ts +1 -1
- package/dist/bin/streamr-stream-revoke-permission.js +3 -21
- package/dist/bin/streamr-stream-revoke-permission.js.map +1 -1
- package/dist/bin/streamr-stream-search.d.ts +2 -0
- package/dist/bin/streamr-stream-search.js +21 -0
- package/dist/bin/streamr-stream-search.js.map +1 -0
- package/dist/bin/streamr-stream-show.d.ts +1 -1
- package/dist/bin/streamr-stream-show.js +15 -15
- package/dist/bin/streamr-stream-show.js.map +1 -1
- package/dist/bin/streamr-stream-subscribe.d.ts +1 -1
- package/dist/bin/streamr-stream-subscribe.js +17 -20
- package/dist/bin/streamr-stream-subscribe.js.map +1 -1
- package/dist/bin/streamr-stream.js +2 -2
- package/dist/bin/streamr-stream.js.map +1 -1
- package/dist/bin/streamr.js +1 -2
- package/dist/bin/streamr.js.map +1 -1
- package/dist/package.json +18 -13
- package/dist/src/client.d.ts +3 -0
- package/dist/src/client.js +33 -0
- package/dist/src/client.js.map +1 -0
- package/dist/src/command.d.ts +8 -0
- package/dist/src/command.js +45 -0
- package/dist/src/command.js.map +1 -0
- package/dist/src/common.d.ts +6 -0
- package/dist/src/common.js +15 -0
- package/dist/src/common.js.map +1 -0
- package/dist/src/config.d.ts +6 -0
- package/dist/src/config.js +58 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/logLevel.d.ts +0 -0
- package/dist/src/logLevel.js +11 -0
- package/dist/src/logLevel.js.map +1 -0
- package/dist/src/permission.d.ts +4 -0
- package/dist/src/permission.js +48 -0
- package/dist/src/permission.js.map +1 -0
- package/dist/src/resend.d.ts +3 -4
- package/dist/src/resend.js +12 -23
- package/dist/src/resend.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -8525
- package/package.json +18 -13
- package/src/client.ts +32 -0
- package/src/command.ts +45 -0
- package/src/common.ts +16 -0
- package/src/config.ts +56 -0
- package/src/logLevel.ts +9 -0
- package/src/permission.ts +49 -0
- package/src/resend.ts +19 -28
- package/tsconfig.json +13 -5
- package/bin/common.ts +0 -93
- package/bin/streamr-misc-get-session-token.ts +0 -33
- package/bin/streamr-misc.ts +0 -10
- package/bin/streamr-stream-list.ts +0 -33
- package/dist/bin/common.d.ts +0 -17
- package/dist/bin/common.js +0 -77
- package/dist/bin/common.js.map +0 -1
- package/dist/bin/streamr-misc-get-session-token.d.ts +0 -2
- package/dist/bin/streamr-misc-get-session-token.js +0 -33
- package/dist/bin/streamr-misc-get-session-token.js.map +0 -1
- package/dist/bin/streamr-misc.d.ts +0 -2
- package/dist/bin/streamr-misc.js +0 -15
- package/dist/bin/streamr-misc.js.map +0 -1
- package/dist/bin/streamr-stream-list.d.ts +0 -2
- package/dist/bin/streamr-stream-list.js +0 -37
- package/dist/bin/streamr-stream-list.js.map +0 -1
- 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
- package/dist/src/create.d.ts +0 -2
- package/dist/src/create.js +0 -19
- package/dist/src/create.js.map +0 -1
- package/dist/src/generate.d.ts +0 -1
- package/dist/src/generate.js +0 -32
- package/dist/src/generate.js.map +0 -1
- package/dist/src/list.d.ts +0 -2
- package/dist/src/list.js +0 -29
- package/dist/src/list.js.map +0 -1
- package/dist/src/publish.d.ts +0 -3
- package/dist/src/publish.js +0 -36
- package/dist/src/publish.js.map +0 -1
- package/dist/src/show.d.ts +0 -2
- package/dist/src/show.js +0 -23
- package/dist/src/show.js.map +0 -1
- package/dist/src/subscribe.d.ts +0 -2
- package/dist/src/subscribe.js +0 -13
- package/dist/src/subscribe.js.map +0 -1
- package/src/create.ts +0 -16
- package/src/generate.ts +0 -33
- package/src/list.ts +0 -22
- package/src/publish.ts +0 -42
- package/src/show.ts +0 -23
- package/src/subscribe.ts +0 -9
|
@@ -1,29 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
program
|
|
13
|
-
.arguments('<storageNodeAddress> <streamId>')
|
|
14
|
-
.description('remove stream from a storage node');
|
|
15
|
-
common_1.authOptions(program);
|
|
16
|
-
common_1.envOptions(program)
|
|
17
|
-
.version(package_json_1.default.version)
|
|
18
|
-
.action((storageNodeAddress, streamId, options) => {
|
|
19
|
-
const client = new streamr_client_1.StreamrClient(common_1.formStreamrOptionsWithEnv(options));
|
|
20
|
-
client.getStream(streamId)
|
|
21
|
-
.then((stream) => stream.removeFromStorageNode(storageNodeAddress))
|
|
22
|
-
.catch((err) => {
|
|
23
|
-
console.error(err);
|
|
24
|
-
process.exit(1);
|
|
25
|
-
});
|
|
4
|
+
require("../src/logLevel");
|
|
5
|
+
const command_1 = require("../src/command");
|
|
6
|
+
(0, command_1.createClientCommand)(async (client, storageNodeAddress, streamId) => {
|
|
7
|
+
const stream = await client.getStream(streamId);
|
|
8
|
+
await stream.removeFromStorageNode(storageNodeAddress);
|
|
26
9
|
})
|
|
27
|
-
.
|
|
28
|
-
|
|
10
|
+
.arguments('<storageNodeAddress> <streamId>')
|
|
11
|
+
.description('remove stream from a storage node')
|
|
12
|
+
.parseAsync();
|
|
29
13
|
//# sourceMappingURL=streamr-storage-node-remove-stream.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamr-storage-node-remove-stream.js","sourceRoot":"","sources":["../../bin/streamr-storage-node-remove-stream.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"streamr-storage-node-remove-stream.js","sourceRoot":"","sources":["../../bin/streamr-storage-node-remove-stream.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,4CAAoD;AAEpD,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,kBAA0B,EAAE,QAAgB,EAAE,EAAE;IAC9F,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;IAC/C,MAAM,MAAM,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,CAAA;AAC1D,CAAC,CAAC;KACG,SAAS,CAAC,iCAAiC,CAAC;KAC5C,WAAW,CAAC,mCAAmC,CAAC;KAChD,UAAU,EAAE,CAAA"}
|
|
@@ -14,5 +14,5 @@ commander_1.program
|
|
|
14
14
|
.command('add-stream', 'add stream')
|
|
15
15
|
.command('remove-stream', 'remove stream')
|
|
16
16
|
.command('list-stream-parts', 'list stream parts in a storage node')
|
|
17
|
-
.parse(
|
|
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,mBAAmB,EAAE,qCAAqC,CAAC;KACnE,KAAK,
|
|
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,mBAAmB,EAAE,qCAAqC,CAAC;KACnE,KAAK,EAAE,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
import '../src/logLevel';
|
|
@@ -1,32 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const program = new commander_1.Command();
|
|
12
|
-
program
|
|
13
|
-
.arguments('<name>')
|
|
14
|
-
.description('create a new stream')
|
|
15
|
-
.option('-d, --description <description>', 'define a description')
|
|
16
|
-
.option('-c, --config <config>', 'define a configuration as JSON', (s) => JSON.parse(s))
|
|
17
|
-
.option('-p, --partitions <count>', 'define a partition count', common_1.createFnParseInt('--partitions'));
|
|
18
|
-
common_1.authOptions(program);
|
|
19
|
-
common_1.envOptions(program)
|
|
20
|
-
.version(package_json_1.default.version)
|
|
21
|
-
.action((name, options) => {
|
|
4
|
+
require("../src/logLevel");
|
|
5
|
+
const common_1 = require("../src/common");
|
|
6
|
+
const command_1 = require("../src/command");
|
|
7
|
+
(0, command_1.createClientCommand)(async (client, streamIdOrPath, options) => {
|
|
22
8
|
const body = {
|
|
23
|
-
|
|
9
|
+
id: streamIdOrPath,
|
|
24
10
|
description: options.description,
|
|
25
|
-
config: options.
|
|
11
|
+
config: options.streamConfig,
|
|
26
12
|
partitions: options.partitions
|
|
27
13
|
};
|
|
28
|
-
|
|
14
|
+
const stream = await client.createStream(body);
|
|
15
|
+
console.info(JSON.stringify(stream.toObject(), null, 2));
|
|
29
16
|
})
|
|
30
|
-
.
|
|
31
|
-
|
|
17
|
+
.arguments('<streamId>')
|
|
18
|
+
.description('create a new stream')
|
|
19
|
+
.option('-d, --description <description>', 'define a description')
|
|
20
|
+
.option('-c, --stream-config <config>', 'define a configuration as JSON', (s) => JSON.parse(s))
|
|
21
|
+
.option('-p, --partitions <count>', 'define a partition count', (0, common_1.createFnParseInt)('--partitions'))
|
|
22
|
+
.parseAsync();
|
|
32
23
|
//# sourceMappingURL=streamr-stream-create.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamr-stream-create.js","sourceRoot":"","sources":["../../bin/streamr-stream-create.ts"],"names":[],"mappings":"
|
|
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,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;AAC5D,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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
import '../src/logLevel';
|
|
@@ -1,67 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const streamr_client_1 = require("streamr-client");
|
|
11
|
-
const easy_table_1 = __importDefault(require("easy-table"));
|
|
12
|
-
const PUBLIC_PERMISSION_ID = 'public';
|
|
13
|
-
const OPERATION_PREFIX = 'stream_';
|
|
14
|
-
const getOperation = (id) => {
|
|
15
|
-
// we support both short ids (e.g. "publish"), and long ids (e.g. "stream_publish")
|
|
16
|
-
// the actual StreamOperation constant is the long id string
|
|
17
|
-
// backend does the validation of invalid constants
|
|
18
|
-
if (!id.startsWith(OPERATION_PREFIX)) {
|
|
19
|
-
return (OPERATION_PREFIX + id);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
return id;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
const getShortOperationId = (operation) => {
|
|
26
|
-
const longOperationId = operation;
|
|
27
|
-
if (longOperationId.startsWith(OPERATION_PREFIX)) {
|
|
28
|
-
return longOperationId.substring(OPERATION_PREFIX.length);
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
throw new Error(`Assertion failed: unknown prefix for in ${longOperationId}`);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
const getTarget = (user) => {
|
|
35
|
-
if (user === PUBLIC_PERMISSION_ID) {
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
return user;
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
const program = new commander_1.Command();
|
|
43
|
-
program
|
|
44
|
-
.arguments('<streamId> <user> <operations...>')
|
|
45
|
-
.description('grant permission: use keyword "public" as a user to grant a public permission');
|
|
46
|
-
common_1.authOptions(program);
|
|
47
|
-
common_1.envOptions(program)
|
|
48
|
-
.version(package_json_1.default.version)
|
|
49
|
-
.action(async (streamId, user, operationIds, options) => {
|
|
50
|
-
const operations = operationIds.map((o) => getOperation(o));
|
|
51
|
-
const target = getTarget(user);
|
|
52
|
-
const client = new streamr_client_1.StreamrClient(common_1.formStreamrOptionsWithEnv(options));
|
|
53
|
-
const stream = await client.getStream(streamId);
|
|
54
|
-
const tasks = operations.map((operation) => stream.grantPermission(operation, target));
|
|
55
|
-
const permissions = await Promise.all(tasks);
|
|
56
|
-
console.info(easy_table_1.default.print(permissions.map((permission) => ({
|
|
57
|
-
id: permission.id,
|
|
58
|
-
operation: getShortOperationId(permission.operation),
|
|
59
|
-
user: permission.anonymous ? PUBLIC_PERMISSION_ID : permission.user
|
|
60
|
-
}))));
|
|
61
|
-
})
|
|
62
|
-
.parseAsync(process.argv)
|
|
63
|
-
.catch((e) => {
|
|
64
|
-
console.error(e);
|
|
65
|
-
process.exit(1);
|
|
66
|
-
});
|
|
4
|
+
require("../src/logLevel");
|
|
5
|
+
const permission_1 = require("../src/permission");
|
|
6
|
+
(0, permission_1.runModifyPermissionsCommand)((stream, permission, target) => stream.grantUserPermission(permission, target), (stream, permission) => stream.grantPublicPermission(permission), 'grant');
|
|
67
7
|
//# sourceMappingURL=streamr-stream-grant-permission.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamr-stream-grant-permission.js","sourceRoot":"","sources":["../../bin/streamr-stream-grant-permission.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"streamr-stream-grant-permission.js","sourceRoot":"","sources":["../../bin/streamr-stream-grant-permission.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,kDAA+D;AAE/D,IAAA,wCAA2B,EACvB,CAAC,MAAc,EAAE,UAA4B,EAAE,MAAc,EAAE,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,MAAM,CAAC,EAChH,CAAC,MAAc,EAAE,UAA4B,EAAE,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,UAAU,CAAC,EAC1F,OAAO,CACV,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
import '../src/logLevel';
|
|
@@ -4,30 +4,56 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
|
|
7
|
+
require("../src/logLevel");
|
|
8
|
+
const stream_1 = require("stream");
|
|
9
|
+
const streamr_test_utils_1 = require("streamr-test-utils");
|
|
8
10
|
const event_stream_1 = __importDefault(require("event-stream"));
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
11
|
+
const command_1 = require("../src/command");
|
|
12
|
+
const publishStream = (stream, partitionKey, client) => {
|
|
13
|
+
const writable = new stream_1.Writable({
|
|
14
|
+
objectMode: true,
|
|
15
|
+
write: (data, _, done) => {
|
|
16
|
+
let json = null;
|
|
17
|
+
// ignore newlines, etc
|
|
18
|
+
if (!data || String(data).trim() === '') {
|
|
19
|
+
done();
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
json = JSON.parse(data);
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
console.error(data.toString());
|
|
27
|
+
done(e);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
// @ts-expect-error TODO: the last argument here looks wrong, should be just `partitionKey`?
|
|
31
|
+
client.publish(stream, json, Date.now(), json[partitionKey]).then(() => done(), (err) => done(err));
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return writable;
|
|
35
|
+
};
|
|
36
|
+
(0, command_1.createClientCommand)(async (client, streamId, options) => {
|
|
37
|
+
const ps = publishStream(streamId, options.partitionKey, client);
|
|
38
|
+
return new Promise((resolve, reject) => {
|
|
39
|
+
process.stdin
|
|
40
|
+
.pipe(event_stream_1.default.split())
|
|
41
|
+
.pipe(ps)
|
|
42
|
+
.once('finish', async () => {
|
|
43
|
+
// We need to wait some time because the client.publish() may resolve the promise
|
|
44
|
+
// before the node has propagated the message. That may happend if the node
|
|
45
|
+
// has not yet connected to Tracker when client.publish() is called. In that case
|
|
46
|
+
// the message is put to the propagation queue (activeTaskStore.add call in
|
|
47
|
+
// network Propagation.ts:59) and the client.publish() promise resolves immeditatelly.
|
|
48
|
+
// TODO Remove this wait when NET-604 has been resolved
|
|
49
|
+
await (0, streamr_test_utils_1.wait)(2000);
|
|
50
|
+
resolve(undefined);
|
|
51
|
+
})
|
|
52
|
+
.once('error', (err) => reject(err));
|
|
29
53
|
});
|
|
30
54
|
})
|
|
31
|
-
.
|
|
32
|
-
|
|
55
|
+
.arguments('<streamId>')
|
|
56
|
+
.description('publish to a stream by reading JSON messages from stdin line-by-line')
|
|
57
|
+
.option('-k, --partition-key <string>', 'field name in each message to use for assigning the message to a stream partition')
|
|
58
|
+
.parseAsync();
|
|
33
59
|
//# sourceMappingURL=streamr-stream-publish.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamr-stream-publish.js","sourceRoot":"","sources":["../../bin/streamr-stream-publish.ts"],"names":[],"mappings":";;;;;;AACA,
|
|
1
|
+
{"version":3,"file":"streamr-stream-publish.js","sourceRoot":"","sources":["../../bin/streamr-stream-publish.ts"],"names":[],"mappings":";;;;;;AACA,2BAAwB;AACxB,mCAAiC;AAEjC,2DAAyC;AACzC,gEAA6B;AAC7B,4CAAoD;AAEpD,MAAM,aAAa,GAAG,CAClB,MAAc,EACd,YAAgC,EAChC,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,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;aAC1B;YAAC,OAAO,CAAC,EAAE;gBACR,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAA;gBAC9B,IAAI,CAAC,CAAC,CAAC,CAAA;gBACP,OAAM;aACT;YACD,4FAA4F;YAC5F,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAC7D,GAAG,EAAE,CAAC,IAAI,EAAE,EACZ,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CACrB,CAAA;QACL,CAAC;KACJ,CAAC,CAAA;IACF,OAAO,QAAQ,CAAA;AACnB,CAAC,CAAA;AAED,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,QAAgB,EAAE,OAAY,EAAE,EAAE;IAChF,MAAM,EAAE,GAAG,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA;IAChE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,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,yBAAI,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,8BAA8B,EAAE,mFAAmF,CAAC;KAC3H,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
require("../src/logLevel");
|
|
5
|
+
const command_1 = require("../src/command");
|
|
6
|
+
const resend_1 = require("../src/resend");
|
|
7
|
+
(0, command_1.createClientCommand)(async (client, from, streamId, options) => {
|
|
8
|
+
const resendOptions = {
|
|
9
|
+
from: {
|
|
10
|
+
timestamp: Date.parse(from),
|
|
11
|
+
sequenceNumber: 0
|
|
12
|
+
},
|
|
13
|
+
publisherId: options.publisherId
|
|
14
|
+
};
|
|
15
|
+
await (0, resend_1.resend)(streamId, resendOptions, client, options.subscribe);
|
|
16
|
+
}, {
|
|
17
|
+
clientOptionsFactory: (options) => ({
|
|
18
|
+
orderMessages: !options.disableOrdering
|
|
19
|
+
})
|
|
20
|
+
})
|
|
21
|
+
.arguments('<from> <streamId>')
|
|
22
|
+
.description('request messages starting from given date-time (format: "YYYY-MM-DDTHH:mm:ss.sssZ")')
|
|
23
|
+
.option('--publisher-id <string>', 'filter results by publisher')
|
|
24
|
+
.option('-d, --disable-ordering', 'disable ordering of messages by OrderingUtil', false)
|
|
25
|
+
.option('-s, --subscribe', 'subscribe in addition to resend', false)
|
|
26
|
+
.parseAsync();
|
|
27
|
+
//# sourceMappingURL=streamr-stream-resend-from.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamr-stream-resend-from.js","sourceRoot":"","sources":["../../bin/streamr-stream-resend-from.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,4CAAoD;AACpD,0CAAsC;AAEtC,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,IAAY,EAAE,QAAgB,EAAE,OAAY,EAAE,EAAE;IAC9F,MAAM,aAAa,GAAG;QAClB,IAAI,EAAE;YACF,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YAC3B,cAAc,EAAE,CAAC;SACpB;QACD,WAAW,EAAE,OAAO,CAAC,WAAW;KACnC,CAAA;IACD,MAAM,IAAA,eAAM,EAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;AACpE,CAAC,EAAE;IACC,oBAAoB,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAChC,aAAa,EAAE,CAAC,OAAO,CAAC,eAAe;KAC1C,CAAC;CACL,CAAC;KACG,SAAS,CAAC,mBAAmB,CAAC;KAC9B,WAAW,CAAC,qFAAqF,CAAC;KAClG,MAAM,CAAC,yBAAyB,EAAE,6BAA6B,CAAC;KAChE,MAAM,CAAC,wBAAwB,EAAE,8CAA8C,EAAE,KAAK,CAAC;KACvF,MAAM,CAAC,iBAAiB,EAAE,iCAAiC,EAAE,KAAK,CAAC;KACnE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
require("../src/logLevel");
|
|
5
|
+
const command_1 = require("../src/command");
|
|
6
|
+
const resend_1 = require("../src/resend");
|
|
7
|
+
(0, command_1.createClientCommand)(async (client, n, streamId, options) => {
|
|
8
|
+
if (isNaN(n)) {
|
|
9
|
+
console.error('argument n is not a number');
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
const resendOptions = {
|
|
13
|
+
last: parseInt(n)
|
|
14
|
+
};
|
|
15
|
+
await (0, resend_1.resend)(streamId, resendOptions, client, options.subscribe);
|
|
16
|
+
}, {
|
|
17
|
+
clientOptionsFactory: (options) => ({
|
|
18
|
+
orderMessages: !options.disableOrdering
|
|
19
|
+
})
|
|
20
|
+
})
|
|
21
|
+
.arguments('<n> <streamId>')
|
|
22
|
+
.description('request last N messages')
|
|
23
|
+
.option('-d, --disable-ordering', 'disable ordering of messages by OrderingUtil', false)
|
|
24
|
+
.option('-s, --subscribe', 'subscribe in addition to resend', false)
|
|
25
|
+
.parseAsync();
|
|
26
|
+
//# sourceMappingURL=streamr-stream-resend-last.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamr-stream-resend-last.js","sourceRoot":"","sources":["../../bin/streamr-stream-resend-last.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,4CAAoD;AACpD,0CAAsC;AAEtC,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,CAAS,EAAE,QAAgB,EAAE,OAAY,EAAE,EAAE;IAC3F,IAAI,KAAK,CAAC,CAAQ,CAAC,EAAE;QACjB,OAAO,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAA;QAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KAClB;IACD,MAAM,aAAa,GAAG;QAClB,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;KACpB,CAAA;IACD,MAAM,IAAA,eAAM,EAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;AACpE,CAAC,EAAE;IACC,oBAAoB,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAChC,aAAa,EAAE,CAAC,OAAO,CAAC,eAAe;KAC1C,CAAC;CACL,CAAC;KACG,SAAS,CAAC,gBAAgB,CAAC;KAC3B,WAAW,CAAC,yBAAyB,CAAC;KACtC,MAAM,CAAC,wBAAwB,EAAE,8CAA8C,EAAE,KAAK,CAAC;KACvF,MAAM,CAAC,iBAAiB,EAAE,iCAAiC,EAAE,KAAK,CAAC;KACnE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
require("../src/logLevel");
|
|
5
|
+
const command_1 = require("../src/command");
|
|
6
|
+
const resend_1 = require("../src/resend");
|
|
7
|
+
(0, command_1.createClientCommand)(async (client, from, to, streamId, options) => {
|
|
8
|
+
const resendOptions = {
|
|
9
|
+
from: {
|
|
10
|
+
timestamp: Date.parse(from),
|
|
11
|
+
sequenceNumber: 0
|
|
12
|
+
},
|
|
13
|
+
to: {
|
|
14
|
+
timestamp: Date.parse(to),
|
|
15
|
+
sequenceNumber: 0
|
|
16
|
+
},
|
|
17
|
+
publisherId: options.publisherId,
|
|
18
|
+
msgChainId: options.msgChainId
|
|
19
|
+
};
|
|
20
|
+
(0, resend_1.assertBothOrNoneDefined)('publisherId', 'msgChainId', '--publisher-id must be accompanied by option --msg-chain-id', options);
|
|
21
|
+
await (0, resend_1.resend)(streamId, resendOptions, client, false);
|
|
22
|
+
}, {
|
|
23
|
+
clientOptionsFactory: (options) => ({
|
|
24
|
+
orderMessages: !options.disableOrdering
|
|
25
|
+
})
|
|
26
|
+
})
|
|
27
|
+
.arguments('<from> <to> <streamId>')
|
|
28
|
+
.description('request messages between two given date-times (format: "YYYY-MM-DDTHH:mm:ss.sssZ")')
|
|
29
|
+
.option('--publisher-id <string>', 'filter results by publisher')
|
|
30
|
+
.option('--msg-chain-id <string>', 'filter results by message chain')
|
|
31
|
+
.option('-d, --disable-ordering', 'disable ordering of messages by OrderingUtil', false)
|
|
32
|
+
.parseAsync();
|
|
33
|
+
//# sourceMappingURL=streamr-stream-resend-range.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamr-stream-resend-range.js","sourceRoot":"","sources":["../../bin/streamr-stream-resend-range.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,4CAAoD;AACpD,0CAA+D;AAE/D,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,IAAY,EAAE,EAAU,EAAE,QAAgB,EAAE,OAAY,EAAE,EAAE;IAC1G,MAAM,aAAa,GAAG;QAClB,IAAI,EAAE;YACF,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YAC3B,cAAc,EAAE,CAAC;SACpB;QACD,EAAE,EAAE;YACA,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,cAAc,EAAE,CAAC;SACpB;QACD,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,UAAU,EAAE,OAAO,CAAC,UAAU;KACjC,CAAA;IACD,IAAA,gCAAuB,EAAC,aAAa,EAAE,YAAY,EAAE,6DAA6D,EAAE,OAAO,CAAC,CAAA;IAC5H,MAAM,IAAA,eAAM,EAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;AACxD,CAAC,EAAE;IACC,oBAAoB,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAChC,aAAa,EAAE,CAAC,OAAO,CAAC,eAAe;KAC1C,CAAC;CACL,CAAC;KACG,SAAS,CAAC,wBAAwB,CAAC;KACnC,WAAW,CAAC,oFAAoF,CAAC;KACjG,MAAM,CAAC,yBAAyB,EAAE,6BAA6B,CAAC;KAChE,MAAM,CAAC,yBAAyB,EAAE,iCAAiC,CAAC;KACpE,MAAM,CAAC,wBAAwB,EAAE,8CAA8C,EAAE,KAAK,CAAC;KACvF,UAAU,EAAE,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
import '../src/logLevel';
|
|
@@ -1,92 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const package_json_1 = __importDefault(require("../package.json"));
|
|
11
|
-
function assertBothOrNoneDefined(option1, option2, errorMessage, commandOptions) {
|
|
12
|
-
if ((option1 in commandOptions && !(option2 in commandOptions)) || (option2 in commandOptions && !(option1 in commandOptions))) {
|
|
13
|
-
console.error(`option ${errorMessage}`);
|
|
14
|
-
process.exit(1);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
const program = new commander_1.Command();
|
|
18
|
-
program
|
|
4
|
+
require("../src/logLevel");
|
|
5
|
+
const command_1 = require("../src/command");
|
|
6
|
+
(0, command_1.createCommand)()
|
|
19
7
|
.usage('<command> [<args>]')
|
|
20
|
-
.description('request resend of stream and print JSON messages to stdout line-by-line')
|
|
21
|
-
|
|
22
|
-
.command('last
|
|
23
|
-
.
|
|
24
|
-
.
|
|
25
|
-
.option('-s, --subscribe', 'subscribe in addition to resend', false)
|
|
26
|
-
.action((n, streamId, options, command) => {
|
|
27
|
-
if (isNaN(n)) {
|
|
28
|
-
console.error('argument n is not a number');
|
|
29
|
-
process.exit(1);
|
|
30
|
-
}
|
|
31
|
-
const resendOptions = {
|
|
32
|
-
last: parseInt(n)
|
|
33
|
-
};
|
|
34
|
-
const clientOptions = common_1.formStreamrOptionsWithEnv(command.parent.opts());
|
|
35
|
-
clientOptions.orderMessages = !options.disableOrdering;
|
|
36
|
-
clientOptions.subscribe = options.subscribe;
|
|
37
|
-
resend_1.resend(streamId, resendOptions, clientOptions);
|
|
38
|
-
});
|
|
39
|
-
program
|
|
40
|
-
.command('from <from> <streamId>')
|
|
41
|
-
.description('request messages starting from given date-time (format: "YYYY-MM-DDTHH:mm:ss.sssZ")')
|
|
42
|
-
.option('--publisher-id <string>', 'filter results by publisher')
|
|
43
|
-
.option('-d, --disable-ordering', 'disable ordering of messages by OrderingUtil', false)
|
|
44
|
-
.option('-s, --subscribe', 'subscribe in addition to resend', false)
|
|
45
|
-
.action((from, streamId, options, command) => {
|
|
46
|
-
const resendOptions = {
|
|
47
|
-
from: {
|
|
48
|
-
timestamp: Date.parse(from),
|
|
49
|
-
sequenceNumber: 0
|
|
50
|
-
},
|
|
51
|
-
publisherId: options.publisherId
|
|
52
|
-
};
|
|
53
|
-
const clientOptions = common_1.formStreamrOptionsWithEnv(command.parent.opts());
|
|
54
|
-
clientOptions.orderMessages = !options.disableOrdering;
|
|
55
|
-
clientOptions.subscribe = options.subscribe;
|
|
56
|
-
resend_1.resend(streamId, resendOptions, clientOptions);
|
|
57
|
-
});
|
|
58
|
-
program
|
|
59
|
-
.command('range <from> <to> <streamId>')
|
|
60
|
-
.description('request messages between two given date-times (format: "YYYY-MM-DDTHH:mm:ss.sssZ")')
|
|
61
|
-
.option('--publisher-id <string>', 'filter results by publisher')
|
|
62
|
-
.option('--msg-chain-id <string>', 'filter results by message chain')
|
|
63
|
-
.option('-d, --disable-ordering', 'disable ordering of messages by OrderingUtil', false)
|
|
64
|
-
.action((from, to, streamId, options, command) => {
|
|
65
|
-
const resendOptions = {
|
|
66
|
-
from: {
|
|
67
|
-
timestamp: Date.parse(from),
|
|
68
|
-
sequenceNumber: 0
|
|
69
|
-
},
|
|
70
|
-
to: {
|
|
71
|
-
timestamp: Date.parse(to),
|
|
72
|
-
sequenceNumber: 0
|
|
73
|
-
},
|
|
74
|
-
publisherId: options.publisherId,
|
|
75
|
-
msgChainId: options.msgChainId
|
|
76
|
-
};
|
|
77
|
-
assertBothOrNoneDefined('publisherId', 'msgChainId', '--publisher-id must be accompanied by option --msg-chain-id', options);
|
|
78
|
-
const clientOptions = common_1.formStreamrOptionsWithEnv(command.parent.opts());
|
|
79
|
-
clientOptions.orderMessages = !options.disableOrdering;
|
|
80
|
-
resend_1.resend(streamId, resendOptions, clientOptions);
|
|
81
|
-
});
|
|
82
|
-
program
|
|
83
|
-
.on('command:*', (invalidCommand) => {
|
|
84
|
-
console.error(`invalid command: ${invalidCommand}`);
|
|
85
|
-
process.exit(1);
|
|
86
|
-
});
|
|
87
|
-
common_1.authOptions(program);
|
|
88
|
-
common_1.envOptions(program)
|
|
89
|
-
.version(package_json_1.default.version)
|
|
90
|
-
.parse(process.argv);
|
|
91
|
-
common_1.exitWithHelpIfArgsNotBetween(program, 1, Number.MAX_VALUE);
|
|
8
|
+
.description('request resend of stream and print JSON messages to stdout line-by-line')
|
|
9
|
+
.command('from', 'request messages starting from given date-time')
|
|
10
|
+
.command('last', 'request last N messages')
|
|
11
|
+
.command('range', 'request messages between two given date-times')
|
|
12
|
+
.parse();
|
|
92
13
|
//# sourceMappingURL=streamr-stream-resend.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamr-stream-resend.js","sourceRoot":"","sources":["../../bin/streamr-stream-resend.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"streamr-stream-resend.js","sourceRoot":"","sources":["../../bin/streamr-stream-resend.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AACxB,4CAA8C;AAE9C,IAAA,uBAAa,GAAE;KACV,KAAK,CAAC,oBAAoB,CAAC;KAC3B,WAAW,CAAC,yEAAyE,CAAC;KACtF,OAAO,CAAC,MAAM,EAAE,gDAAgD,CAAC;KACjE,OAAO,CAAC,MAAM,EAAE,yBAAyB,CAAC;KAC1C,OAAO,CAAC,OAAO,EAAE,+CAA+C,CAAC;KACjE,KAAK,EAAE,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
import '../src/logLevel';
|
|
@@ -1,25 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
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);
|
|
4
|
+
require("../src/logLevel");
|
|
5
|
+
const permission_1 = require("../src/permission");
|
|
6
|
+
(0, permission_1.runModifyPermissionsCommand)((stream, permission, target) => stream.revokeUserPermission(permission, target), (stream, permission) => stream.revokePublicPermission(permission), 'revoke');
|
|
25
7
|
//# sourceMappingURL=streamr-stream-revoke-permission.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamr-stream-revoke-permission.js","sourceRoot":"","sources":["../../bin/streamr-stream-revoke-permission.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"streamr-stream-revoke-permission.js","sourceRoot":"","sources":["../../bin/streamr-stream-revoke-permission.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,kDAA+D;AAE/D,IAAA,wCAA2B,EACvB,CAAC,MAAc,EAAE,UAA4B,EAAE,MAAc,EAAE,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,UAAU,EAAE,MAAM,CAAC,EACjH,CAAC,MAAc,EAAE,UAA4B,EAAE,EAAE,CAAC,MAAM,CAAC,sBAAsB,CAAC,UAAU,CAAC,EAC3F,QAAQ,CACX,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
require("../src/logLevel");
|
|
8
|
+
const easy_table_1 = __importDefault(require("easy-table"));
|
|
9
|
+
const command_1 = require("../src/command");
|
|
10
|
+
(0, command_1.createClientCommand)(async (client, term) => {
|
|
11
|
+
const streams = await client.searchStreams(term);
|
|
12
|
+
if (streams.length > 0) {
|
|
13
|
+
console.info(easy_table_1.default.print(streams.map(({ id }) => ({
|
|
14
|
+
id
|
|
15
|
+
}))));
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
.arguments('<term>')
|
|
19
|
+
.description('search streams')
|
|
20
|
+
.parseAsync();
|
|
21
|
+
//# sourceMappingURL=streamr-stream-search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamr-stream-search.js","sourceRoot":"","sources":["../../bin/streamr-stream-search.ts"],"names":[],"mappings":";;;;;;AACA,2BAAwB;AACxB,4DAAkC;AAElC,4CAAoD;AAEpD,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,IAAY,EAAE,EAAE;IAC9D,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAA;IAChD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;QACpB,OAAO,CAAC,IAAI,CAAC,oBAAS,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAE,CAAC,CAAC;YAChD,EAAE;SACL,CAAC,CAAC,CAAC,CAAC,CAAA;KACR;AACL,CAAC,CAAC;KACG,SAAS,CAAC,QAAQ,CAAC;KACnB,WAAW,CAAC,gBAAgB,CAAC;KAC7B,UAAU,EAAE,CAAA"}
|