@gibme/mikrotik 2.0.1 → 2.0.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/dist/index.d.ts +2 -2
- package/dist/index.js +9 -2
- package/dist/types.d.ts +8 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -108,12 +108,12 @@ export default class Mikrotik extends SSH {
|
|
|
108
108
|
* @param command
|
|
109
109
|
* @protected
|
|
110
110
|
*/
|
|
111
|
-
|
|
111
|
+
terse<Type extends object = any>(command: string): Promise<Type[]>;
|
|
112
112
|
/**
|
|
113
113
|
* Executes a command that expects the result as a 'table' of key-value pairs separated by a colon (:)
|
|
114
114
|
*
|
|
115
115
|
* @param command
|
|
116
116
|
* @protected
|
|
117
117
|
*/
|
|
118
|
-
|
|
118
|
+
kvs<Type extends object = any>(command: string): Promise<Type>;
|
|
119
119
|
}
|
package/dist/index.js
CHANGED
|
@@ -380,10 +380,17 @@ class Mikrotik extends ssh_1.default {
|
|
|
380
380
|
yield Mikrotik.cache.del(target);
|
|
381
381
|
});
|
|
382
382
|
yield Mikrotik.cache.set(target, target, options.duration); // set our mutex
|
|
383
|
-
|
|
383
|
+
let command = `/tool bandwidth-test protocol=${options.protocol} ` +
|
|
384
384
|
`user=${username} password=${password} ` +
|
|
385
385
|
`duration=${options.duration}s direction=${options.direction} ` +
|
|
386
|
-
`address=${target} random-data=${options.random_data ? 'yes' : 'no'} interval=1s
|
|
386
|
+
`address=${target} random-data=${options.random_data ? 'yes' : 'no'} interval=1s`;
|
|
387
|
+
if (options.local_tx_speed) {
|
|
388
|
+
command += ` local-tx-speed=${options.local_tx_speed}M`;
|
|
389
|
+
}
|
|
390
|
+
if (options.remote_tx_speed) {
|
|
391
|
+
command += ` remote-tx-speed=${options.remote_tx_speed}M`;
|
|
392
|
+
}
|
|
393
|
+
const cancel = yield this.stream(command, {
|
|
387
394
|
separator: '\r\n\r\n'
|
|
388
395
|
});
|
|
389
396
|
this.once('stream_complete', () => __awaiter(this, void 0, void 0, function* () {
|
package/dist/types.d.ts
CHANGED
|
@@ -36,6 +36,14 @@ export declare namespace BandwidthTest {
|
|
|
36
36
|
random_data: boolean;
|
|
37
37
|
callback: (frame: Update) => void;
|
|
38
38
|
timeout: number;
|
|
39
|
+
/**
|
|
40
|
+
* In Megabits
|
|
41
|
+
*/
|
|
42
|
+
local_tx_speed: number;
|
|
43
|
+
/**
|
|
44
|
+
* In Megabits
|
|
45
|
+
*/
|
|
46
|
+
remote_tx_speed: number;
|
|
39
47
|
}
|
|
40
48
|
export {};
|
|
41
49
|
}
|