@zaber/motion 2.7.0-zl1 → 2.8.1-alpha-1

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 (92) hide show
  1. package/dist/binding/wasm/zaber-motion-lib.wasm +0 -0
  2. package/dist/lib/ascii/axis.d.ts +8 -0
  3. package/dist/lib/ascii/axis.js +17 -1
  4. package/dist/lib/ascii/axis.js.map +1 -1
  5. package/dist/lib/ascii/connection.js +3 -3
  6. package/dist/lib/ascii/connection.js.map +1 -1
  7. package/dist/lib/ascii/device.d.ts +9 -0
  8. package/dist/lib/ascii/device.js +17 -1
  9. package/dist/lib/ascii/device.js.map +1 -1
  10. package/dist/lib/ascii/stream.d.ts +0 -6
  11. package/dist/lib/ascii/stream.js +0 -13
  12. package/dist/lib/ascii/stream.js.map +1 -1
  13. package/dist/lib/ascii/stream_axis_definition.d.ts +1 -1
  14. package/dist/lib/ascii/stream_axis_definition.js.map +1 -1
  15. package/dist/lib/ascii/stream_buffer.d.ts +0 -1
  16. package/dist/lib/ascii/stream_buffer.js +0 -1
  17. package/dist/lib/ascii/stream_buffer.js.map +1 -1
  18. package/dist/lib/binary/connection.js +3 -3
  19. package/dist/lib/binary/connection.js.map +1 -1
  20. package/dist/lib/can_set_state_axis_response.d.ts +16 -0
  21. package/dist/lib/can_set_state_axis_response.js +18 -0
  22. package/dist/lib/can_set_state_axis_response.js.map +1 -0
  23. package/dist/lib/can_set_state_device_response.d.ts +17 -0
  24. package/dist/lib/can_set_state_device_response.js +19 -0
  25. package/dist/lib/can_set_state_device_response.js.map +1 -0
  26. package/dist/lib/exceptions/index.d.ts +0 -4
  27. package/dist/lib/exceptions/index.js +2 -10
  28. package/dist/lib/exceptions/index.js.map +1 -1
  29. package/dist/lib/gateway/call.js +7 -7
  30. package/dist/lib/gateway/call.js.map +1 -1
  31. package/dist/lib/gateway/convert_exceptions.js +0 -2
  32. package/dist/lib/gateway/convert_exceptions.js.map +1 -1
  33. package/dist/lib/gateway/events.js +5 -5
  34. package/dist/lib/gateway/events.js.map +1 -1
  35. package/dist/lib/gateway/wasm.js +1 -1
  36. package/dist/lib/gateway/wasm.js.map +1 -1
  37. package/dist/lib/index.d.ts +2 -1
  38. package/dist/lib/index.js +5 -2
  39. package/dist/lib/index.js.map +1 -1
  40. package/dist/lib/measurement.d.ts +1 -1
  41. package/dist/lib/measurement.js.map +1 -1
  42. package/dist/lib/protobufs/main_pb.d.ts +55 -447
  43. package/dist/lib/protobufs/main_pb.js +234 -3249
  44. package/dist/lib/protobufs/main_pb.js.map +1 -1
  45. package/dist/lib/wasm.js +3 -3
  46. package/dist/lib/wasm.js.map +1 -1
  47. package/package.json +3 -3
  48. package/dist/lib/exceptions/g_code_execution_exception.d.ts +0 -14
  49. package/dist/lib/exceptions/g_code_execution_exception.js +0 -32
  50. package/dist/lib/exceptions/g_code_execution_exception.js.map +0 -1
  51. package/dist/lib/exceptions/g_code_execution_exception_data.d.ts +0 -17
  52. package/dist/lib/exceptions/g_code_execution_exception_data.js +0 -18
  53. package/dist/lib/exceptions/g_code_execution_exception_data.js.map +0 -1
  54. package/dist/lib/exceptions/g_code_syntax_exception.d.ts +0 -14
  55. package/dist/lib/exceptions/g_code_syntax_exception.js +0 -32
  56. package/dist/lib/exceptions/g_code_syntax_exception.js.map +0 -1
  57. package/dist/lib/exceptions/g_code_syntax_exception_data.d.ts +0 -17
  58. package/dist/lib/exceptions/g_code_syntax_exception_data.js +0 -18
  59. package/dist/lib/exceptions/g_code_syntax_exception_data.js.map +0 -1
  60. package/dist/lib/finalizer.d.ts +0 -5
  61. package/dist/lib/finalizer.js +0 -21
  62. package/dist/lib/finalizer.js.map +0 -1
  63. package/dist/lib/gcode/axis_mapping.d.ts +0 -16
  64. package/dist/lib/gcode/axis_mapping.js +0 -38
  65. package/dist/lib/gcode/axis_mapping.js.map +0 -1
  66. package/dist/lib/gcode/index.d.ts +0 -8
  67. package/dist/lib/gcode/index.js +0 -20
  68. package/dist/lib/gcode/index.js.map +0 -1
  69. package/dist/lib/gcode/translate_message.d.ts +0 -21
  70. package/dist/lib/gcode/translate_message.js +0 -19
  71. package/dist/lib/gcode/translate_message.js.map +0 -1
  72. package/dist/lib/gcode/translate_result.d.ts +0 -17
  73. package/dist/lib/gcode/translate_result.js +0 -19
  74. package/dist/lib/gcode/translate_result.js.map +0 -1
  75. package/dist/lib/gcode/translator.d.ts +0 -68
  76. package/dist/lib/gcode/translator.js +0 -144
  77. package/dist/lib/gcode/translator.js.map +0 -1
  78. package/dist/lib/gcode/translator_axis_definition.d.ts +0 -20
  79. package/dist/lib/gcode/translator_axis_definition.js +0 -48
  80. package/dist/lib/gcode/translator_axis_definition.js.map +0 -1
  81. package/dist/lib/gcode/translator_config.d.ts +0 -18
  82. package/dist/lib/gcode/translator_config.js +0 -41
  83. package/dist/lib/gcode/translator_config.js.map +0 -1
  84. package/dist/lib/gcode/translator_definition.d.ts +0 -18
  85. package/dist/lib/gcode/translator_definition.js +0 -39
  86. package/dist/lib/gcode/translator_definition.js.map +0 -1
  87. package/dist/lib/gcode/translator_live.d.ts +0 -70
  88. package/dist/lib/gcode/translator_live.js +0 -147
  89. package/dist/lib/gcode/translator_live.js.map +0 -1
  90. package/dist/lib/gcode_ns.d.ts +0 -19
  91. package/dist/lib/gcode_ns.js +0 -35
  92. package/dist/lib/gcode_ns.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/exceptions/index.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;AAEtD,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AACrC,uEAAoE;AAA3D,kIAAA,sBAAsB,OAAA;AAC/B,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,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;AAA/D,sIAAA,wBAAwB,OAAA;AACjC,iEAA8D;AAArD,4HAAA,mBAAmB,OAAA;AAC5B,uFAAmF;AAA1E,iJAAA,6BAA6B,OAAA;AACtC,iGAA6F;AAApF,2JAAA,kCAAkC,OAAA;AAC3C,iFAA6E;AAApE,2IAAA,0BAA0B,OAAA;AACnC,uFAAmF;AAA1E,iJAAA,6BAA6B,OAAA;AACtC,yEAAsE;AAA7D,oIAAA,uBAAuB,OAAA;AAChC,+DAA4D;AAAnD,0HAAA,kBAAkB,OAAA;AAE3B,+FAA0F;AAAjF,wJAAA,gCAAgC,OAAA;AACzC,iFAA6E;AAApE,2IAAA,0BAA0B,OAAA;AACnC,mGAA8F;AAArF,4JAAA,kCAAkC,OAAA;AAC3C,qFAAgF;AAAvE,8IAAA,2BAA2B,OAAA;AACpC,+EAA0E;AAAjE,wIAAA,wBAAwB,OAAA;AACjC,iFAA6E;AAApE,2IAAA,0BAA0B,OAAA;AACnC,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AACrC,mFAA+E;AAAtE,6IAAA,2BAA2B,OAAA;AACpC,6FAAyF;AAAhF,uJAAA,gCAAgC,OAAA;AACzC,qFAAgF;AAAvE,8IAAA,2BAA2B,OAAA;AACpC,6FAAwF;AAA/E,sJAAA,+BAA+B,OAAA;AACxC,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AACrC,iGAA4F;AAAnF,0JAAA,iCAAiC,OAAA;AAC1C,2GAAsG;AAA7F,oKAAA,sCAAsC,OAAA","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nexport { BinaryCommandFailedException } from './binary_command_failed_exception';\nexport { CommandFailedException } from './command_failed_exception';\nexport { CommandPreemptedException } from './command_preempted_exception';\nexport { ConnectionClosedException } from './connection_closed_exception';\nexport { ConnectionFailedException } from './connection_failed_exception';\nexport { ConversionFailedException } from './conversion_failed_exception';\nexport { DeviceAddressConflictException } from './device_address_conflict_exception';\nexport { DeviceBusyException } from './device_busy_exception';\nexport { DeviceDbFailedException } from './device_db_failed_exception';\nexport { DeviceFailedException } from './device_failed_exception';\nexport { DeviceNotIdentifiedException } from './device_not_identified_exception';\nexport { GCodeExecutionException } from './g_code_execution_exception';\nexport { GCodeSyntaxException } from './g_code_syntax_exception';\nexport { InternalErrorException } from './internal_error_exception';\nexport { InvalidArgumentException } from './invalid_argument_exception';\nexport { InvalidDataException } from './invalid_data_exception';\nexport { InvalidPacketException } from './invalid_packet_exception';\nexport { InvalidParkStateException } from './invalid_park_state_exception';\nexport { InvalidResponseException } from './invalid_response_exception';\nexport { IoChannelOutOfRangeException } from './io_channel_out_of_range_exception';\nexport { IoFailedException } from './io_failed_exception';\nexport { LockstepEnabledException } from './lockstep_enabled_exception';\nexport { LockstepNotEnabledException } from './lockstep_not_enabled_exception';\nexport { MovementFailedException } from './movement_failed_exception';\nexport { MovementInterruptedException } from './movement_interrupted_exception';\nexport { NoDeviceFoundException } from './no_device_found_exception';\nexport { NotSupportedException } from './not_supported_exception';\nexport { OsFailedException } from './os_failed_exception';\nexport { OutOfRequestIdsException } from './out_of_request_ids_exception';\nexport { RequestTimeoutException } from './request_timeout_exception';\nexport { SerialPortBusyException } from './serial_port_busy_exception';\nexport { SetDeviceStateFailedException } from './set_device_state_failed_exception';\nexport { SetPeripheralStateFailedException } from './set_peripheral_state_failed_exception';\nexport { SettingNotFoundException } from './setting_not_found_exception';\nexport { StreamExecutionException } from './stream_execution_exception';\nexport { StreamModeException } from './stream_mode_exception';\nexport { StreamMovementFailedException } from './stream_movement_failed_exception';\nexport { StreamMovementInterruptedException } from './stream_movement_interrupted_exception';\nexport { StreamSetupFailedException } from './stream_setup_failed_exception';\nexport { TransportAlreadyUsedException } from './transport_already_used_exception';\nexport { UnknownRequestException } from './unknown_request_exception';\nexport { MotionLibException } from './motion_lib_exception';\n\nexport { BinaryCommandFailedExceptionData } from './binary_command_failed_exception_data';\nexport { CommandFailedExceptionData } from './command_failed_exception_data';\nexport { DeviceAddressConflictExceptionData } from './device_address_conflict_exception_data';\nexport { GCodeExecutionExceptionData } from './g_code_execution_exception_data';\nexport { GCodeSyntaxExceptionData } from './g_code_syntax_exception_data';\nexport { InvalidPacketExceptionData } from './invalid_packet_exception_data';\nexport { InvalidResponseExceptionData } from './invalid_response_exception_data';\nexport { MovementFailedExceptionData } from './movement_failed_exception_data';\nexport { MovementInterruptedExceptionData } from './movement_interrupted_exception_data';\nexport { SetDeviceStateExceptionData } from './set_device_state_exception_data';\nexport { SetPeripheralStateExceptionData } from './set_peripheral_state_exception_data';\nexport { StreamExecutionExceptionData } from './stream_execution_exception_data';\nexport { StreamMovementFailedExceptionData } from './stream_movement_failed_exception_data';\nexport { StreamMovementInterruptedExceptionData } from './stream_movement_interrupted_exception_data';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/exceptions/index.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;AAEtD,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AACrC,uEAAoE;AAA3D,kIAAA,sBAAsB,OAAA;AAC/B,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,yFAAqF;AAA5E,mJAAA,8BAA8B,OAAA;AACvC,iEAA8D;AAArD,4HAAA,mBAAmB,OAAA;AAC5B,2EAAuE;AAA9D,qIAAA,uBAAuB,OAAA;AAChC,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA;AAC9B,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AACrC,uEAAoE;AAA3D,kIAAA,sBAAsB,OAAA;AAC/B,2EAAwE;AAA/D,sIAAA,wBAAwB,OAAA;AACjC,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA;AAC7B,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,4JAAA,kCAAkC,OAAA;AAC3C,iFAA6E;AAApE,2IAAA,0BAA0B,OAAA;AACnC,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AACrC,mFAA+E;AAAtE,6IAAA,2BAA2B,OAAA;AACpC,6FAAyF;AAAhF,uJAAA,gCAAgC,OAAA;AACzC,qFAAgF;AAAvE,8IAAA,2BAA2B,OAAA;AACpC,6FAAwF;AAA/E,sJAAA,+BAA+B,OAAA;AACxC,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AACrC,iGAA4F;AAAnF,0JAAA,iCAAiC,OAAA;AAC1C,2GAAsG;AAA7F,oKAAA,sCAAsC,OAAA","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nexport { BinaryCommandFailedException } from './binary_command_failed_exception';\nexport { CommandFailedException } from './command_failed_exception';\nexport { CommandPreemptedException } from './command_preempted_exception';\nexport { ConnectionClosedException } from './connection_closed_exception';\nexport { ConnectionFailedException } from './connection_failed_exception';\nexport { ConversionFailedException } from './conversion_failed_exception';\nexport { DeviceAddressConflictException } from './device_address_conflict_exception';\nexport { DeviceBusyException } from './device_busy_exception';\nexport { DeviceDbFailedException } from './device_db_failed_exception';\nexport { DeviceFailedException } from './device_failed_exception';\nexport { DeviceNotIdentifiedException } from './device_not_identified_exception';\nexport { InternalErrorException } from './internal_error_exception';\nexport { InvalidArgumentException } from './invalid_argument_exception';\nexport { InvalidDataException } from './invalid_data_exception';\nexport { InvalidPacketException } from './invalid_packet_exception';\nexport { InvalidParkStateException } from './invalid_park_state_exception';\nexport { InvalidResponseException } from './invalid_response_exception';\nexport { IoChannelOutOfRangeException } from './io_channel_out_of_range_exception';\nexport { IoFailedException } from './io_failed_exception';\nexport { LockstepEnabledException } from './lockstep_enabled_exception';\nexport { LockstepNotEnabledException } from './lockstep_not_enabled_exception';\nexport { MovementFailedException } from './movement_failed_exception';\nexport { MovementInterruptedException } from './movement_interrupted_exception';\nexport { NoDeviceFoundException } from './no_device_found_exception';\nexport { NotSupportedException } from './not_supported_exception';\nexport { OsFailedException } from './os_failed_exception';\nexport { OutOfRequestIdsException } from './out_of_request_ids_exception';\nexport { RequestTimeoutException } from './request_timeout_exception';\nexport { SerialPortBusyException } from './serial_port_busy_exception';\nexport { SetDeviceStateFailedException } from './set_device_state_failed_exception';\nexport { SetPeripheralStateFailedException } from './set_peripheral_state_failed_exception';\nexport { SettingNotFoundException } from './setting_not_found_exception';\nexport { StreamExecutionException } from './stream_execution_exception';\nexport { StreamModeException } from './stream_mode_exception';\nexport { StreamMovementFailedException } from './stream_movement_failed_exception';\nexport { StreamMovementInterruptedException } from './stream_movement_interrupted_exception';\nexport { StreamSetupFailedException } from './stream_setup_failed_exception';\nexport { TransportAlreadyUsedException } from './transport_already_used_exception';\nexport { UnknownRequestException } from './unknown_request_exception';\nexport { MotionLibException } from './motion_lib_exception';\n\nexport { BinaryCommandFailedExceptionData } from './binary_command_failed_exception_data';\nexport { CommandFailedExceptionData } from './command_failed_exception_data';\nexport { DeviceAddressConflictExceptionData } from './device_address_conflict_exception_data';\nexport { InvalidPacketExceptionData } from './invalid_packet_exception_data';\nexport { InvalidResponseExceptionData } from './invalid_response_exception_data';\nexport { MovementFailedExceptionData } from './movement_failed_exception_data';\nexport { MovementInterruptedExceptionData } from './movement_interrupted_exception_data';\nexport { SetDeviceStateExceptionData } from './set_device_state_exception_data';\nexport { SetPeripheralStateExceptionData } from './set_peripheral_state_exception_data';\nexport { StreamExecutionExceptionData } from './stream_execution_exception_data';\nexport { StreamMovementFailedExceptionData } from './stream_movement_failed_exception_data';\nexport { StreamMovementInterruptedExceptionData } from './stream_movement_interrupted_exception_data';\n"]}
@@ -8,25 +8,25 @@ const convert_exceptions_1 = require("./convert_exceptions");
8
8
  async function callAsync(request, requestData, responseProto) {
9
9
  const requestProto = new main_pb_1.Request();
10
10
  requestProto.setRequest(request);
11
- const data = serialization_1.serialize(requestProto, requestData);
12
- const resultBuffer = await new Promise(resolve => bindings_1.getBinding().callAsync(data, resolve));
13
- const structBuffers = serialization_1.deserialize(resultBuffer);
11
+ const data = (0, serialization_1.serialize)(requestProto, requestData);
12
+ const resultBuffer = await new Promise(resolve => (0, bindings_1.getBinding)().callAsync(data, resolve));
13
+ const structBuffers = (0, serialization_1.deserialize)(resultBuffer);
14
14
  return processResponse(structBuffers, responseProto);
15
15
  }
16
16
  exports.callAsync = callAsync;
17
17
  function callSync(request, requestData, responseProto) {
18
18
  const requestProto = new main_pb_1.Request();
19
19
  requestProto.setRequest(request);
20
- const data = serialization_1.serialize(requestProto, requestData);
21
- const resultBuffer = bindings_1.getBinding().callSync(data);
22
- const structBuffers = serialization_1.deserialize(resultBuffer);
20
+ const data = (0, serialization_1.serialize)(requestProto, requestData);
21
+ const resultBuffer = (0, bindings_1.getBinding)().callSync(data);
22
+ const structBuffers = (0, serialization_1.deserialize)(resultBuffer);
23
23
  return processResponse(structBuffers, responseProto);
24
24
  }
25
25
  exports.callSync = callSync;
26
26
  function processResponse(structBuffers, responseProto) {
27
27
  const response = main_pb_1.Response.deserializeBinary(structBuffers[0]);
28
28
  if (response.getResponse() !== main_pb_1.Response.ResponseType.OK) {
29
- throw convert_exceptions_1.convertToException(response.getErrorType(), response.getErrorMessage(), structBuffers[1]);
29
+ throw (0, convert_exceptions_1.convertToException)(response.getErrorType(), response.getErrorMessage(), structBuffers[1]);
30
30
  }
31
31
  /* istanbul ignore if */
32
32
  if (responseProto && structBuffers.length <= 1) {
@@ -1 +1 @@
1
- {"version":3,"file":"call.js","sourceRoot":"","sources":["../../../src/gateway/call.ts"],"names":[],"mappings":";;;AAEA,kDAAyD;AAEzD,yCAAwC;AACxC,mDAAuE;AACvE,6DAA0D;AAanD,KAAK,UAAU,SAAS,CAC7B,OAAe,EACf,WAAsC,EACtC,aAA2B;IAE3B,MAAM,YAAY,GAAG,IAAI,iBAAO,EAAE,CAAC;IACnC,YAAY,CAAC,UAAU,CAAC,OAAO,CA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AAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;KAC7C;IACD,wBAAwB;IACxB,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE;QAC9C,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;KAClD;IACD,IAAI,aAAa,EAAE;QACjB,OAAQ,aAAqB,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;KACnE;SAAM;QACL,OAAO,IAAI,CAAC;KACb;AACH,CAAC","sourcesContent":["import { Message } from 'google-protobuf';\n\nimport { Request, Response } from '../protobufs/main_pb';\n\nimport { getBinding } from './bindings';\nimport { Serializable, serialize, deserialize } from './serialization';\nimport { convertToException } from './convert_exceptions';\n\nexport async function callAsync(\n request: string,\n requestData?: Serializable\n): Promise<null>;\n\nexport async function callAsync<T extends Message>(\n request: string,\n requestData: Serializable | undefined,\n responseProto: new () => T\n): Promise<T>;\n\nexport async function callAsync<T extends Message>(\n request: string,\n requestData?: Serializable | undefined,\n responseProto?: new () => T\n): Promise<T | null> {\n const requestProto = new Request();\n requestProto.setRequest(request);\n\n const data = serialize(requestProto, requestData);\n\n const resultBuffer = await new Promise<Buffer>(resolve =>\n getBinding().callAsync(data, resolve)\n );\n\n const structBuffers = deserialize(resultBuffer);\n\n return processResponse(structBuffers, responseProto);\n}\n\nexport function callSync(\n request: string,\n requestData?: Serializable | undefined,\n): null;\n\nexport function callSync<T extends Message>(\n request: string,\n requestData: Serializable | undefined,\n responseProto: new () => T\n): T;\n\nexport function callSync<T extends Message>(\n request: string,\n requestData?: Serializable,\n responseProto?: new () => T\n): T | null {\n const requestProto = new Request();\n requestProto.setRequest(request);\n\n const data = serialize(requestProto, requestData);\n\n const resultBuffer: Buffer = getBinding().callSync(data);\n\n const structBuffers = deserialize(resultBuffer);\n\n return processResponse(structBuffers, responseProto);\n}\n\nfunction processResponse<T extends Message>(structBuffers: Buffer[], responseProto?: new () => T): T | null {\n const response = Response.deserializeBinary(structBuffers[0]);\n\n if (response.getResponse() !== Response.ResponseType.OK) {\n throw convertToException(response.getErrorType(), response.getErrorMessage(), structBuffers[1]);\n }\n\n /* istanbul ignore if */\n if (responseProto && structBuffers.length <= 1) {\n throw new Error('No response from library');\n }\n /* istanbul ignore if */\n if (!responseProto && structBuffers.length > 1) {\n throw new Error('Response from library ignored');\n }\n if (responseProto) {\n return (responseProto as any).deserializeBinary(structBuffers[1]);\n } else {\n return null;\n }\n}\n"]}
1
+ {"version":3,"file":"call.js","sourceRoot":"","sources":["../../../src/gateway/call.ts"],"names":[],"mappings":";;;AAEA,kDAAyD;AAEzD,yCAAwC;AACxC,mDAAuE;AACvE,6DAA0D;AAanD,KAAK,UAAU,SAAS,CAC7B,OAAe,EACf,WAAsC,EACtC,aAA2B;IAE3B,MAAM,YAAY,GAAG,IAAI,iBAAO,EAAE,CAAC;IACnC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAEjC,MAAM,IAAI,GAAG,IAAA,yBAAS,EAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IAElD,MAAM,YAAY,GAAG,MAAM,IAAI,OAAO,CAAS,OAAO,CAAC,EAAE,CACvD,IAAA,qBAAU,GAAE,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CACtC,CAAC;IAEF,MAAM,aAAa,GAAG,IAAA,2BAAW,EAAC,YAAY,CAAC,CAAC;IAEhD,OAAO,eAAe,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AACvD,CAAC;AAjBD,8BAiBC;AAaD,SAAgB,QAAQ,CACtB,OAAe,EACf,WAA0B,EAC1B,aAA2B;IAE3B,MAAM,YAAY,GAAG,IAAI,iBAAO,EAAE,CAAC;IACnC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAEjC,MAAM,IAAI,GAAG,IAAA,yBAAS,EAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IAElD,MAAM,YAAY,GAAW,IAAA,qBAAU,GAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEzD,MAAM,aAAa,GAAG,IAAA,2BAAW,EAAC,YAAY,CAAC,CAAC;IAEhD,OAAO,eAAe,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AACvD,CAAC;AAfD,4BAeC;AAED,SAAS,eAAe,CAAoB,aAAuB,EAAE,aAA2B;IAC9F,MAAM,QAAQ,GAAG,kBAAQ,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAE9D,IAAI,QAAQ,CAAC,WAAW,EAAE,KAAK,kBAAQ,CAAC,YAAY,CAAC,EAAE,EAAE;QACvD,MAAM,IAAA,uCAAkB,EAAC,QAAQ,CAAC,YAAY,EAAE,EAAE,QAAQ,CAAC,eAAe,EAAE,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;KACjG;IAED,wBAAwB;IACxB,IAAI,aAAa,IAAI,aAAa,CAAC,MAAM,IAAI,CAAC,EAAE;QAC9C,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;KAC7C;IACD,wBAAwB;IACxB,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE;QAC9C,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;KAClD;IACD,IAAI,aAAa,EAAE;QACjB,OAAQ,aAAqB,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;KACnE;SAAM;QACL,OAAO,IAAI,CAAC;KACb;AACH,CAAC","sourcesContent":["import { Message } from 'google-protobuf';\n\nimport { Request, Response } from '../protobufs/main_pb';\n\nimport { getBinding } from './bindings';\nimport { Serializable, serialize, deserialize } from './serialization';\nimport { convertToException } from './convert_exceptions';\n\nexport async function callAsync(\n request: string,\n requestData?: Serializable\n): Promise<null>;\n\nexport async function callAsync<T extends Message>(\n request: string,\n requestData: Serializable | undefined,\n responseProto: new () => T\n): Promise<T>;\n\nexport async function callAsync<T extends Message>(\n request: string,\n requestData?: Serializable | undefined,\n responseProto?: new () => T\n): Promise<T | null> {\n const requestProto = new Request();\n requestProto.setRequest(request);\n\n const data = serialize(requestProto, requestData);\n\n const resultBuffer = await new Promise<Buffer>(resolve =>\n getBinding().callAsync(data, resolve)\n );\n\n const structBuffers = deserialize(resultBuffer);\n\n return processResponse(structBuffers, responseProto);\n}\n\nexport function callSync(\n request: string,\n requestData?: Serializable | undefined,\n): null;\n\nexport function callSync<T extends Message>(\n request: string,\n requestData: Serializable | undefined,\n responseProto: new () => T\n): T;\n\nexport function callSync<T extends Message>(\n request: string,\n requestData?: Serializable,\n responseProto?: new () => T\n): T | null {\n const requestProto = new Request();\n requestProto.setRequest(request);\n\n const data = serialize(requestProto, requestData);\n\n const resultBuffer: Buffer = getBinding().callSync(data);\n\n const structBuffers = deserialize(resultBuffer);\n\n return processResponse(structBuffers, responseProto);\n}\n\nfunction processResponse<T extends Message>(structBuffers: Buffer[], responseProto?: new () => T): T | null {\n const response = Response.deserializeBinary(structBuffers[0]);\n\n if (response.getResponse() !== Response.ResponseType.OK) {\n throw convertToException(response.getErrorType(), response.getErrorMessage(), structBuffers[1]);\n }\n\n /* istanbul ignore if */\n if (responseProto && structBuffers.length <= 1) {\n throw new Error('No response from library');\n }\n /* istanbul ignore if */\n if (!responseProto && structBuffers.length > 1) {\n throw new Error('Response from library ignored');\n }\n if (responseProto) {\n return (responseProto as any).deserializeBinary(structBuffers[1]);\n } else {\n return null;\n }\n}\n"]}
@@ -36,8 +36,6 @@ errorMapping.set(main_pb_1.Errors.DEVICE_BUSY, exceptions.DeviceBusyException);
36
36
  errorMapping.set(main_pb_1.Errors.DEVICE_DB_FAILED, exceptions.DeviceDbFailedException);
37
37
  errorMapping.set(main_pb_1.Errors.DEVICE_FAILED, exceptions.DeviceFailedException);
38
38
  errorMapping.set(main_pb_1.Errors.DEVICE_NOT_IDENTIFIED, exceptions.DeviceNotIdentifiedException);
39
- errorMapping.set(main_pb_1.Errors.G_CODE_EXECUTION, exceptions.GCodeExecutionException);
40
- errorMapping.set(main_pb_1.Errors.G_CODE_SYNTAX, exceptions.GCodeSyntaxException);
41
39
  errorMapping.set(main_pb_1.Errors.INTERNAL_ERROR, exceptions.InternalErrorException);
42
40
  errorMapping.set(main_pb_1.Errors.INVALID_ARGUMENT, exceptions.InvalidArgumentException);
43
41
  errorMapping.set(main_pb_1.Errors.INVALID_DATA, exceptions.InvalidDataException);
@@ -1 +1 @@
1
- {"version":3,"file":"convert_exceptions.js","sourceRoot":"","sources":["../../../src/gateway/convert_exceptions.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,kDAA0D;AAC1D,0DAA4C;AAE5C,MAAM,YAAY,GAAG,IAAI,GAAG,EAAwF,CAAC;AACrH,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,qBAAqB,EAAE,UAAU,CAAC,4BAA4B,CAAC,CAAC;AAC1F,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,cAAc,EAAE,UAAU,CAAC,sBAAsB,CAAC,CAAC;AAC7E,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,uBAAuB,EAAE,UAAU,CAAC,8BAA8B,CAAC,CAAC;AAC9F,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,WAAW,EAAE,UAAU,CAAC,mBAAmB,CAAC,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jF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,WAAW,EAAE,UAAU,CAAC,mBAAmB,CAAC,CAAC;AACvE,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,sBAAsB,EAAE,UAAU,CAAC,6BAA6B,CAAC,CAAC;AAC5F,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,2BAA2B,EAAE,UAAU,CAAC,kCAAkC,CAAC,CAAC;AACtG,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,mBAAmB,EAAE,UAAU,CAAC,0BAA0B,CAAC,CAAC;AACtF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,sBAAsB,EAAE,UAAU,CAAC,6BAA6B,CAAC,CAAC;AAC5F,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,eAAe,EAAE,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAE/E,SAAgB,kBAAkB,CAAC,KAAe,EAAE,OAAe,EAAE,UAAmB;IACtF,MAAM,iBAAiB,GAAG,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAElD,wBAAwB;IACxB,IAAI,CAAC,iBAAiB,EAAE;QACtB,OAAO,IAAI,UAAU,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;KACnD;IAED,OAAO,IAAI,iBAAiB,CAAC,OAAO,EAAE,UAAW,CAAC,CAAC;AACrD,CAAC;AATD,gDASC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Errors as PbErrors } from '../protobufs/main_pb';\nimport * as exceptions from '../exceptions';\n\nconst errorMapping = new Map<PbErrors, new (message: string, customData: Buffer) => exceptions.MotionLibException>();\nerrorMapping.set(PbErrors.BINARY_COMMAND_FAILED, exceptions.BinaryCommandFailedException);\nerrorMapping.set(PbErrors.COMMAND_FAILED, exceptions.CommandFailedException);\nerrorMapping.set(PbErrors.COMMAND_PREEMPTED, exceptions.CommandPreemptedException);\nerrorMapping.set(PbErrors.CONNECTION_CLOSED, exceptions.ConnectionClosedException);\nerrorMapping.set(PbErrors.CONNECTION_FAILED, exceptions.ConnectionFailedException);\nerrorMapping.set(PbErrors.CONVERSION_FAILED, exceptions.ConversionFailedException);\nerrorMapping.set(PbErrors.DEVICE_ADDRESS_CONFLICT, exceptions.DeviceAddressConflictException);\nerrorMapping.set(PbErrors.DEVICE_BUSY, exceptions.DeviceBusyException);\nerrorMapping.set(PbErrors.DEVICE_DB_FAILED, exceptions.DeviceDbFailedException);\nerrorMapping.set(PbErrors.DEVICE_FAILED, exceptions.DeviceFailedException);\nerrorMapping.set(PbErrors.DEVICE_NOT_IDENTIFIED, exceptions.DeviceNotIdentifiedException);\nerrorMapping.set(PbErrors.G_CODE_EXECUTION, exceptions.GCodeExecutionException);\nerrorMapping.set(PbErrors.G_CODE_SYNTAX, exceptions.GCodeSyntaxException);\nerrorMapping.set(PbErrors.INTERNAL_ERROR, exceptions.InternalErrorException);\nerrorMapping.set(PbErrors.INVALID_ARGUMENT, exceptions.InvalidArgumentException);\nerrorMapping.set(PbErrors.INVALID_DATA, exceptions.InvalidDataException);\nerrorMapping.set(PbErrors.INVALID_PACKET, exceptions.InvalidPacketException);\nerrorMapping.set(PbErrors.INVALID_PARK_STATE, exceptions.InvalidParkStateException);\nerrorMapping.set(PbErrors.INVALID_RESPONSE, exceptions.InvalidResponseException);\nerrorMapping.set(PbErrors.IO_CHANNEL_OUT_OF_RANGE, exceptions.IoChannelOutOfRangeException);\nerrorMapping.set(PbErrors.IO_FAILED, exceptions.IoFailedException);\nerrorMapping.set(PbErrors.LOCKSTEP_ENABLED, exceptions.LockstepEnabledException);\nerrorMapping.set(PbErrors.LOCKSTEP_NOT_ENABLED, exceptions.LockstepNotEnabledException);\nerrorMapping.set(PbErrors.MOVEMENT_FAILED, exceptions.MovementFailedException);\nerrorMapping.set(PbErrors.MOVEMENT_INTERRUPTED, exceptions.MovementInterruptedException);\nerrorMapping.set(PbErrors.NO_DEVICE_FOUND, exceptions.NoDeviceFoundException);\nerrorMapping.set(PbErrors.NOT_SUPPORTED, exceptions.NotSupportedException);\nerrorMapping.set(PbErrors.OS_FAILED, exceptions.OsFailedException);\nerrorMapping.set(PbErrors.OUT_OF_REQUEST_IDS, exceptions.OutOfRequestIdsException);\nerrorMapping.set(PbErrors.REQUEST_TIMEOUT, exceptions.RequestTimeoutException);\nerrorMapping.set(PbErrors.SERIAL_PORT_BUSY, exceptions.SerialPortBusyException);\nerrorMapping.set(PbErrors.SET_DEVICE_STATE_FAILED, exceptions.SetDeviceStateFailedException);\nerrorMapping.set(PbErrors.SET_PERIPHERAL_STATE_FAILED, exceptions.SetPeripheralStateFailedException);\nerrorMapping.set(PbErrors.SETTING_NOT_FOUND, exceptions.SettingNotFoundException);\nerrorMapping.set(PbErrors.STREAM_EXECUTION, exceptions.StreamExecutionException);\nerrorMapping.set(PbErrors.STREAM_MODE, exceptions.StreamModeException);\nerrorMapping.set(PbErrors.STREAM_MOVEMENT_FAILED, exceptions.StreamMovementFailedException);\nerrorMapping.set(PbErrors.STREAM_MOVEMENT_INTERRUPTED, exceptions.StreamMovementInterruptedException);\nerrorMapping.set(PbErrors.STREAM_SETUP_FAILED, exceptions.StreamSetupFailedException);\nerrorMapping.set(PbErrors.TRANSPORT_ALREADY_USED, exceptions.TransportAlreadyUsedException);\nerrorMapping.set(PbErrors.UNKNOWN_REQUEST, exceptions.UnknownRequestException);\n\nexport function convertToException(error: PbErrors, message: string, customData?: Buffer): exceptions.MotionLibException {\n const SpecificException = errorMapping.get(error);\n\n /* istanbul ignore if */\n if (!SpecificException) {\n return new exceptions.MotionLibException(message);\n }\n\n return new SpecificException(message, customData!);\n}\n"]}
1
+ {"version":3,"file":"convert_exceptions.js","sourceRoot":"","sources":["../../../src/gateway/convert_exceptions.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,kDAA0D;AAC1D,0DAA4C;AA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,GAAG,CAAC,KAAK,CAAC,CAAC;IAElD,wBAAwB;IACxB,IAAI,CAAC,iBAAiB,EAAE;QACtB,OAAO,IAAI,UAAU,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;KACnD;IAED,OAAO,IAAI,iBAAiB,CAAC,OAAO,EAAE,UAAW,CAAC,CAAC;AACrD,CAAC;AATD,gDASC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Errors as PbErrors } from '../protobufs/main_pb';\nimport * as exceptions from '../exceptions';\n\nconst errorMapping = new Map<PbErrors, new (message: string, customData: Buffer) => exceptions.MotionLibException>();\nerrorMapping.set(PbErrors.BINARY_COMMAND_FAILED, exceptions.BinaryCommandFailedException);\nerrorMapping.set(PbErrors.COMMAND_FAILED, exceptions.CommandFailedException);\nerrorMapping.set(PbErrors.COMMAND_PREEMPTED, exceptions.CommandPreemptedException);\nerrorMapping.set(PbErrors.CONNECTION_CLOSED, exceptions.ConnectionClosedException);\nerrorMapping.set(PbErrors.CONNECTION_FAILED, exceptions.ConnectionFailedException);\nerrorMapping.set(PbErrors.CONVERSION_FAILED, exceptions.ConversionFailedException);\nerrorMapping.set(PbErrors.DEVICE_ADDRESS_CONFLICT, exceptions.DeviceAddressConflictException);\nerrorMapping.set(PbErrors.DEVICE_BUSY, exceptions.DeviceBusyException);\nerrorMapping.set(PbErrors.DEVICE_DB_FAILED, exceptions.DeviceDbFailedException);\nerrorMapping.set(PbErrors.DEVICE_FAILED, exceptions.DeviceFailedException);\nerrorMapping.set(PbErrors.DEVICE_NOT_IDENTIFIED, exceptions.DeviceNotIdentifiedException);\nerrorMapping.set(PbErrors.INTERNAL_ERROR, exceptions.InternalErrorException);\nerrorMapping.set(PbErrors.INVALID_ARGUMENT, exceptions.InvalidArgumentException);\nerrorMapping.set(PbErrors.INVALID_DATA, exceptions.InvalidDataException);\nerrorMapping.set(PbErrors.INVALID_PACKET, exceptions.InvalidPacketException);\nerrorMapping.set(PbErrors.INVALID_PARK_STATE, exceptions.InvalidParkStateException);\nerrorMapping.set(PbErrors.INVALID_RESPONSE, exceptions.InvalidResponseException);\nerrorMapping.set(PbErrors.IO_CHANNEL_OUT_OF_RANGE, exceptions.IoChannelOutOfRangeException);\nerrorMapping.set(PbErrors.IO_FAILED, exceptions.IoFailedException);\nerrorMapping.set(PbErrors.LOCKSTEP_ENABLED, exceptions.LockstepEnabledException);\nerrorMapping.set(PbErrors.LOCKSTEP_NOT_ENABLED, exceptions.LockstepNotEnabledException);\nerrorMapping.set(PbErrors.MOVEMENT_FAILED, exceptions.MovementFailedException);\nerrorMapping.set(PbErrors.MOVEMENT_INTERRUPTED, exceptions.MovementInterruptedException);\nerrorMapping.set(PbErrors.NO_DEVICE_FOUND, exceptions.NoDeviceFoundException);\nerrorMapping.set(PbErrors.NOT_SUPPORTED, exceptions.NotSupportedException);\nerrorMapping.set(PbErrors.OS_FAILED, exceptions.OsFailedException);\nerrorMapping.set(PbErrors.OUT_OF_REQUEST_IDS, exceptions.OutOfRequestIdsException);\nerrorMapping.set(PbErrors.REQUEST_TIMEOUT, exceptions.RequestTimeoutException);\nerrorMapping.set(PbErrors.SERIAL_PORT_BUSY, exceptions.SerialPortBusyException);\nerrorMapping.set(PbErrors.SET_DEVICE_STATE_FAILED, exceptions.SetDeviceStateFailedException);\nerrorMapping.set(PbErrors.SET_PERIPHERAL_STATE_FAILED, exceptions.SetPeripheralStateFailedException);\nerrorMapping.set(PbErrors.SETTING_NOT_FOUND, exceptions.SettingNotFoundException);\nerrorMapping.set(PbErrors.STREAM_EXECUTION, exceptions.StreamExecutionException);\nerrorMapping.set(PbErrors.STREAM_MODE, exceptions.StreamModeException);\nerrorMapping.set(PbErrors.STREAM_MOVEMENT_FAILED, exceptions.StreamMovementFailedException);\nerrorMapping.set(PbErrors.STREAM_MOVEMENT_INTERRUPTED, exceptions.StreamMovementInterruptedException);\nerrorMapping.set(PbErrors.STREAM_SETUP_FAILED, exceptions.StreamSetupFailedException);\nerrorMapping.set(PbErrors.TRANSPORT_ALREADY_USED, exceptions.TransportAlreadyUsedException);\nerrorMapping.set(PbErrors.UNKNOWN_REQUEST, exceptions.UnknownRequestException);\n\nexport function convertToException(error: PbErrors, message: string, customData?: Buffer): exceptions.MotionLibException {\n const SpecificException = errorMapping.get(error);\n\n /* istanbul ignore if */\n if (!SpecificException) {\n return new exceptions.MotionLibException(message);\n }\n\n return new SpecificException(message, customData!);\n}\n"]}
@@ -10,13 +10,13 @@ const serialization_1 = require("./serialization");
10
10
  const subscriptions = new Set();
11
11
  exports.events = rxjs_1.Observable.create((observer) => {
12
12
  if (subscriptions.size === 0) {
13
- bindings_1.getBinding().setEventsEnabled(true);
13
+ (0, bindings_1.getBinding)().setEventsEnabled(true);
14
14
  }
15
15
  subscriptions.add(observer);
16
16
  return () => {
17
17
  subscriptions.delete(observer);
18
18
  if (subscriptions.size === 0) {
19
- bindings_1.getBinding().setEventsEnabled(false);
19
+ (0, bindings_1.getBinding)().setEventsEnabled(false);
20
20
  }
21
21
  };
22
22
  });
@@ -29,7 +29,7 @@ const eventParsers = {
29
29
  'interface/disconnected': main_pb_1.DisconnectedEvent,
30
30
  };
31
31
  const eventHandler = (eventBuffer) => {
32
- const structBuffers = serialization_1.deserialize(eventBuffer);
32
+ const structBuffers = (0, serialization_1.deserialize)(eventBuffer);
33
33
  const event = main_pb_1.Event.deserializeBinary(structBuffers[0]);
34
34
  const eventData = structBuffers[1] || null;
35
35
  const eventName = event.getEvent();
@@ -51,7 +51,7 @@ const eventHandler = (eventBuffer) => {
51
51
  observer.next(eventObject);
52
52
  }
53
53
  };
54
- bindings_1.addInitCallback(() => bindings_1.getBinding().setEventHandler(eventHandler));
55
- const filterEvent = (eventTypeToFilter) => (source) => source.pipe(operators_1.filter(({ eventType }) => eventType === eventTypeToFilter), operators_1.map(({ event }) => event));
54
+ (0, bindings_1.addInitCallback)(() => (0, bindings_1.getBinding)().setEventHandler(eventHandler));
55
+ const filterEvent = (eventTypeToFilter) => (source) => source.pipe((0, operators_1.filter)(({ eventType }) => eventType === eventTypeToFilter), (0, operators_1.map)(({ event }) => event));
56
56
  exports.filterEvent = filterEvent;
57
57
  //# sourceMappingURL=events.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/gateway/events.ts"],"names":[],"mappings":";;;AACA,+BAA4C;AAC5C,8CAA6C;AAE7C,kDAA2E;AAC3E,kDAA0H;AAE1H,yCAAyD;AACzD,mDAA8C;AAO9C,MAAM,aAAa,GAAG,IAAI,GAAG,EAAsB,CAAC;AAEvC,QAAA,MAAM,GAAyB,iBAAU,CAAC,MAAM,CAAC,CAAC,QAA4B,EAAE,EAAE;IAC7F,IAAI,aAAa,CAAC,IAAI,KAAK,CAAC,EAAE;QAC5B,qBAAU,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;KACrC;IAED,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAE5B,OAAO,GAAG,EAAE;QACV,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAE/B,IAAI,aAAa,CAAC,IAAI,KAAK,CAAC,EAAE;YAC5B,qBAAU,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;SACtC;IACH,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,YAAY,GAA4E;IAC5F,YAAY,EAAE,mBAAS;IACvB,4BAA4B,EAAE,8BAAoB;IAClD,mCAAmC,EAAE,oCAA0B;IAC/D,iBAAiB,EAAE,oBAAU;IAC7B,6BAA6B,EAAE,8BAAoB;IACnD,wBAAwB,EAAE,2BAAiB;CAC5C,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,WAAmB,EAAE,EAAE;IAC3C,MAAM,aAAa,GAAG,2BAAW,CAAC,WAAW,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,eAAK,CAAC,iBAAiB,CAAC,aAAa,CAAC,C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A,WAAW,eAIpB","sourcesContent":["import { Message } from 'google-protobuf';\nimport { Observable, Observer } from 'rxjs';\nimport { filter, map } from 'rxjs/operators';\n\nimport { Event, TestEvent, DisconnectedEvent } from '../protobufs/main_pb';\nimport { UnknownResponseEvent, UnknownBinaryResponseEvent, AlertEvent, BinaryReplyOnlyEvent } from '../protobufs/main_pb';\n\nimport { addInitCallback, getBinding } from './bindings';\nimport { deserialize } from './serialization';\n\ninterface SdkEvent {\n eventType: string;\n event: unknown;\n}\n\nconst subscriptions = new Set<Observer<SdkEvent>>();\n\nexport const events: Observable<SdkEvent> = Observable.create((observer: Observer<SdkEvent>) => {\n if (subscriptions.size === 0) {\n getBinding().setEventsEnabled(true);\n }\n\n subscriptions.add(observer);\n\n return () => {\n subscriptions.delete(observer);\n\n if (subscriptions.size === 0) {\n getBinding().setEventsEnabled(false);\n }\n };\n});\n\nconst eventParsers: { [event: string]: { deserializeBinary(buffer: Uint8Array): Message } } = {\n 'test/event': TestEvent,\n 'interface/unknown_response': UnknownResponseEvent,\n 'binary/interface/unknown_response': UnknownBinaryResponseEvent,\n 'interface/alert': AlertEvent,\n 'binary/interface/reply_only': BinaryReplyOnlyEvent,\n 'interface/disconnected': DisconnectedEvent,\n};\n\nconst eventHandler = (eventBuffer: Buffer) => {\n const structBuffers = deserialize(eventBuffer);\n const event = Event.deserializeBinary(structBuffers[0]);\n const eventData = structBuffers[1] || null;\n\n const eventName = event.getEvent();\n /* istanbul ignore if */\n if (!(eventName in eventParsers)) {\n throw new Error(`Unknown event: ${eventName}`);\n }\n const eventParser = eventParsers[eventName] || null;\n\n /* istanbul ignore if */\n if (!eventParser !== !eventData) {\n throw new Error(`Event data ignored or parser not provided for ${ eventName }`);\n }\n\n let eventDataProto: Record<string, unknown> | null = null;\n if (eventData) {\n eventDataProto = eventParser.deserializeBinary(eventData).toObject();\n }\n\n const eventObject: SdkEvent = { eventType: event.getEvent(), event: eventDataProto };\n\n for (const observer of subscriptions) {\n observer.next(eventObject);\n }\n};\n\naddInitCallback(() => getBinding().setEventHandler(eventHandler));\n\nexport const filterEvent = <T>(eventTypeToFilter: string) => (source: Observable<SdkEvent>) =>\n source.pipe(\n filter(({ eventType }) => eventType === eventTypeToFilter),\n map<SdkEvent, T>(({ event }) => event as T)\n );\n"]}
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/gateway/events.ts"],"names":[],"mappings":";;;AACA,+BAA4C;AAC5C,8CAA6C;AAE7C,kDAA2E;AAC3E,kDAA0H;AAE1H,yCAAyD;AACzD,mDAA8C;AAO9C,MAAM,aAAa,GAAG,IAAI,GAAG,EAAsB,CAAC;AAEvC,QAAA,MAAM,GAAyB,iBAAU,CAAC,MAAM,CAAC,CAAC,QAA4B,EAAE,EAAE;IAC7F,IAAI,aAAa,CAAC,IAAI,KAAK,CAAC,EAAE;QAC5B,IAAA,qBAAU,GAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;KACrC;IAED,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAE5B,OAAO,GAAG,EAAE;QACV,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAE/B,IAAI,aAAa,CAAC,IAAI,KAAK,CAAC,EAAE;YAC5B,IAAA,qBAAU,GAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;SACtC;IACH,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,YAAY,GAA4E;IAC5F,YAAY,EAAE,mBAAS;IACvB,4BAA4B,EAAE,8BAAoB;IAClD,mCAAmC,EAAE,oCAA0B;IAC/D,iBAAiB,EAAE,oBAAU;IAC7B,6BAA6B,EAAE,8BAAoB;IACnD,wBAAwB,EAAE,2BAAiB;CAC5C,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,WAAmB,EAAE,EAAE;IAC3C,MAAM,aAAa,GAAG,IAAA,2BAAW,EAAC,WAAW,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,eAAK,CAAC,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AAE,EAAE,CAAC,KAAU,CAAC,CAC5C,CAAC;AAJS,QAAA,WAAW,eAIpB","sourcesContent":["import { Message } from 'google-protobuf';\nimport { Observable, Observer } from 'rxjs';\nimport { filter, map } from 'rxjs/operators';\n\nimport { Event, TestEvent, DisconnectedEvent } from '../protobufs/main_pb';\nimport { UnknownResponseEvent, UnknownBinaryResponseEvent, AlertEvent, BinaryReplyOnlyEvent } from '../protobufs/main_pb';\n\nimport { addInitCallback, getBinding } from './bindings';\nimport { deserialize } from './serialization';\n\ninterface SdkEvent {\n eventType: string;\n event: unknown;\n}\n\nconst subscriptions = new Set<Observer<SdkEvent>>();\n\nexport const events: Observable<SdkEvent> = Observable.create((observer: Observer<SdkEvent>) => {\n if (subscriptions.size === 0) {\n getBinding().setEventsEnabled(true);\n }\n\n subscriptions.add(observer);\n\n return () => {\n subscriptions.delete(observer);\n\n if (subscriptions.size === 0) {\n getBinding().setEventsEnabled(false);\n }\n };\n});\n\nconst eventParsers: { [event: string]: { deserializeBinary(buffer: Uint8Array): Message } } = {\n 'test/event': TestEvent,\n 'interface/unknown_response': UnknownResponseEvent,\n 'binary/interface/unknown_response': UnknownBinaryResponseEvent,\n 'interface/alert': AlertEvent,\n 'binary/interface/reply_only': BinaryReplyOnlyEvent,\n 'interface/disconnected': DisconnectedEvent,\n};\n\nconst eventHandler = (eventBuffer: Buffer) => {\n const structBuffers = deserialize(eventBuffer);\n const event = Event.deserializeBinary(structBuffers[0]);\n const eventData = structBuffers[1] || null;\n\n const eventName = event.getEvent();\n /* istanbul ignore if */\n if (!(eventName in eventParsers)) {\n throw new Error(`Unknown event: ${eventName}`);\n }\n const eventParser = eventParsers[eventName] || null;\n\n /* istanbul ignore if */\n if (!eventParser !== !eventData) {\n throw new Error(`Event data ignored or parser not provided for ${ eventName }`);\n }\n\n let eventDataProto: Record<string, unknown> | null = null;\n if (eventData) {\n eventDataProto = eventParser.deserializeBinary(eventData).toObject();\n }\n\n const eventObject: SdkEvent = { eventType: event.getEvent(), event: eventDataProto };\n\n for (const observer of subscriptions) {\n observer.next(eventObject);\n }\n};\n\naddInitCallback(() => getBinding().setEventHandler(eventHandler));\n\nexport const filterEvent = <T>(eventTypeToFilter: string) => (source: Observable<SdkEvent>) =>\n source.pipe(\n filter(({ eventType }) => eventType === eventTypeToFilter),\n map<SdkEvent, T>(({ event }) => event as T)\n );\n"]}
@@ -4,7 +4,7 @@ exports.runWasm = void 0;
4
4
  const wasm_exec_1 = require("./wasm-exec");
5
5
  const runWasm = async (fetchResponse) => {
6
6
  if (window.Go == null) {
7
- wasm_exec_1.wasmExec();
7
+ (0, wasm_exec_1.wasmExec)();
8
8
  }
9
9
  const go = new window.Go();
10
10
  const result = await window.WebAssembly.instantiateStreaming(fetchResponse, go.importObject);
@@ -1 +1 @@
1
- {"version":3,"file":"wasm.js","sourceRoot":"","sources":["../../../src/gateway/wasm.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AAMhC,MAAM,OAAO,GAAG,KAAK,EAAE,aAA2B,EAA0B,EAAE;IACnF,IAAI,MAAM,CAAC,EAAE,IAAI,IAAI,EAAE;QACrB,oBAAQ,EAAE,CAAC;KACZ;IACD,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC;IAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAC1D,aAAa,EACb,EAAE,CAAC,YAAY,CAChB,CAAC;IACF,MAAM,YAAY,GAAG,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,YAAY,GAAG,OAAO,CAAC,CAAC;IACjF,MAAM,UAAU,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAE3C,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC;IAC/C,OAAO,EAAE,UAAU,EAAE,CAAC;AACxB,CAAC,CAAC;AAdW,QAAA,OAAO,WAclB","sourcesContent":["import { wasmExec } from './wasm-exec';\n\nexport interface RunWasmResult {\n runPromise: Promise<void>;\n}\n\nexport const runWasm = async (fetchResponse: Promise<any>): Promise<RunWasmResult> => {\n if (window.Go == null) {\n wasmExec();\n }\n const go = new window.Go();\n const result = await window.WebAssembly.instantiateStreaming(\n fetchResponse,\n go.importObject\n );\n const startPromise = new Promise<void>(resolve => window.__zmlStarted = resolve);\n const runPromise = go.run(result.instance);\n\n await Promise.race([startPromise, runPromise]);\n return { runPromise };\n};\n"]}
1
+ {"version":3,"file":"wasm.js","sourceRoot":"","sources":["../../../src/gateway/wasm.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AAMhC,MAAM,OAAO,GAAG,KAAK,EAAE,aAA2B,EAA0B,EAAE;IACnF,IAAI,MAAM,CAAC,EAAE,IAAI,IAAI,EAAE;QACrB,IAAA,oBAAQ,GAAE,CAAC;KACZ;IACD,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC;IAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAC1D,aAAa,EACb,EAAE,CAAC,YAAY,CAChB,CAAC;IACF,MAAM,YAAY,GAAG,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,YAAY,GAAG,OAAO,CAAC,CAAC;IACjF,MAAM,UAAU,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAE3C,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC;IAC/C,OAAO,EAAE,UAAU,EAAE,CAAC;AACxB,CAAC,CAAC;AAdW,QAAA,OAAO,WAclB","sourcesContent":["import { wasmExec } from './wasm-exec';\n\nexport interface RunWasmResult {\n runPromise: Promise<void>;\n}\n\nexport const runWasm = async (fetchResponse: Promise<any>): Promise<RunWasmResult> => {\n if (window.Go == null) {\n wasmExec();\n }\n const go = new window.Go();\n const result = await window.WebAssembly.instantiateStreaming(\n fetchResponse,\n go.importObject\n );\n const startPromise = new Promise<void>(resolve => window.__zmlStarted = resolve);\n const runPromise = go.run(result.instance);\n\n await Promise.race([startPromise, runPromise]);\n return { runPromise };\n};\n"]}
@@ -1,6 +1,5 @@
1
1
  export * from './ascii_ns';
2
2
  export * from './binary_ns';
3
- export * from './gcode_ns';
4
3
  export * from './exceptions';
5
4
  export { DeviceDbSourceType } from './device_db_source_type';
6
5
  export { FirmwareVersion } from './firmware_version';
@@ -8,5 +7,7 @@ export { Library } from './library';
8
7
  export { LogOutputMode } from './log_output_mode';
9
8
  export { Measurement } from './measurement';
10
9
  export { RotationDirection } from './rotation_direction';
10
+ export { CanSetStateAxisResponse } from './can_set_state_axis_response';
11
+ export { CanSetStateDeviceResponse } from './can_set_state_device_response';
11
12
  export { Tools } from './tools';
12
13
  export * from './units';
package/dist/lib/index.js CHANGED
@@ -10,10 +10,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.Tools = exports.RotationDirection = exports.Measurement = exports.LogOutputMode = exports.Library = exports.FirmwareVersion = exports.DeviceDbSourceType = void 0;
13
+ exports.Tools = exports.CanSetStateDeviceResponse = exports.CanSetStateAxisResponse = exports.RotationDirection = exports.Measurement = exports.LogOutputMode = exports.Library = exports.FirmwareVersion = exports.DeviceDbSourceType = void 0;
14
14
  __exportStar(require("./ascii_ns"), exports);
15
15
  __exportStar(require("./binary_ns"), exports);
16
- __exportStar(require("./gcode_ns"), exports);
17
16
  __exportStar(require("./exceptions"), exports);
18
17
  var device_db_source_type_1 = require("./device_db_source_type");
19
18
  Object.defineProperty(exports, "DeviceDbSourceType", { enumerable: true, get: function () { return device_db_source_type_1.DeviceDbSourceType; } });
@@ -27,6 +26,10 @@ var measurement_1 = require("./measurement");
27
26
  Object.defineProperty(exports, "Measurement", { enumerable: true, get: function () { return measurement_1.Measurement; } });
28
27
  var rotation_direction_1 = require("./rotation_direction");
29
28
  Object.defineProperty(exports, "RotationDirection", { enumerable: true, get: function () { return rotation_direction_1.RotationDirection; } });
29
+ var can_set_state_axis_response_1 = require("./can_set_state_axis_response");
30
+ Object.defineProperty(exports, "CanSetStateAxisResponse", { enumerable: true, get: function () { return can_set_state_axis_response_1.CanSetStateAxisResponse; } });
31
+ var can_set_state_device_response_1 = require("./can_set_state_device_response");
32
+ Object.defineProperty(exports, "CanSetStateDeviceResponse", { enumerable: true, get: function () { return can_set_state_device_response_1.CanSetStateDeviceResponse; } });
30
33
  var tools_1 = require("./tools");
31
34
  Object.defineProperty(exports, "Tools", { enumerable: true, get: function () { return tools_1.Tools; } });
32
35
  __exportStar(require("./units"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,8CAA4B;AAC5B,6CAA2B;AAC3B,+CAA6B;AAC7B,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAC3B,uDAAqD;AAA5C,mHAAA,eAAe,OAAA;AACxB,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,2DAAyD;AAAhD,uHAAA,iBAAiB,OAAA;AAC1B,iCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,0CAAwB","sourcesContent":["export * from './ascii_ns';\nexport * from './binary_ns';\nexport * from './gcode_ns';\nexport * from './exceptions';\nexport { DeviceDbSourceType } from './device_db_source_type';\nexport { FirmwareVersion } from './firmware_version';\nexport { Library } from './library';\nexport { LogOutputMode } from './log_output_mode';\nexport { Measurement } from './measurement';\nexport { RotationDirection } from './rotation_direction';\nexport { Tools } from './tools';\nexport * from './units';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,8CAA4B;AAC5B,+CAA6B;AAC7B,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAC3B,uDAAqD;AAA5C,mHAAA,eAAe,OAAA;AACxB,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,2DAAyD;AAAhD,uHAAA,iBAAiB,OAAA;AAC1B,6EAAwE;AAA/D,sIAAA,uBAAuB,OAAA;AAChC,iFAA4E;AAAnE,0IAAA,yBAAyB,OAAA;AAClC,iCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,0CAAwB","sourcesContent":["export * from './ascii_ns';\nexport * from './binary_ns';\nexport * from './exceptions';\nexport { DeviceDbSourceType } from './device_db_source_type';\nexport { FirmwareVersion } from './firmware_version';\nexport { Library } from './library';\nexport { LogOutputMode } from './log_output_mode';\nexport { Measurement } from './measurement';\nexport { RotationDirection } from './rotation_direction';\nexport { CanSetStateAxisResponse } from './can_set_state_axis_response';\nexport { CanSetStateDeviceResponse } from './can_set_state_device_response';\nexport { Tools } from './tools';\nexport * from './units';\n"]}
@@ -10,7 +10,7 @@ export interface Measurement {
10
10
  /**
11
11
  * Optional units of the measurement.
12
12
  */
13
- unit?: Units;
13
+ unit?: Units | null;
14
14
  }
15
15
  export declare namespace Measurement {
16
16
  const __type = "Measurement";
@@ -1 +1 @@
1
- {"version":3,"file":"measurement.js","sourceRoot":"","sources":["../../src/measurement.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,mDAAqC;AAmBrC,IAAiB,WAAW,CAU3B;AAVD,WAAiB,WAAW;IACb,kBAAM,GAAG,aAAa,CAAC;IAEpC,gBAAgB;IAChB,SAAgB,UAAU,CAAC,MAAmB;QAC5C,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACzC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9B,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAK,CAAC,CAAC;QAC7B,OAAO,MAAM,CAAC;IAChB,CAAC;IALe,sBAAU,aAKzB,CAAA;AACH,CAAC,EAVgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAU3B","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from './gateway';\nimport { Units } from './units';\n\n/**\n * Represents a numerical value with optional units specified.\n */\nexport interface Measurement {\n /**\n * Value of the measurement.\n */\n value: number;\n\n /**\n * Optional units of the measurement.\n */\n unit?: Units;\n\n}\n\nexport namespace Measurement {\n export const __type = 'Measurement';\n\n /** @internal */\n export function toProtobuf(source: Measurement): gateway.Measurement {\n const pbData = new gateway.Measurement();\n pbData.setValue(source.value);\n pbData.setUnit(source.unit!);\n return pbData;\n }\n}\n"]}
1
+ {"version":3,"file":"measurement.js","sourceRoot":"","sources":["../../src/measurement.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,mDAAqC;AAmBrC,IAAiB,WAAW,CAU3B;AAVD,WAAiB,WAAW;IACb,kBAAM,GAAG,aAAa,CAAC;IAEpC,gBAAgB;IAChB,SAAgB,UAAU,CAAC,MAAmB;QAC5C,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACzC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9B,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAK,CAAC,CAAC;QAC7B,OAAO,MAAM,CAAC;IAChB,CAAC;IALe,sBAAU,aAKzB,CAAA;AACH,CAAC,EAVgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAU3B","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from './gateway';\nimport { Units } from './units';\n\n/**\n * Represents a numerical value with optional units specified.\n */\nexport interface Measurement {\n /**\n * Value of the measurement.\n */\n value: number;\n\n /**\n * Optional units of the measurement.\n */\n unit?: Units | null;\n\n}\n\nexport namespace Measurement {\n export const __type = 'Measurement';\n\n /** @internal */\n export function toProtobuf(source: Measurement): gateway.Measurement {\n const pbData = new gateway.Measurement();\n pbData.setValue(source.value);\n pbData.setUnit(source.unit!);\n return pbData;\n }\n}\n"]}