@streamr/cli-tools 5.0.0 → 6.0.0-alpha.2
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 +2 -0
- package/.eslintrc +6 -0
- package/CHANGELOG.md +20 -0
- 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 -22
- package/bin/streamr-storage-node-list-stream-parts.ts +18 -30
- package/bin/streamr-storage-node-list.ts +17 -36
- package/bin/streamr-storage-node-remove-stream.ts +8 -22
- package/bin/streamr-storage-node.ts +1 -1
- package/bin/streamr-stream-create.ts +17 -29
- package/bin/streamr-stream-grant-permission.ts +10 -0
- 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 -102
- package/bin/streamr-stream-revoke-permission.ts +10 -0
- 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 +3 -1
- package/bin/streamr.ts +1 -1
- package/dist/bin/streamr-mock-data-generate.d.ts +2 -0
- package/dist/bin/streamr-mock-data-generate.js +36 -9
- package/dist/bin/streamr-mock-data-generate.js.map +1 -0
- package/dist/bin/streamr-mock-data.d.ts +2 -0
- package/dist/bin/streamr-mock-data.js +2 -1
- package/dist/bin/streamr-mock-data.js.map +1 -0
- package/dist/bin/streamr-storage-node-add-stream.d.ts +2 -0
- package/dist/bin/streamr-storage-node-add-stream.js +9 -20
- package/dist/bin/streamr-storage-node-add-stream.js.map +1 -0
- package/dist/bin/streamr-storage-node-list-stream-parts.d.ts +2 -0
- package/dist/bin/streamr-storage-node-list-stream-parts.js +18 -24
- package/dist/bin/streamr-storage-node-list-stream-parts.js.map +1 -0
- package/dist/bin/streamr-storage-node-list.d.ts +2 -0
- package/dist/bin/streamr-storage-node-list.js +17 -30
- package/dist/bin/streamr-storage-node-list.js.map +1 -0
- package/dist/bin/streamr-storage-node-remove-stream.d.ts +2 -0
- package/dist/bin/streamr-storage-node-remove-stream.js +9 -20
- package/dist/bin/streamr-storage-node-remove-stream.js.map +1 -0
- package/dist/bin/streamr-storage-node.d.ts +2 -0
- package/dist/bin/streamr-storage-node.js +2 -1
- package/dist/bin/streamr-storage-node.js.map +1 -0
- package/dist/bin/streamr-stream-create.d.ts +2 -0
- package/dist/bin/streamr-stream-create.js +15 -23
- package/dist/bin/streamr-stream-create.js.map +1 -0
- package/dist/bin/streamr-stream-grant-permission.d.ts +2 -0
- package/dist/bin/streamr-stream-grant-permission.js +7 -0
- package/dist/bin/streamr-stream-grant-permission.js.map +1 -0
- package/dist/bin/streamr-stream-list.d.ts +2 -0
- package/dist/bin/streamr-stream-list.js +20 -18
- package/dist/bin/streamr-stream-list.js.map +1 -0
- package/dist/bin/streamr-stream-publish.d.ts +2 -0
- package/dist/bin/streamr-stream-publish.js +50 -23
- package/dist/bin/streamr-stream-publish.js.map +1 -0
- 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 +2 -0
- package/dist/bin/streamr-stream-resend.js +9 -97
- package/dist/bin/streamr-stream-resend.js.map +1 -0
- package/dist/bin/streamr-stream-revoke-permission.d.ts +2 -0
- package/dist/bin/streamr-stream-revoke-permission.js +7 -0
- package/dist/bin/streamr-stream-revoke-permission.js.map +1 -0
- 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 +2 -0
- package/dist/bin/streamr-stream-show.js +16 -15
- package/dist/bin/streamr-stream-show.js.map +1 -0
- package/dist/bin/streamr-stream-subscribe.d.ts +2 -0
- package/dist/bin/streamr-stream-subscribe.js +18 -20
- package/dist/bin/streamr-stream-subscribe.js.map +1 -0
- package/dist/bin/streamr-stream.d.ts +2 -0
- package/dist/bin/streamr-stream.js +4 -1
- package/dist/bin/streamr-stream.js.map +1 -0
- package/dist/bin/streamr.d.ts +2 -0
- package/dist/bin/streamr.js +2 -1
- package/dist/bin/streamr.js.map +1 -0
- package/dist/package.json +20 -9
- 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 -0
- package/dist/src/resend.js +13 -23
- package/dist/src/resend.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +20 -9
- 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 +22 -27
- package/tsconfig.json +13 -12
- package/bin/common.ts +0 -91
- package/bin/streamr-stream-list.ts +0 -29
- package/dist/bin/common.js +0 -76
- package/dist/src/create.js +0 -17
- package/dist/src/generate.js +0 -31
- package/dist/src/list.js +0 -27
- package/dist/src/publish.js +0 -35
- package/dist/src/show.js +0 -21
- package/dist/src/subscribe.js +0 -12
- package/src/create.ts +0 -15
- package/src/generate.ts +0 -30
- package/src/list.ts +0 -21
- package/src/publish.ts +0 -38
- package/src/show.ts +0 -18
- package/src/subscribe.ts +0 -9
|
@@ -4,29 +4,31 @@ 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
|
+
require("../src/logLevel");
|
|
7
8
|
const commander_1 = require("commander");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
program
|
|
13
|
-
.description('fetch a list of streams that are accessible by the authenticated user')
|
|
14
|
-
.option('-s, --search [term]', 'search for term in name or description')
|
|
15
|
-
.addOption(new commander_1.Option('-o, --operation [permission]', 'filter by permission').choices(['stream_get', 'stream_subscribe', 'stream_publish', 'stream_delete', 'stream_share']).default('stream_get'))
|
|
16
|
-
.option('--public-access', 'include publicly available streams')
|
|
17
|
-
.option('--no-granted-access', 'exclude streams that user has directly granted permissions to');
|
|
18
|
-
common_1.authOptions(program);
|
|
19
|
-
common_1.envOptions(program)
|
|
20
|
-
.version(package_json_1.default.version)
|
|
21
|
-
.action((options) => {
|
|
9
|
+
const easy_table_1 = __importDefault(require("easy-table"));
|
|
10
|
+
const command_1 = require("../src/command");
|
|
11
|
+
const permission_1 = require("../src/permission");
|
|
12
|
+
(0, command_1.createClientCommand)(async (client, options) => {
|
|
22
13
|
const query = {
|
|
23
|
-
|
|
14
|
+
permission: permission_1.PERMISSIONS.get(options.permission),
|
|
24
15
|
noConfig: true,
|
|
25
16
|
publicAccess: options.publicAccess,
|
|
26
17
|
search: options.search,
|
|
27
18
|
grantedAccess: options.grantedAccess
|
|
28
19
|
};
|
|
29
|
-
|
|
20
|
+
const streams = await client.listStreams(query);
|
|
21
|
+
if (streams.length > 0) {
|
|
22
|
+
console.info(easy_table_1.default.print(streams.map(({ id }) => ({
|
|
23
|
+
id
|
|
24
|
+
}))));
|
|
25
|
+
}
|
|
30
26
|
})
|
|
31
|
-
.
|
|
32
|
-
|
|
27
|
+
.description('fetch a list of streams that are accessible by the authenticated user')
|
|
28
|
+
.option('-s, --search [term]', 'search for term in name or description')
|
|
29
|
+
.addOption(new commander_1.Option('-p, --permission <permission>', 'filter by permission')
|
|
30
|
+
.choices(Array.from(permission_1.PERMISSIONS.keys())))
|
|
31
|
+
.option('--public-access', 'include publicly available streams')
|
|
32
|
+
.option('--no-granted-access', 'exclude streams that user has directly granted permissions to')
|
|
33
|
+
.parseAsync();
|
|
34
|
+
//# sourceMappingURL=streamr-stream-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamr-stream-list.js","sourceRoot":"","sources":["../../bin/streamr-stream-list.ts"],"names":[],"mappings":";;;;;;AACA,2BAAwB;AACxB,yCAAkC;AAClC,4DAAkC;AAElC,4CAAoD;AACpD,kDAA+C;AAE/C,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,OAAY,EAAE,EAAE;IAC9D,MAAM,KAAK,GAAoB;QAC3B,UAAU,EAAE,wBAAW,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC;QAC/C,QAAQ,EAAE,IAAI;QACd,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,aAAa,EAAE,OAAO,CAAC,aAAa;KACvC,CAAA;IACD,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;IAC/C,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,WAAW,CAAC,uEAAuE,CAAC;KACpF,MAAM,CAAC,qBAAqB,EAAE,wCAAwC,CAAC;KACvE,SAAS,CAAC,IAAI,kBAAM,CAAC,+BAA+B,EAAE,sBAAsB,CAAC;KACzE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,wBAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;KAC5C,MAAM,CAAC,iBAAiB,EAAE,oCAAoC,CAAC;KAC/D,MAAM,CAAC,qBAAqB,EAAE,+DAA+D,CAAC;KAC9F,UAAU,EAAE,CAAA"}
|
|
@@ -4,29 +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();
|
|
59
|
+
//# sourceMappingURL=streamr-stream-publish.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,101 +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 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
|
|
4
|
+
require("../src/logLevel");
|
|
5
|
+
const command_1 = require("../src/command");
|
|
6
|
+
(0, command_1.createCommand)()
|
|
29
7
|
.usage('<command> [<args>]')
|
|
30
|
-
.description('request resend of stream and print JSON messages to stdout line-by-line')
|
|
31
|
-
|
|
32
|
-
.command('last
|
|
33
|
-
.
|
|
34
|
-
.
|
|
35
|
-
|
|
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);
|
|
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();
|
|
13
|
+
//# sourceMappingURL=streamr-stream-resend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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');
|
|
7
|
+
//# sourceMappingURL=streamr-stream-revoke-permission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -4,20 +4,21 @@ 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
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
require("../src/logLevel");
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const command_1 = require("../src/command");
|
|
10
|
+
const permission_1 = require("../src/permission");
|
|
11
|
+
(0, command_1.createClientCommand)(async (client, streamId, options) => {
|
|
12
|
+
const stream = await client.getStream(streamId);
|
|
13
|
+
const obj = stream.toObject();
|
|
14
|
+
if (options.includePermissions) {
|
|
15
|
+
const permissions = await stream.getPermissions();
|
|
16
|
+
obj.permissions = lodash_1.default.mapValues(permissions, (p) => p.map(permission_1.getPermissionId));
|
|
17
|
+
}
|
|
18
|
+
console.info(JSON.stringify(obj, null, 2));
|
|
19
|
+
})
|
|
13
20
|
.arguments('<streamId>')
|
|
14
21
|
.description('show detailed information about a stream')
|
|
15
|
-
.option('--include-permissions', 'include list of permissions
|
|
16
|
-
|
|
17
|
-
|
|
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);
|
|
22
|
+
.option('--include-permissions', 'include list of permissions')
|
|
23
|
+
.parseAsync();
|
|
24
|
+
//# sourceMappingURL=streamr-stream-show.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamr-stream-show.js","sourceRoot":"","sources":["../../bin/streamr-stream-show.ts"],"names":[],"mappings":";;;;;;AACA,2BAAwB;AACxB,oDAAsB;AAEtB,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,QAAQ,EAAE,CAAA;IAClC,IAAI,OAAO,CAAC,kBAAkB,EAAE;QAC5B,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,cAAc,EAAE,CAAA;QACjD,GAAG,CAAC,WAAW,GAAG,gBAAC,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,CAAqB,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,4BAAe,CAAC,CAAC,CAAA;KAChG;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"}
|
|
@@ -1,25 +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 common_1 = require("
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
require("../src/logLevel");
|
|
5
|
+
const command_1 = require("../src/command");
|
|
6
|
+
const common_1 = require("../src/common");
|
|
7
|
+
(0, command_1.createClientCommand)(async (client, streamId, options) => {
|
|
8
|
+
await client.subscribe({
|
|
9
|
+
streamId,
|
|
10
|
+
partition: options.partition,
|
|
11
|
+
}, (message) => console.info(JSON.stringify(message)));
|
|
12
|
+
}, {
|
|
13
|
+
autoDestroyClient: false,
|
|
14
|
+
clientOptionsFactory: (options) => ({
|
|
15
|
+
orderMessages: !options.disableOrdering
|
|
16
|
+
})
|
|
17
|
+
})
|
|
13
18
|
.arguments('<streamId>')
|
|
14
19
|
.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
|
-
|
|
18
|
-
|
|
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);
|
|
20
|
+
.option('-p, --partition [partition]', 'partition', (0, common_1.createFnParseInt)('--partition'), 0)
|
|
21
|
+
.option('-d, --disable-ordering', 'disable ordering of messages by OrderingUtil', false)
|
|
22
|
+
.parseAsync();
|
|
23
|
+
//# sourceMappingURL=streamr-stream-subscribe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamr-stream-subscribe.js","sourceRoot":"","sources":["../../bin/streamr-stream-subscribe.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,4CAAoD;AACpD,0CAAgD;AAEhD,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,QAAgB,EAAE,OAAY,EAAE,EAAE;IAChF,MAAM,MAAM,CAAC,SAAS,CAAC;QACnB,QAAQ;QACR,SAAS,EAAE,OAAO,CAAC,SAAS;KAC/B,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AAC1D,CAAC,EAAE;IACC,iBAAiB,EAAE,KAAK;IACxB,oBAAoB,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAChC,aAAa,EAAE,CAAC,OAAO,CAAC,eAAe;KAC1C,CAAC;CACL,CAAC;KACG,SAAS,CAAC,YAAY,CAAC;KACvB,WAAW,CAAC,oEAAoE,CAAC;KACjF,MAAM,CAAC,6BAA6B,EAAE,WAAW,EAAE,IAAA,yBAAgB,EAAC,aAAa,CAAC,EAAE,CAAC,CAAC;KACtF,MAAM,CAAC,wBAAwB,EAAE,8CAA8C,EAAE,KAAK,CAAC;KACvF,UAAU,EAAE,CAAA"}
|
|
@@ -16,4 +16,7 @@ commander_1.program
|
|
|
16
16
|
.command('show', 'info about a stream')
|
|
17
17
|
.command("create", "create a new stream")
|
|
18
18
|
.command('resend', 'request resend of a stream')
|
|
19
|
-
.
|
|
19
|
+
.command('grant-permission', 'grant permission')
|
|
20
|
+
.command('revoke-permission', 'revoke permission')
|
|
21
|
+
.parse();
|
|
22
|
+
//# sourceMappingURL=streamr-stream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamr-stream.js","sourceRoot":"","sources":["../../bin/streamr-stream.ts"],"names":[],"mappings":";;;;;;AACA,yCAAmC;AACnC,mEAAiC;AAEjC,mBAAO;KACF,OAAO,CAAC,sBAAG,CAAC,OAAO,CAAC;KACpB,KAAK,CAAC,oBAAoB,CAAC;KAC3B,WAAW,CAAC,oBAAoB,CAAC;KACjC,OAAO,CAAC,WAAW,EAAE,uBAAuB,CAAC;KAC7C,OAAO,CAAC,SAAS,EAAE,qBAAqB,CAAC;KACzC,OAAO,CAAC,MAAM,EAAE,yBAAyB,CAAC;KAC1C,OAAO,CAAC,MAAM,EAAE,qBAAqB,CAAC;KACtC,OAAO,CAAC,QAAQ,EAAE,qBAAqB,CAAC;KACxC,OAAO,CAAC,QAAQ,EAAE,4BAA4B,CAAC;KAC/C,OAAO,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;KAC/C,OAAO,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;KACjD,KAAK,EAAE,CAAA"}
|
package/dist/bin/streamr.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamr.js","sourceRoot":"","sources":["../../bin/streamr.ts"],"names":[],"mappings":";;;;;;AACA,yCAAmC;AACnC,mEAAiC;AAEjC,mBAAO;KACF,OAAO,CAAC,sBAAG,CAAC,OAAO,CAAC;KACpB,KAAK,CAAC,iCAAiC,CAAC;KACxC,WAAW,CAAC,yEAAyE,CAAC;KACtF,OAAO,CAAC,QAAQ,EAAE,oBAAoB,CAAC;KACvC,OAAO,CAAC,cAAc,EAAE,0BAA0B,CAAC;KACnD,OAAO,CAAC,WAAW,EAAE,uBAAuB,CAAC;KAC7C,KAAK,EAAE,CAAA"}
|
package/dist/package.json
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamr/cli-tools",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-alpha.2",
|
|
4
4
|
"description": "Command line tools for Streamr.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"streamr": "dist/bin/streamr.js"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
|
-
"
|
|
10
|
-
"
|
|
9
|
+
"eslint": "eslint --cache --cache-location=node_modules/.cache/.eslintcache/ '*/**/*.{js,ts}'",
|
|
10
|
+
"prepare": "npm run eslint && npm run build",
|
|
11
|
+
"build": "tsc -b tsconfig.json",
|
|
11
12
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
12
13
|
},
|
|
13
14
|
"repository": {
|
|
14
15
|
"type": "git",
|
|
15
|
-
"url": "git
|
|
16
|
+
"url": "git+https://github.com/streamr-dev/network-monorepo.git",
|
|
17
|
+
"directory": "packages/cli-tools"
|
|
16
18
|
},
|
|
17
19
|
"keywords": [
|
|
18
20
|
"streamr",
|
|
@@ -27,16 +29,25 @@
|
|
|
27
29
|
},
|
|
28
30
|
"homepage": "https://github.com/streamr-dev/cli-tools#readme",
|
|
29
31
|
"dependencies": {
|
|
30
|
-
"commander": "^
|
|
32
|
+
"commander": "^8.3.0",
|
|
31
33
|
"easy-table": "^1.1.1",
|
|
32
34
|
"event-stream": "^4.0.1",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
35
|
+
"lodash": "^4.17.21",
|
|
36
|
+
"streamr-client": "^6.0.0-alpha.24",
|
|
37
|
+
"streamr-client-protocol": "^11.0.0",
|
|
38
|
+
"streamr-test-utils": "^2.0.0"
|
|
36
39
|
},
|
|
37
40
|
"devDependencies": {
|
|
41
|
+
"@streamr/dev-config": "^1.0.0",
|
|
38
42
|
"@types/easy-table": "0.0.32",
|
|
39
43
|
"@types/event-stream": "^3.3.34",
|
|
40
|
-
"@types/
|
|
44
|
+
"@types/jest": "^27.0.2",
|
|
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"
|
|
41
52
|
}
|
|
42
53
|
}
|