@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 CHANGED
@@ -108,12 +108,12 @@ export default class Mikrotik extends SSH {
108
108
  * @param command
109
109
  * @protected
110
110
  */
111
- protected terse<Type extends object = any>(command: string): Promise<Type[]>;
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
- protected kvs<Type extends object = any>(command: string): Promise<Type>;
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
- const cancel = yield this.stream(`/tool bandwidth-test protocol=${options.protocol} ` +
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gibme/mikrotik",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "A simple mikrotik helper/wrapper",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",