motion-master-client 0.0.76 → 0.0.85

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.
Files changed (85) hide show
  1. package/README.md +227 -138
  2. package/package.json +1 -1
  3. package/src/cli.d.ts +1 -1
  4. package/src/cli.js +160 -160
  5. package/src/index.d.ts +30 -28
  6. package/src/index.js +33 -31
  7. package/src/index.js.map +1 -1
  8. package/src/lib/cia402.d.ts +184 -182
  9. package/src/lib/cia402.js +393 -391
  10. package/src/lib/cia402.js.map +1 -1
  11. package/src/lib/config-file.d.ts +13 -13
  12. package/src/lib/config-file.js +49 -49
  13. package/src/lib/data-monitoring.d.ts +12 -12
  14. package/src/lib/data-monitoring.js +33 -33
  15. package/src/lib/device-log-line.d.ts +5 -5
  16. package/src/lib/device-log-line.js +2 -2
  17. package/src/lib/device-parameter.d.ts +56 -56
  18. package/src/lib/device-parameter.js +38 -38
  19. package/src/lib/device.d.ts +46 -9
  20. package/src/lib/device.js +166 -2
  21. package/src/lib/device.js.map +1 -1
  22. package/src/lib/encoder-register.d.ts +16 -16
  23. package/src/lib/encoder-register.js +116 -116
  24. package/src/lib/hardware-description.d.ts +46 -46
  25. package/src/lib/hardware-description.js +109 -109
  26. package/src/lib/integro-encoder-calibration.d.ts +31 -0
  27. package/src/lib/integro-encoder-calibration.js +196 -0
  28. package/src/lib/integro-encoder-calibration.js.map +1 -0
  29. package/src/lib/logger.d.ts +1 -1
  30. package/src/lib/logger.js +7 -7
  31. package/src/lib/monitoring-config.d.ts +31 -31
  32. package/src/lib/monitoring-config.js +2 -2
  33. package/src/lib/monitoring-entry.d.ts +9 -9
  34. package/src/lib/monitoring-entry.js +2 -2
  35. package/src/lib/motion-master-client.d.ts +77 -77
  36. package/src/lib/motion-master-client.js +196 -196
  37. package/src/lib/motion-master-pub-sub-client.d.ts +17 -17
  38. package/src/lib/motion-master-pub-sub-client.js +72 -72
  39. package/src/lib/motion-master-pub-sub-client.js.map +1 -1
  40. package/src/lib/motion-master-pub-sub-socket.d.ts +42 -42
  41. package/src/lib/motion-master-pub-sub-socket.js +2 -2
  42. package/src/lib/motion-master-pub-sub-web-socket.d.ts +18 -18
  43. package/src/lib/motion-master-pub-sub-web-socket.js +65 -65
  44. package/src/lib/motion-master-pub-sub-worker-socket.d.ts +18 -18
  45. package/src/lib/motion-master-pub-sub-worker-socket.js +47 -47
  46. package/src/lib/motion-master-req-res-client.d.ts +1104 -1062
  47. package/src/lib/motion-master-req-res-client.js +2137 -1992
  48. package/src/lib/motion-master-req-res-client.js.map +1 -1
  49. package/src/lib/motion-master-req-res-socket.d.ts +60 -60
  50. package/src/lib/motion-master-req-res-socket.js +2 -2
  51. package/src/lib/motion-master-req-res-web-socket.d.ts +28 -28
  52. package/src/lib/motion-master-req-res-web-socket.js +97 -97
  53. package/src/lib/motion-master-req-res-worker-socket.d.ts +24 -24
  54. package/src/lib/motion-master-req-res-worker-socket.js +71 -71
  55. package/src/lib/motion-master.proto.d.ts +5183 -5183
  56. package/src/lib/motion-master.proto.js +53218 -53218
  57. package/src/lib/operators.d.ts +20 -20
  58. package/src/lib/operators.js +82 -83
  59. package/src/lib/operators.js.map +1 -1
  60. package/src/lib/options.d.ts +10 -10
  61. package/src/lib/options.js +13 -13
  62. package/src/lib/os-command.d.ts +387 -173
  63. package/src/lib/os-command.js +555 -269
  64. package/src/lib/os-command.js.map +1 -1
  65. package/src/lib/parameter.d.ts +156 -138
  66. package/src/lib/parameter.js +377 -152
  67. package/src/lib/parameter.js.map +1 -1
  68. package/src/lib/product-id-range.d.ts +7 -7
  69. package/src/lib/product-id-range.js +11 -11
  70. package/src/lib/request-status-resolver.d.ts +4 -4
  71. package/src/lib/request-status-resolver.js +344 -344
  72. package/src/lib/somanet-product.d.ts +37 -0
  73. package/src/lib/somanet-product.js +126 -0
  74. package/src/lib/somanet-product.js.map +1 -0
  75. package/src/lib/system-log-line.d.ts +9 -9
  76. package/src/lib/system-log-line.js +2 -2
  77. package/src/lib/types.d.ts +141 -141
  78. package/src/lib/types.js +28 -28
  79. package/src/lib/urls.d.ts +3 -3
  80. package/src/lib/urls.js +9 -9
  81. package/src/lib/util.d.ts +21 -45
  82. package/src/lib/util.js +113 -379
  83. package/src/lib/util.js.map +1 -1
  84. package/src/lib/web-socket-connection-close-codes.d.ts +8 -8
  85. package/src/lib/web-socket-connection-close-codes.js +88 -88
package/src/cli.js CHANGED
@@ -1,161 +1,161 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const commander_1 = require("commander");
5
- const index_1 = require("./index");
6
- const rxjs_1 = require("rxjs");
7
- const fs_1 = require("fs");
8
- const pkg = require("../package.json");
9
- Object.assign(globalThis, { WebSocket: require('ws') });
10
- let client;
11
- let opts;
12
- let deviceRefObj;
13
- function getClient() {
14
- if (!client) {
15
- opts = commander_1.program.opts();
16
- deviceRefObj = (0, index_1.makeDeviceRefObj)(opts['deviceRef']);
17
- client = (0, index_1.createMotionMasterClient)(opts['hostname']);
18
- }
19
- return client;
20
- }
21
- function logStringified(status) {
22
- console.log(JSON.stringify(status, null, 2));
23
- }
24
- commander_1.program
25
- .name('motion-master-client')
26
- .description('CLI to Motion Master API')
27
- .version(pkg.version)
28
- .addOption(new commander_1.Option('-s, --hostname <value>', 'connect to a running Motion Master process (e.g., localhost, 192.168.123.456, oblac-drives-76d3c210.local)')
29
- .default('localhost'))
30
- .addOption(new commander_1.Option('-f, --format <value>', 'print the output in a format such as CSV, JSON, and so on')
31
- .choices(['csv']))
32
- .addOption(new commander_1.Option('-p, --pretty-print', 'print the output in a more readable form, which is useful for requests that involve progress')
33
- .default(false)
34
- .conflicts('format'))
35
- .addOption(new commander_1.Option('-d, --device-ref <value>', 'position, address, or serial number')
36
- .default(0, '0 position represents the first device in a network chain')
37
- .argParser((value) => {
38
- const n = Number(value);
39
- return isNaN(n) ? value : n;
40
- }))
41
- .addOption(new commander_1.Option('-m, --message-id <value>', 'the message ID, which uniquely identifies the request, will be generated by the client library if not specified'))
42
- .addOption(new commander_1.Option('-t, --request-timeout <value>', 'after sending a request, how long will the client wait for Motion Master to send the status message back')
43
- .argParser((value) => {
44
- const n = Number(value);
45
- if (!Number.isInteger(n)) {
46
- throw new Error(`The request timeout option must be an integer. The provided value is: ${value}`);
47
- }
48
- return n;
49
- }));
50
- const getSystemVersionCommand = new commander_1.Command('getSystemVersion').action(() => getClient().whenReady().then(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
51
- var _a;
52
- const status = yield (0, rxjs_1.lastValueFrom)(client.request.getSystemVersion((_a = opts['requestTimeout']) !== null && _a !== void 0 ? _a : 3000, opts['messageId']));
53
- if (opts['prettyPrint']) {
54
- console.log(status === null || status === void 0 ? void 0 : status.version);
55
- }
56
- else {
57
- logStringified(status);
58
- }
59
- })).finally(() => client.closeSockets()));
60
- const getDeviceInfoCommand = new commander_1.Command('getDeviceInfo').action(() => getClient().whenReady().then(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
61
- var _b, _c;
62
- const status = yield (0, rxjs_1.lastValueFrom)(client.request.getDeviceInfo((_b = opts['requestTimeout']) !== null && _b !== void 0 ? _b : 5000, opts['messageId']));
63
- if (opts['format'] === 'csv') {
64
- console.log(['deviceAddress', 'type', 'position', 'alias'].join(','));
65
- (_c = status === null || status === void 0 ? void 0 : status.devices) === null || _c === void 0 ? void 0 : _c.forEach((device) => console.log([device.deviceAddress, device.type, device.position, device.alias].join(',')));
66
- }
67
- else {
68
- logStringified(status);
69
- }
70
- })).finally(() => client.closeSockets()));
71
- const getDeviceParameterInfoCommand = new commander_1.Command('getDeviceParameterInfo').action(() => getClient().whenReady().then(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
72
- var _d, _e;
73
- const status = yield (0, rxjs_1.lastValueFrom)(client.request.getDeviceParameterInfo(Object.assign({}, deviceRefObj), (_d = opts['requestTimeout']) !== null && _d !== void 0 ? _d : 10000, opts['messageId']));
74
- if (opts['format'] === 'csv') {
75
- console.log(['index', 'subindex', 'name', 'unit', 'group', 'readAccess', 'writeAccess', 'min', 'max', 'valueType'].join(','));
76
- (_e = status.parameters) === null || _e === void 0 ? void 0 : _e.forEach((p) => console.log([p.index, p.subindex, p.name, p.unit, p.group, p.readAccess, p.writeAccess, p.min, p.max, p.valueType].join(',')));
77
- }
78
- else {
79
- logStringified(status);
80
- }
81
- })).finally(() => client.closeSockets()));
82
- const getDeviceParameterValuesCommand = new commander_1.Command('getDeviceParameterValues')
83
- .addOption(new commander_1.Option('--load-from-cache', 'load parameter values from the Motion Master cache').default(false))
84
- .addOption(new commander_1.Option('--send-progress', 'send progress while retrieving the parameter values from the device').default(false))
85
- .addArgument(new commander_1.Argument('<parameterIds...>', 'space-separated list of parameter ids, e.g. 0x2030:01 0x2110:0C'))
86
- .action((ids, { loadFromCache, sendProgress }) => {
87
- const parameters = ids.reduce((arr, id) => {
88
- const [index, subindex] = (0, index_1.splitParameterId)(id.trim());
89
- arr.push({ index, subindex, loadFromCache });
90
- return arr;
91
- }, []);
92
- getClient().onceReady$.pipe((0, rxjs_1.mergeMap)(() => { var _a; return client.request.getDeviceParameterValues(Object.assign(Object.assign({}, deviceRefObj), { parameters, sendProgress }), (_a = opts['requestTimeout']) !== null && _a !== void 0 ? _a : 30000, opts['messageId']); })).subscribe({
93
- next: (status) => {
94
- var _a;
95
- if (opts['format'] === 'csv') {
96
- console.log(['index', 'subindex', 'typeValue', 'intValue', 'uintValue', 'floatValue', 'stringValue', 'rawValue'].join(','));
97
- (_a = status.parameterValues) === null || _a === void 0 ? void 0 : _a.forEach((p) => console.log([p.index, p.subindex, p === null || p === void 0 ? void 0 : p.typeValue, p.intValue, p.uintValue, p.floatValue, p.stringValue, p.rawValue].join(',')));
98
- }
99
- else {
100
- logStringified(status);
101
- }
102
- },
103
- complete: () => client.closeSockets(),
104
- });
105
- });
106
- const getDeviceFileCommand = new commander_1.Command('getDeviceFile')
107
- .addArgument(new commander_1.Argument('<name>', 'name of the file to retrieve'))
108
- .action((name) => {
109
- getClient().whenReady().then(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
110
- var _a;
111
- const status = yield (0, rxjs_1.lastValueFrom)(client.request.getDeviceFile(Object.assign(Object.assign({}, deviceRefObj), { name }), (_a = opts['requestTimeout']) !== null && _a !== void 0 ? _a : 5000, opts['messageId']));
112
- if (opts['prettyPrint']) {
113
- if (status.content) {
114
- console.log((0, index_1.decodeTextContent)(status.content));
115
- }
116
- else {
117
- console.log(`No content for '${name}'`);
118
- }
119
- }
120
- else {
121
- logStringified(status);
122
- }
123
- })).finally(() => client.closeSockets());
124
- });
125
- const setDeviceFileCommand = new commander_1.Command('setDeviceFile')
126
- .addArgument(new commander_1.Argument('<name>', 'name of the file to write to the device'))
127
- .addArgument(new commander_1.Argument('<srcPath>', 'path to a file on your computer to read the content from and write to the device'))
128
- .addOption(new commander_1.Option('--overwrite', 'overwrite the existing file on the device with the same name').default(false))
129
- .action((name, srcPath, { overwrite }) => {
130
- const content = Buffer.from((0, fs_1.readFileSync)(srcPath, { encoding: 'utf-8' }), 'utf-8');
131
- getClient().whenReady().then(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
132
- var _a;
133
- const status = yield (0, rxjs_1.lastValueFrom)(client.request.setDeviceFile(Object.assign(Object.assign({}, deviceRefObj), { name, content, overwrite }), (_a = opts['requestTimeout']) !== null && _a !== void 0 ? _a : 5000, opts['messageId']));
134
- logStringified(status);
135
- })).finally(() => client.closeSockets());
136
- });
137
- const startOffsetDetectionCommand = new commander_1.Command('startOffsetDetection').action(() => {
138
- getClient().onceReady$.pipe((0, rxjs_1.mergeMap)(() => { var _a; return client.request.startOffsetDetection(Object.assign({}, deviceRefObj), (_a = opts['requestTimeout']) !== null && _a !== void 0 ? _a : 60000, opts['messageId']); })).subscribe({
139
- next: (status) => {
140
- var _a, _b, _c, _d;
141
- if (opts['prettyPrint']) {
142
- const step = index_1.MotionMasterMessage.Status.OffsetDetection.Progress.Code[(_b = (_a = status.progress) === null || _a === void 0 ? void 0 : _a.code) !== null && _b !== void 0 ? _b : 0];
143
- console.log(`${step} (${(_d = (_c = status.progress) === null || _c === void 0 ? void 0 : _c.percentage) !== null && _d !== void 0 ? _d : 0}%)`);
144
- }
145
- else {
146
- logStringified(status);
147
- }
148
- },
149
- complete: () => client.closeSockets(),
150
- });
151
- });
152
- commander_1.program
153
- .addCommand(getSystemVersionCommand)
154
- .addCommand(getDeviceInfoCommand)
155
- .addCommand(getDeviceParameterInfoCommand)
156
- .addCommand(getDeviceParameterValuesCommand)
157
- .addCommand(getDeviceFileCommand)
158
- .addCommand(setDeviceFileCommand)
159
- .addCommand(startOffsetDetectionCommand);
160
- commander_1.program.parse();
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const commander_1 = require("commander");
5
+ const index_1 = require("./index");
6
+ const rxjs_1 = require("rxjs");
7
+ const fs_1 = require("fs");
8
+ const pkg = require("../package.json");
9
+ Object.assign(globalThis, { WebSocket: require('ws') });
10
+ let client;
11
+ let opts;
12
+ let deviceRefObj;
13
+ function getClient() {
14
+ if (!client) {
15
+ opts = commander_1.program.opts();
16
+ deviceRefObj = (0, index_1.makeDeviceRefObj)(opts['deviceRef']);
17
+ client = (0, index_1.createMotionMasterClient)(opts['hostname']);
18
+ }
19
+ return client;
20
+ }
21
+ function logStringified(status) {
22
+ console.log(JSON.stringify(status, null, 2));
23
+ }
24
+ commander_1.program
25
+ .name('motion-master-client')
26
+ .description('CLI to Motion Master API')
27
+ .version(pkg.version)
28
+ .addOption(new commander_1.Option('-s, --hostname <value>', 'connect to a running Motion Master process (e.g., localhost, 192.168.123.456, oblac-drives-76d3c210.local)')
29
+ .default('localhost'))
30
+ .addOption(new commander_1.Option('-f, --format <value>', 'print the output in a format such as CSV, JSON, and so on')
31
+ .choices(['csv']))
32
+ .addOption(new commander_1.Option('-p, --pretty-print', 'print the output in a more readable form, which is useful for requests that involve progress')
33
+ .default(false)
34
+ .conflicts('format'))
35
+ .addOption(new commander_1.Option('-d, --device-ref <value>', 'position, address, or serial number')
36
+ .default(0, '0 position represents the first device in a network chain')
37
+ .argParser((value) => {
38
+ const n = Number(value);
39
+ return isNaN(n) ? value : n;
40
+ }))
41
+ .addOption(new commander_1.Option('-m, --message-id <value>', 'the message ID, which uniquely identifies the request, will be generated by the client library if not specified'))
42
+ .addOption(new commander_1.Option('-t, --request-timeout <value>', 'after sending a request, how long will the client wait for Motion Master to send the status message back')
43
+ .argParser((value) => {
44
+ const n = Number(value);
45
+ if (!Number.isInteger(n)) {
46
+ throw new Error(`The request timeout option must be an integer. The provided value is: ${value}`);
47
+ }
48
+ return n;
49
+ }));
50
+ const getSystemVersionCommand = new commander_1.Command('getSystemVersion').action(() => getClient().whenReady().then(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
51
+ var _a;
52
+ const status = yield (0, rxjs_1.lastValueFrom)(client.request.getSystemVersion((_a = opts['requestTimeout']) !== null && _a !== void 0 ? _a : 3000, opts['messageId']));
53
+ if (opts['prettyPrint']) {
54
+ console.log(status === null || status === void 0 ? void 0 : status.version);
55
+ }
56
+ else {
57
+ logStringified(status);
58
+ }
59
+ })).finally(() => client.closeSockets()));
60
+ const getDeviceInfoCommand = new commander_1.Command('getDeviceInfo').action(() => getClient().whenReady().then(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
61
+ var _b, _c;
62
+ const status = yield (0, rxjs_1.lastValueFrom)(client.request.getDeviceInfo((_b = opts['requestTimeout']) !== null && _b !== void 0 ? _b : 5000, opts['messageId']));
63
+ if (opts['format'] === 'csv') {
64
+ console.log(['deviceAddress', 'type', 'position', 'alias'].join(','));
65
+ (_c = status === null || status === void 0 ? void 0 : status.devices) === null || _c === void 0 ? void 0 : _c.forEach((device) => console.log([device.deviceAddress, device.type, device.position, device.alias].join(',')));
66
+ }
67
+ else {
68
+ logStringified(status);
69
+ }
70
+ })).finally(() => client.closeSockets()));
71
+ const getDeviceParameterInfoCommand = new commander_1.Command('getDeviceParameterInfo').action(() => getClient().whenReady().then(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
72
+ var _d, _e;
73
+ const status = yield (0, rxjs_1.lastValueFrom)(client.request.getDeviceParameterInfo(Object.assign({}, deviceRefObj), (_d = opts['requestTimeout']) !== null && _d !== void 0 ? _d : 10000, opts['messageId']));
74
+ if (opts['format'] === 'csv') {
75
+ console.log(['index', 'subindex', 'name', 'unit', 'group', 'readAccess', 'writeAccess', 'min', 'max', 'valueType'].join(','));
76
+ (_e = status.parameters) === null || _e === void 0 ? void 0 : _e.forEach((p) => console.log([p.index, p.subindex, p.name, p.unit, p.group, p.readAccess, p.writeAccess, p.min, p.max, p.valueType].join(',')));
77
+ }
78
+ else {
79
+ logStringified(status);
80
+ }
81
+ })).finally(() => client.closeSockets()));
82
+ const getDeviceParameterValuesCommand = new commander_1.Command('getDeviceParameterValues')
83
+ .addOption(new commander_1.Option('--load-from-cache', 'load parameter values from the Motion Master cache').default(false))
84
+ .addOption(new commander_1.Option('--send-progress', 'send progress while retrieving the parameter values from the device').default(false))
85
+ .addArgument(new commander_1.Argument('<parameterIds...>', 'space-separated list of parameter ids, e.g. 0x2030:01 0x2110:0C'))
86
+ .action((ids, { loadFromCache, sendProgress }) => {
87
+ const parameters = ids.reduce((arr, id) => {
88
+ const [index, subindex] = (0, index_1.splitParameterId)(id.trim());
89
+ arr.push({ index, subindex, loadFromCache });
90
+ return arr;
91
+ }, []);
92
+ getClient().onceReady$.pipe((0, rxjs_1.mergeMap)(() => { var _a; return client.request.getDeviceParameterValues(Object.assign(Object.assign({}, deviceRefObj), { parameters, sendProgress }), (_a = opts['requestTimeout']) !== null && _a !== void 0 ? _a : 30000, opts['messageId']); })).subscribe({
93
+ next: (status) => {
94
+ var _a;
95
+ if (opts['format'] === 'csv') {
96
+ console.log(['index', 'subindex', 'typeValue', 'intValue', 'uintValue', 'floatValue', 'stringValue', 'rawValue'].join(','));
97
+ (_a = status.parameterValues) === null || _a === void 0 ? void 0 : _a.forEach((p) => console.log([p.index, p.subindex, p === null || p === void 0 ? void 0 : p.typeValue, p.intValue, p.uintValue, p.floatValue, p.stringValue, p.rawValue].join(',')));
98
+ }
99
+ else {
100
+ logStringified(status);
101
+ }
102
+ },
103
+ complete: () => client.closeSockets(),
104
+ });
105
+ });
106
+ const getDeviceFileCommand = new commander_1.Command('getDeviceFile')
107
+ .addArgument(new commander_1.Argument('<name>', 'name of the file to retrieve'))
108
+ .action((name) => {
109
+ getClient().whenReady().then(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
110
+ var _a;
111
+ const status = yield (0, rxjs_1.lastValueFrom)(client.request.getDeviceFile(Object.assign(Object.assign({}, deviceRefObj), { name }), (_a = opts['requestTimeout']) !== null && _a !== void 0 ? _a : 5000, opts['messageId']));
112
+ if (opts['prettyPrint']) {
113
+ if (status.content) {
114
+ console.log((0, index_1.decodeTextContent)(status.content));
115
+ }
116
+ else {
117
+ console.log(`No content for '${name}'`);
118
+ }
119
+ }
120
+ else {
121
+ logStringified(status);
122
+ }
123
+ })).finally(() => client.closeSockets());
124
+ });
125
+ const setDeviceFileCommand = new commander_1.Command('setDeviceFile')
126
+ .addArgument(new commander_1.Argument('<name>', 'name of the file to write to the device'))
127
+ .addArgument(new commander_1.Argument('<srcPath>', 'path to a file on your computer to read the content from and write to the device'))
128
+ .addOption(new commander_1.Option('--overwrite', 'overwrite the existing file on the device with the same name').default(false))
129
+ .action((name, srcPath, { overwrite }) => {
130
+ const content = Buffer.from((0, fs_1.readFileSync)(srcPath, { encoding: 'utf-8' }), 'utf-8');
131
+ getClient().whenReady().then(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
132
+ var _a;
133
+ const status = yield (0, rxjs_1.lastValueFrom)(client.request.setDeviceFile(Object.assign(Object.assign({}, deviceRefObj), { name, content, overwrite }), (_a = opts['requestTimeout']) !== null && _a !== void 0 ? _a : 5000, opts['messageId']));
134
+ logStringified(status);
135
+ })).finally(() => client.closeSockets());
136
+ });
137
+ const startOffsetDetectionCommand = new commander_1.Command('startOffsetDetection').action(() => {
138
+ getClient().onceReady$.pipe((0, rxjs_1.mergeMap)(() => { var _a; return client.request.startOffsetDetection(Object.assign({}, deviceRefObj), (_a = opts['requestTimeout']) !== null && _a !== void 0 ? _a : 60000, opts['messageId']); })).subscribe({
139
+ next: (status) => {
140
+ var _a, _b, _c, _d;
141
+ if (opts['prettyPrint']) {
142
+ const step = index_1.MotionMasterMessage.Status.OffsetDetection.Progress.Code[(_b = (_a = status.progress) === null || _a === void 0 ? void 0 : _a.code) !== null && _b !== void 0 ? _b : 0];
143
+ console.log(`${step} (${(_d = (_c = status.progress) === null || _c === void 0 ? void 0 : _c.percentage) !== null && _d !== void 0 ? _d : 0}%)`);
144
+ }
145
+ else {
146
+ logStringified(status);
147
+ }
148
+ },
149
+ complete: () => client.closeSockets(),
150
+ });
151
+ });
152
+ commander_1.program
153
+ .addCommand(getSystemVersionCommand)
154
+ .addCommand(getDeviceInfoCommand)
155
+ .addCommand(getDeviceParameterInfoCommand)
156
+ .addCommand(getDeviceParameterValuesCommand)
157
+ .addCommand(getDeviceFileCommand)
158
+ .addCommand(setDeviceFileCommand)
159
+ .addCommand(startOffsetDetectionCommand);
160
+ commander_1.program.parse();
161
161
  //# sourceMappingURL=cli.js.map
package/src/index.d.ts CHANGED
@@ -1,28 +1,30 @@
1
- export * from './lib/cia402';
2
- export * from './lib/config-file';
3
- export * from './lib/data-monitoring';
4
- export * from './lib/device-log-line';
5
- export * from './lib/device-parameter';
6
- export * from './lib/device';
7
- export * from './lib/hardware-description';
8
- export * from './lib/monitoring-config';
9
- export * from './lib/monitoring-entry';
10
- export * from './lib/motion-master-client';
11
- export * from './lib/motion-master-pub-sub-client';
12
- export * from './lib/motion-master-pub-sub-socket';
13
- export * from './lib/motion-master-pub-sub-web-socket';
14
- export * from './lib/motion-master-pub-sub-worker-socket';
15
- export * from './lib/motion-master-req-res-client';
16
- export * from './lib/motion-master-req-res-socket';
17
- export * from './lib/motion-master-req-res-web-socket';
18
- export * from './lib/motion-master-req-res-worker-socket';
19
- export * from './lib/operators';
20
- export * from './lib/options';
21
- export * from './lib/os-command';
22
- export * from './lib/parameter';
23
- export * from './lib/request-status-resolver';
24
- export * from './lib/system-log-line';
25
- export * from './lib/types';
26
- export * from './lib/urls';
27
- export * from './lib/util';
28
- export * from './lib/web-socket-connection-close-codes';
1
+ export * from './lib/cia402';
2
+ export * from './lib/config-file';
3
+ export * from './lib/data-monitoring';
4
+ export * from './lib/device-log-line';
5
+ export * from './lib/device-parameter';
6
+ export * from './lib/device';
7
+ export * from './lib/hardware-description';
8
+ export * from './lib/integro-encoder-calibration';
9
+ export * from './lib/monitoring-config';
10
+ export * from './lib/monitoring-entry';
11
+ export * from './lib/motion-master-client';
12
+ export * from './lib/motion-master-pub-sub-client';
13
+ export * from './lib/motion-master-pub-sub-socket';
14
+ export * from './lib/motion-master-pub-sub-web-socket';
15
+ export * from './lib/motion-master-pub-sub-worker-socket';
16
+ export * from './lib/motion-master-req-res-client';
17
+ export * from './lib/motion-master-req-res-socket';
18
+ export * from './lib/motion-master-req-res-web-socket';
19
+ export * from './lib/motion-master-req-res-worker-socket';
20
+ export * from './lib/operators';
21
+ export * from './lib/options';
22
+ export * from './lib/os-command';
23
+ export * from './lib/parameter';
24
+ export * from './lib/request-status-resolver';
25
+ export * from './lib/somanet-product';
26
+ export * from './lib/system-log-line';
27
+ export * from './lib/types';
28
+ export * from './lib/urls';
29
+ export * from './lib/util';
30
+ export * from './lib/web-socket-connection-close-codes';
package/src/index.js CHANGED
@@ -1,32 +1,34 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./lib/cia402"), exports);
5
- tslib_1.__exportStar(require("./lib/config-file"), exports);
6
- tslib_1.__exportStar(require("./lib/data-monitoring"), exports);
7
- tslib_1.__exportStar(require("./lib/device-log-line"), exports);
8
- tslib_1.__exportStar(require("./lib/device-parameter"), exports);
9
- tslib_1.__exportStar(require("./lib/device"), exports);
10
- tslib_1.__exportStar(require("./lib/hardware-description"), exports);
11
- tslib_1.__exportStar(require("./lib/monitoring-config"), exports);
12
- tslib_1.__exportStar(require("./lib/monitoring-entry"), exports);
13
- tslib_1.__exportStar(require("./lib/motion-master-client"), exports);
14
- tslib_1.__exportStar(require("./lib/motion-master-pub-sub-client"), exports);
15
- tslib_1.__exportStar(require("./lib/motion-master-pub-sub-socket"), exports);
16
- tslib_1.__exportStar(require("./lib/motion-master-pub-sub-web-socket"), exports);
17
- tslib_1.__exportStar(require("./lib/motion-master-pub-sub-worker-socket"), exports);
18
- tslib_1.__exportStar(require("./lib/motion-master-req-res-client"), exports);
19
- tslib_1.__exportStar(require("./lib/motion-master-req-res-socket"), exports);
20
- tslib_1.__exportStar(require("./lib/motion-master-req-res-web-socket"), exports);
21
- tslib_1.__exportStar(require("./lib/motion-master-req-res-worker-socket"), exports);
22
- tslib_1.__exportStar(require("./lib/operators"), exports);
23
- tslib_1.__exportStar(require("./lib/options"), exports);
24
- tslib_1.__exportStar(require("./lib/os-command"), exports);
25
- tslib_1.__exportStar(require("./lib/parameter"), exports);
26
- tslib_1.__exportStar(require("./lib/request-status-resolver"), exports);
27
- tslib_1.__exportStar(require("./lib/system-log-line"), exports);
28
- tslib_1.__exportStar(require("./lib/types"), exports);
29
- tslib_1.__exportStar(require("./lib/urls"), exports);
30
- tslib_1.__exportStar(require("./lib/util"), exports);
31
- tslib_1.__exportStar(require("./lib/web-socket-connection-close-codes"), exports);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./lib/cia402"), exports);
5
+ tslib_1.__exportStar(require("./lib/config-file"), exports);
6
+ tslib_1.__exportStar(require("./lib/data-monitoring"), exports);
7
+ tslib_1.__exportStar(require("./lib/device-log-line"), exports);
8
+ tslib_1.__exportStar(require("./lib/device-parameter"), exports);
9
+ tslib_1.__exportStar(require("./lib/device"), exports);
10
+ tslib_1.__exportStar(require("./lib/hardware-description"), exports);
11
+ tslib_1.__exportStar(require("./lib/integro-encoder-calibration"), exports);
12
+ tslib_1.__exportStar(require("./lib/monitoring-config"), exports);
13
+ tslib_1.__exportStar(require("./lib/monitoring-entry"), exports);
14
+ tslib_1.__exportStar(require("./lib/motion-master-client"), exports);
15
+ tslib_1.__exportStar(require("./lib/motion-master-pub-sub-client"), exports);
16
+ tslib_1.__exportStar(require("./lib/motion-master-pub-sub-socket"), exports);
17
+ tslib_1.__exportStar(require("./lib/motion-master-pub-sub-web-socket"), exports);
18
+ tslib_1.__exportStar(require("./lib/motion-master-pub-sub-worker-socket"), exports);
19
+ tslib_1.__exportStar(require("./lib/motion-master-req-res-client"), exports);
20
+ tslib_1.__exportStar(require("./lib/motion-master-req-res-socket"), exports);
21
+ tslib_1.__exportStar(require("./lib/motion-master-req-res-web-socket"), exports);
22
+ tslib_1.__exportStar(require("./lib/motion-master-req-res-worker-socket"), exports);
23
+ tslib_1.__exportStar(require("./lib/operators"), exports);
24
+ tslib_1.__exportStar(require("./lib/options"), exports);
25
+ tslib_1.__exportStar(require("./lib/os-command"), exports);
26
+ tslib_1.__exportStar(require("./lib/parameter"), exports);
27
+ tslib_1.__exportStar(require("./lib/request-status-resolver"), exports);
28
+ tslib_1.__exportStar(require("./lib/somanet-product"), exports);
29
+ tslib_1.__exportStar(require("./lib/system-log-line"), exports);
30
+ tslib_1.__exportStar(require("./lib/types"), exports);
31
+ tslib_1.__exportStar(require("./lib/urls"), exports);
32
+ tslib_1.__exportStar(require("./lib/util"), exports);
33
+ tslib_1.__exportStar(require("./lib/web-socket-connection-close-codes"), exports);
32
34
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/motion-master-client/src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,4DAAkC;AAClC,gEAAsC;AACtC,gEAAsC;AACtC,iEAAuC;AACvC,uDAA6B;AAC7B,qEAA2C;AAC3C,kEAAwC;AACxC,iEAAuC;AACvC,qEAA2C;AAC3C,6EAAmD;AACnD,6EAAmD;AACnD,iFAAuD;AACvD,oFAA0D;AAC1D,6EAAmD;AACnD,6EAAmD;AACnD,iFAAuD;AACvD,oFAA0D;AAC1D,0DAAgC;AAChC,wDAA8B;AAC9B,2DAAiC;AACjC,0DAAgC;AAChC,wEAA8C;AAC9C,gEAAsC;AACtC,sDAA4B;AAC5B,qDAA2B;AAC3B,qDAA2B;AAC3B,kFAAwD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/motion-master-client/src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,4DAAkC;AAClC,gEAAsC;AACtC,gEAAsC;AACtC,iEAAuC;AACvC,uDAA6B;AAC7B,qEAA2C;AAC3C,4EAAkD;AAClD,kEAAwC;AACxC,iEAAuC;AACvC,qEAA2C;AAC3C,6EAAmD;AACnD,6EAAmD;AACnD,iFAAuD;AACvD,oFAA0D;AAC1D,6EAAmD;AACnD,6EAAmD;AACnD,iFAAuD;AACvD,oFAA0D;AAC1D,0DAAgC;AAChC,wDAA8B;AAC9B,2DAAiC;AACjC,0DAAgC;AAChC,wEAA8C;AAC9C,gEAAsC;AACtC,gEAAsC;AACtC,sDAA4B;AAC5B,qDAA2B;AAC3B,qDAA2B;AAC3B,kFAAwD"}