@zaber/motion 7.3.0 → 7.4.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 (50) hide show
  1. package/LICENSE +963 -1209
  2. package/dist/binding/wasm/zaber-motion-core.wasm +0 -0
  3. package/dist/lib/ascii/all_axes.d.ts +16 -0
  4. package/dist/lib/ascii/all_axes.d.ts.map +1 -1
  5. package/dist/lib/ascii/all_axes.js +34 -0
  6. package/dist/lib/ascii/all_axes.js.map +1 -1
  7. package/dist/lib/ascii/axis.d.ts +17 -2
  8. package/dist/lib/ascii/axis.d.ts.map +1 -1
  9. package/dist/lib/ascii/axis.js +26 -4
  10. package/dist/lib/ascii/axis.js.map +1 -1
  11. package/dist/lib/ascii/device.d.ts +10 -0
  12. package/dist/lib/ascii/device.d.ts.map +1 -1
  13. package/dist/lib/ascii/device.js +21 -0
  14. package/dist/lib/ascii/device.js.map +1 -1
  15. package/dist/lib/finalizer.js.map +1 -1
  16. package/dist/lib/gateway/bindings.exec.js +2 -1
  17. package/dist/lib/gateway/bindings.exec.js.map +1 -1
  18. package/dist/lib/gateway/bindings.js.map +1 -1
  19. package/dist/lib/gateway/bindings.node.js +1 -1
  20. package/dist/lib/gateway/bindings.node.js.map +1 -1
  21. package/dist/lib/gateway/bindings.wasm.d.ts +1 -1
  22. package/dist/lib/gateway/bindings.wasm.d.ts.map +1 -1
  23. package/dist/lib/gateway/bindings.wasm.js +4 -4
  24. package/dist/lib/gateway/bindings.wasm.js.map +1 -1
  25. package/dist/lib/gateway/call.d.ts +1 -1
  26. package/dist/lib/gateway/call.d.ts.map +1 -1
  27. package/dist/lib/gateway/call.js.map +1 -1
  28. package/dist/lib/gateway/events.d.ts.map +1 -1
  29. package/dist/lib/gateway/events.js.map +1 -1
  30. package/dist/lib/gateway/sanitizer.js +3 -3
  31. package/dist/lib/gateway/sanitizer.js.map +1 -1
  32. package/dist/lib/gateway/serialization.d.ts +1 -1
  33. package/dist/lib/gateway/serialization.d.ts.map +1 -1
  34. package/dist/lib/gateway/serialization.js.map +1 -1
  35. package/dist/lib/library.js +1 -1
  36. package/dist/lib/library.js.map +1 -1
  37. package/dist/lib/requests/device_restore_request.d.ts +13 -0
  38. package/dist/lib/requests/device_restore_request.d.ts.map +1 -0
  39. package/dist/lib/requests/device_restore_request.js +31 -0
  40. package/dist/lib/requests/device_restore_request.js.map +1 -0
  41. package/dist/lib/requests/driver_enable_request.d.ts +13 -0
  42. package/dist/lib/requests/driver_enable_request.d.ts.map +1 -0
  43. package/dist/lib/requests/driver_enable_request.js +31 -0
  44. package/dist/lib/requests/driver_enable_request.js.map +1 -0
  45. package/dist/lib/requests/empty_request.js.map +1 -1
  46. package/dist/lib/requests/index.d.ts +2 -0
  47. package/dist/lib/requests/index.d.ts.map +1 -1
  48. package/dist/lib/requests/index.js +2 -0
  49. package/dist/lib/requests/index.js.map +1 -1
  50. package/package.json +5 -8
@@ -481,6 +481,27 @@ class Device {
481
481
  const response = await gateway.callAsync('device/renumber', request, requests.IntResponse.fromBinary);
482
482
  return new Device(this.connection, response.value);
483
483
  }
484
+ /**
485
+ * Restores most of the settings to their default values.
486
+ * Deletes all triggers, stream and PVT buffers, servo tunings.
487
+ * Deletes all zaber storage keys.
488
+ * Disables locksteps, unparks axes.
489
+ * Preserves storage, communication settings, peripherals (unless hard is specified).
490
+ * The device needs to be identified again after the restore.
491
+ * @param [hard=false] If true, completely erases device's memory. The device also resets.
492
+ */
493
+ async restore(hard = false) {
494
+ const request = {
495
+ ...requests.DeviceRestoreRequest.DEFAULT,
496
+ interfaceId: this.connection.interfaceId,
497
+ device: this.deviceAddress,
498
+ hard: hard,
499
+ toBinary() {
500
+ return requests.DeviceRestoreRequest.toBinary(this);
501
+ },
502
+ };
503
+ await gateway.callAsync('device/restore', request);
504
+ }
484
505
  /**
485
506
  * Returns identity.
486
507
  * @returns Device identity.
@@ -1 +1 @@
1
- {"version":3,"file":"device.js","sourceRoot":"","sources":["../../../src/ascii/device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YAAY,CAAC,UAAU,CAAC,CAAC;QACpC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AAjmBD,wBAimBC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Connection } from './connection';\nimport { DeviceSettings } from './device_settings';\nimport { Axis } from './axis';\nimport { AllAxes } from './all_axes';\nimport { Warnings } from './warnings';\nimport { DeviceIdentity } from './device_identity';\nimport { DeviceIO } from './device_io';\nimport { Response } from './response';\nimport { Lockstep } from './lockstep';\nimport { Oscilloscope } from './oscilloscope';\nimport { CanSetStateDeviceResponse } from './can_set_state_device_response';\nimport { Pvt } from './pvt';\nimport { Measurement } from '../measurement';\nimport { FirmwareVersion } from '../firmware_version';\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { DeviceStorage } from './storage';\nimport { Triggers } from './triggers';\nimport { Streams } from './streams';\nimport { SetStateDeviceResponse } from './set_state_device_response';\n\n/**\n * Represents the controller part of one device - may be either a standalone controller or an integrated controller.\n */\nexport class Device {\n /**\n * Connection of this device.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n /**\n * The device address uniquely identifies the device on the connection.\n * It can be configured or automatically assigned by the renumber command.\n */\n public get deviceAddress(): number {\n return this._deviceAddress;\n }\n private _deviceAddress: number;\n\n /**\n * Settings and properties of this device.\n */\n public get settings(): DeviceSettings {\n return this._settings;\n }\n private _settings: DeviceSettings;\n\n /**\n * Key-value storage of this device.\n */\n public get storage(): DeviceStorage {\n return this._storage;\n }\n private _storage: DeviceStorage;\n\n /**\n * I/O channels of this device.\n */\n public get io(): DeviceIO {\n return this._io;\n }\n private _io: DeviceIO;\n\n /**\n * Virtual axis which allows you to target all axes of this device.\n */\n public get allAxes(): AllAxes {\n return this._allAxes;\n }\n private _allAxes: AllAxes;\n\n /**\n * Warnings and faults of this device and all its axes.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n /**\n * Identity of the device.\n */\n public get identity(): DeviceIdentity {\n return this._retrieveIdentity();\n }\n\n /**\n * Indicates whether or not the device has been identified.\n */\n public get isIdentified(): boolean {\n return this._retrieveIsIdentified();\n }\n\n /**\n * Oscilloscope recording helper for this device.\n * Requires at least Firmware 7.00.\n */\n public get oscilloscope(): Oscilloscope {\n return this._oscilloscope;\n }\n private _oscilloscope: Oscilloscope;\n\n /**\n * Unique ID of the device hardware.\n */\n public get deviceId(): number {\n return this.identity.deviceId;\n }\n\n /**\n * Serial number of the device.\n */\n public get serialNumber(): number {\n return this.identity.serialNumber;\n }\n\n /**\n * Name of the product.\n */\n public get name(): string {\n return this.identity.name;\n }\n\n /**\n * Number of axes this device has.\n */\n public get axisCount(): number {\n return this.identity.axisCount;\n }\n\n /**\n * Version of the firmware.\n */\n public get firmwareVersion(): FirmwareVersion {\n return this.identity.firmwareVersion;\n }\n\n /**\n * The device is an integrated product.\n */\n public get isIntegrated(): boolean {\n return this.identity.isIntegrated;\n }\n\n /**\n * User-assigned label of the device.\n */\n public get label(): string {\n return this._retrieveLabel();\n }\n\n /**\n * Triggers for this device.\n * Requires at least Firmware 7.06.\n */\n public get triggers(): Triggers {\n return this._triggers;\n }\n private _triggers: Triggers;\n\n /**\n * Gets an object that provides access to Streams on this device.\n * Requires at least Firmware 7.05.\n */\n public get streams(): Streams {\n return this._streams;\n }\n private _streams: Streams;\n\n /**\n * Gets an object that provides access to PVT functions of this device.\n * Note that as of ZML v5.0.0, this returns a Pvt object and NOT a PvtSequence object.\n * The PvtSequence can now be obtained from the Pvt object.\n * Requires at least Firmware 7.33.\n */\n public get pvt(): Pvt {\n return this._pvt;\n }\n private _pvt: Pvt;\n\n constructor(connection: Connection, deviceAddress: number) {\n this._connection = connection;\n this._deviceAddress = deviceAddress;\n this._settings = new DeviceSettings(this);\n this._storage = new DeviceStorage(this);\n this._io = new DeviceIO(this);\n this._allAxes = new AllAxes(this);\n this._warnings = new Warnings(this, 0);\n this._oscilloscope = new Oscilloscope(this);\n this._triggers = new Triggers(this);\n this._streams = new Streams(this);\n this._pvt = new Pvt(this);\n }\n\n /**\n * Queries the device and the database, gathering information about the product.\n * Without this information features such as unit conversions will not work.\n * Usually, called automatically by detect devices method.\n * @param options.assumeVersion The identification assumes the specified firmware version\n * instead of the version queried from the device.\n * Providing this argument can lead to unexpected compatibility issues.\n * @returns Device identification data.\n */\n public async identify(\n options: Device.IdentifyOptions = {}\n ): Promise<DeviceIdentity> {\n const {\n assumeVersion,\n } = options;\n const request: requests.DeviceIdentifyRequest & gateway.Message = {\n ...requests.DeviceIdentifyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n assumeVersion: assumeVersion,\n toBinary() {\n return requests.DeviceIdentifyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<DeviceIdentity>(\n 'device/identify',\n request,\n DeviceIdentity.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this device.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: Device.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n axis: axis,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Response>(\n 'interface/generic_command',\n request,\n Response.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this device and expect multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: Device.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n axis: axis,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n requests.GenericCommandResponseCollection.fromBinary);\n return response.responses;\n }\n\n /**\n * Sends a generic ASCII command to this device without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * Specifying -1 omits the number completely.\n */\n public async genericCommandNoResponse(\n command: string,\n options: Device.GenericCommandNoResponseOptions = {}\n ): Promise<void> {\n const {\n axis = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n axis: axis,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Gets an Axis class instance which allows you to control a particular axis on this device.\n * Axes are numbered from 1.\n * @param axisNumber Number of axis intended to control.\n * @returns Axis instance.\n */\n public getAxis(\n axisNumber: number\n ): Axis {\n if (axisNumber <= 0) {\n throw new TypeError('Invalid value; physical axes are numbered from 1.');\n }\n return new Axis(this, axisNumber);\n }\n\n /**\n * Gets a Lockstep class instance which allows you to control a particular lockstep group on the device.\n * Requires at least Firmware 6.15 or 7.11.\n * @param lockstepGroupId The ID of the lockstep group to control. Lockstep group IDs start at one.\n * @returns Lockstep instance.\n */\n public getLockstep(\n lockstepGroupId: number\n ): Lockstep {\n if (lockstepGroupId <= 0) {\n throw new TypeError('Invalid value; lockstep groups are numbered from 1.');\n }\n return new Lockstep(this, lockstepGroupId);\n }\n\n /**\n * Formats parameters into a command and performs unit conversions.\n * Parameters in the command template are denoted by a question mark.\n * Command returned is only valid for this device.\n * Unit conversion is not supported for commands where axes can be remapped, such as stream and PVT commands.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param commandTemplate Template of a command to prepare. Parameters are denoted by question marks.\n * @param parameters Variable number of command parameters.\n * @returns Command with converted parameters.\n */\n public prepareCommand(\n commandTemplate: string,\n ...parameters: Measurement[]\n ): string {\n const request: requests.PrepareCommandRequest & gateway.Message = {\n ...requests.PrepareCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n commandTemplate: commandTemplate,\n parameters: parameters,\n toBinary() {\n return requests.PrepareCommandRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/prepare_command',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets the user-assigned device label.\n * The label is stored on the controller and recognized by other software.\n * @param label Label to set.\n */\n public async setLabel(\n label: string\n ): Promise<void> {\n const request: requests.DeviceSetStorageRequest & gateway.Message = {\n ...requests.DeviceSetStorageRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n value: label,\n toBinary() {\n return requests.DeviceSetStorageRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/set_label', request);\n }\n\n /**\n * Gets the device name.\n * @returns The label.\n */\n private _retrieveLabel(): string {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/get_label',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns a string that represents the device.\n * @returns A string that represents the device.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/device_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns a serialization of the current device state that can be saved and reapplied.\n * @returns A serialization of the current state of the device.\n */\n public async getState(): Promise<string> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.StringResponse>(\n 'device/get_state',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Applies a saved state to this device.\n * @param state The state object to apply to this device.\n * @param [options.deviceOnly=false] If true, only device scope settings and features will be set.\n * @returns Reports of any issues that were handled, but caused the state to not be exactly restored.\n */\n public async setState(\n state: string,\n options: Device.SetStateOptions = {}\n ): Promise<SetStateDeviceResponse> {\n const {\n deviceOnly = false,\n } = options;\n const request: requests.SetStateRequest & gateway.Message = {\n ...requests.SetStateRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n state: state,\n deviceOnly: deviceOnly,\n toBinary() {\n return requests.SetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<SetStateDeviceResponse>(\n 'device/set_device_state',\n request,\n SetStateDeviceResponse.fromBinary);\n return response;\n }\n\n /**\n * Checks if a state can be applied to this device.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @returns An object listing errors that come up when trying to set the state.\n */\n public async canSetState(\n state: string\n ): Promise<CanSetStateDeviceResponse> {\n const request: requests.CanSetStateRequest & gateway.Message = {\n ...requests.CanSetStateRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n state: state,\n toBinary() {\n return requests.CanSetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<CanSetStateDeviceResponse>(\n 'device/can_set_state',\n request,\n CanSetStateDeviceResponse.fromBinary);\n return response;\n }\n\n /**\n * Waits for the device to start responding to messages.\n * Useful to call after resetting the device.\n * Throws RequestTimeoutException upon timeout.\n * @param timeout For how long to wait in milliseconds for the device to start responding.\n */\n public async waitToRespond(\n timeout: number\n ): Promise<void> {\n const request: requests.WaitToRespondRequest & gateway.Message = {\n ...requests.WaitToRespondRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n timeout: timeout,\n toBinary() {\n return requests.WaitToRespondRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/wait_to_respond', request);\n }\n\n /**\n * Changes the address of this device.\n * After the address is successfully changed, the existing device class instance no longer represents the device.\n * Instead, use the new device instance returned by this method.\n * @param address The new address to assign to the device.\n * @returns New device instance with the new address.\n */\n public async renumber(\n address: number\n ): Promise<Device> {\n if (address < 1 || address > 99) {\n throw new TypeError('Invalid value; device addresses are numbered from 1 to 99.');\n }\n const request: requests.RenumberRequest & gateway.Message = {\n ...requests.RenumberRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n address: address,\n toBinary() {\n return requests.RenumberRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'device/renumber',\n request,\n requests.IntResponse.fromBinary);\n return new Device(this.connection, response.value);\n }\n\n /**\n * Returns identity.\n * @returns Device identity.\n */\n private _retrieveIdentity(): DeviceIdentity {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<DeviceIdentity>(\n 'device/get_identity',\n request,\n DeviceIdentity.fromBinary);\n return response;\n }\n\n /**\n * Returns whether or not the device have been identified.\n * @returns True if the device has already been identified. False otherwise.\n */\n private _retrieveIsIdentified(): boolean {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.BoolResponse>(\n 'device/get_is_identified',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Device {\n export interface IdentifyOptions {\n /**\n * The identification assumes the specified firmware version\n * instead of the version queried from the device.\n * Providing this argument can lead to unexpected compatibility issues.\n */\n assumeVersion?: FirmwareVersion;\n }\n export interface GenericCommandOptions {\n /**\n * Optional axis number to send the command to.\n */\n axis?: number;\n /**\n * Controls whether to throw an exception when the device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n /**\n * Optional axis number to send the command to.\n */\n axis?: number;\n /**\n * Controls whether to throw an exception when a device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandNoResponseOptions {\n /**\n * Optional axis number to send the command to.\n * Specifying -1 omits the number completely.\n */\n axis?: number;\n }\n export interface SetStateOptions {\n /**\n * If true, only device scope settings and features will be set.\n */\n deviceOnly?: boolean;\n }\n}\n"]}
1
+ {"version":3,"file":"device.js","sourceRoot":"","sources":["../../../src/ascii/device.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,uDAAmD;AACnD,iCAA8B;AAC9B,yCAAqC;AACrC,yCAAsC;AACtC,uDAAmD;AACnD,2CAAuC;AACvC,yCAAsC;AACtC,yCAAsC;AACtC,iDAA8C;AAC9C,mFAA4E;AAC5E,+BAA4B;AAG5B,oDAAsC;AACtC,sDAAwC;AACxC,uCAA0C;AAC1C,yCAAsC;AACtC,uCAAoC;AACpC,2EAAqE;AAErE;;GAEG;AACH,MAAa,MAAM;IACjB;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD;;;OAGG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAGD;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAGD;;OAEG;IACH,IAAW,EAAE;QACX,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAGD;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACt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Q,CAAC,IAAI,CAAC,CAAC;YACpD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,qBAAqB,EACrB,OAAO,EACP,gCAAc,CAAC,UAAU,CAAC,CAAC;QAC7B,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;OAGG;IACK,qBAAqB;QAC3B,MAAM,OAAO,GAAkD;YAC7D,GAAG,QAAQ,CAAC,kBAAkB,CAAC,OAAO;YACtC,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW;YACxC,MAAM,EAAE,IAAI,CAAC,aAAa;YAC1B,QAAQ;gBACN,OAAO,QAAQ,CAAC,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACpD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,0BAA0B,EAC1B,OAAO,EACP,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QACpC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AA1nBD,wBA0nBC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Connection } from './connection';\nimport { DeviceSettings } from './device_settings';\nimport { Axis } from './axis';\nimport { AllAxes } from './all_axes';\nimport { Warnings } from './warnings';\nimport { DeviceIdentity } from './device_identity';\nimport { DeviceIO } from './device_io';\nimport { Response } from './response';\nimport { Lockstep } from './lockstep';\nimport { Oscilloscope } from './oscilloscope';\nimport { CanSetStateDeviceResponse } from './can_set_state_device_response';\nimport { Pvt } from './pvt';\nimport { Measurement } from '../measurement';\nimport { FirmwareVersion } from '../firmware_version';\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { DeviceStorage } from './storage';\nimport { Triggers } from './triggers';\nimport { Streams } from './streams';\nimport { SetStateDeviceResponse } from './set_state_device_response';\n\n/**\n * Represents the controller part of one device - may be either a standalone controller or an integrated controller.\n */\nexport class Device {\n /**\n * Connection of this device.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n /**\n * The device address uniquely identifies the device on the connection.\n * It can be configured or automatically assigned by the renumber command.\n */\n public get deviceAddress(): number {\n return this._deviceAddress;\n }\n private _deviceAddress: number;\n\n /**\n * Settings and properties of this device.\n */\n public get settings(): DeviceSettings {\n return this._settings;\n }\n private _settings: DeviceSettings;\n\n /**\n * Key-value storage of this device.\n */\n public get storage(): DeviceStorage {\n return this._storage;\n }\n private _storage: DeviceStorage;\n\n /**\n * I/O channels of this device.\n */\n public get io(): DeviceIO {\n return this._io;\n }\n private _io: DeviceIO;\n\n /**\n * Virtual axis which allows you to target all axes of this device.\n */\n public get allAxes(): AllAxes {\n return this._allAxes;\n }\n private _allAxes: AllAxes;\n\n /**\n * Warnings and faults of this device and all its axes.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n /**\n * Identity of the device.\n */\n public get identity(): DeviceIdentity {\n return this._retrieveIdentity();\n }\n\n /**\n * Indicates whether or not the device has been identified.\n */\n public get isIdentified(): boolean {\n return this._retrieveIsIdentified();\n }\n\n /**\n * Oscilloscope recording helper for this device.\n * Requires at least Firmware 7.00.\n */\n public get oscilloscope(): Oscilloscope {\n return this._oscilloscope;\n }\n private _oscilloscope: Oscilloscope;\n\n /**\n * Unique ID of the device hardware.\n */\n public get deviceId(): number {\n return this.identity.deviceId;\n }\n\n /**\n * Serial number of the device.\n */\n public get serialNumber(): number {\n return this.identity.serialNumber;\n }\n\n /**\n * Name of the product.\n */\n public get name(): string {\n return this.identity.name;\n }\n\n /**\n * Number of axes this device has.\n */\n public get axisCount(): number {\n return this.identity.axisCount;\n }\n\n /**\n * Version of the firmware.\n */\n public get firmwareVersion(): FirmwareVersion {\n return this.identity.firmwareVersion;\n }\n\n /**\n * The device is an integrated product.\n */\n public get isIntegrated(): boolean {\n return this.identity.isIntegrated;\n }\n\n /**\n * User-assigned label of the device.\n */\n public get label(): string {\n return this._retrieveLabel();\n }\n\n /**\n * Triggers for this device.\n * Requires at least Firmware 7.06.\n */\n public get triggers(): Triggers {\n return this._triggers;\n }\n private _triggers: Triggers;\n\n /**\n * Gets an object that provides access to Streams on this device.\n * Requires at least Firmware 7.05.\n */\n public get streams(): Streams {\n return this._streams;\n }\n private _streams: Streams;\n\n /**\n * Gets an object that provides access to PVT functions of this device.\n * Note that as of ZML v5.0.0, this returns a Pvt object and NOT a PvtSequence object.\n * The PvtSequence can now be obtained from the Pvt object.\n * Requires at least Firmware 7.33.\n */\n public get pvt(): Pvt {\n return this._pvt;\n }\n private _pvt: Pvt;\n\n constructor(connection: Connection, deviceAddress: number) {\n this._connection = connection;\n this._deviceAddress = deviceAddress;\n this._settings = new DeviceSettings(this);\n this._storage = new DeviceStorage(this);\n this._io = new DeviceIO(this);\n this._allAxes = new AllAxes(this);\n this._warnings = new Warnings(this, 0);\n this._oscilloscope = new Oscilloscope(this);\n this._triggers = new Triggers(this);\n this._streams = new Streams(this);\n this._pvt = new Pvt(this);\n }\n\n /**\n * Queries the device and the database, gathering information about the product.\n * Without this information features such as unit conversions will not work.\n * Usually, called automatically by detect devices method.\n * @param options.assumeVersion The identification assumes the specified firmware version\n * instead of the version queried from the device.\n * Providing this argument can lead to unexpected compatibility issues.\n * @returns Device identification data.\n */\n public async identify(\n options: Device.IdentifyOptions = {}\n ): Promise<DeviceIdentity> {\n const {\n assumeVersion,\n } = options;\n const request: requests.DeviceIdentifyRequest & gateway.Message = {\n ...requests.DeviceIdentifyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n assumeVersion: assumeVersion,\n toBinary() {\n return requests.DeviceIdentifyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<DeviceIdentity>(\n 'device/identify',\n request,\n DeviceIdentity.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this device.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: Device.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n axis: axis,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Response>(\n 'interface/generic_command',\n request,\n Response.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this device and expect multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: Device.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n axis: axis,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n requests.GenericCommandResponseCollection.fromBinary);\n return response.responses;\n }\n\n /**\n * Sends a generic ASCII command to this device without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * Specifying -1 omits the number completely.\n */\n public async genericCommandNoResponse(\n command: string,\n options: Device.GenericCommandNoResponseOptions = {}\n ): Promise<void> {\n const {\n axis = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n axis: axis,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Gets an Axis class instance which allows you to control a particular axis on this device.\n * Axes are numbered from 1.\n * @param axisNumber Number of axis intended to control.\n * @returns Axis instance.\n */\n public getAxis(\n axisNumber: number\n ): Axis {\n if (axisNumber <= 0) {\n throw new TypeError('Invalid value; physical axes are numbered from 1.');\n }\n return new Axis(this, axisNumber);\n }\n\n /**\n * Gets a Lockstep class instance which allows you to control a particular lockstep group on the device.\n * Requires at least Firmware 6.15 or 7.11.\n * @param lockstepGroupId The ID of the lockstep group to control. Lockstep group IDs start at one.\n * @returns Lockstep instance.\n */\n public getLockstep(\n lockstepGroupId: number\n ): Lockstep {\n if (lockstepGroupId <= 0) {\n throw new TypeError('Invalid value; lockstep groups are numbered from 1.');\n }\n return new Lockstep(this, lockstepGroupId);\n }\n\n /**\n * Formats parameters into a command and performs unit conversions.\n * Parameters in the command template are denoted by a question mark.\n * Command returned is only valid for this device.\n * Unit conversion is not supported for commands where axes can be remapped, such as stream and PVT commands.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param commandTemplate Template of a command to prepare. Parameters are denoted by question marks.\n * @param parameters Variable number of command parameters.\n * @returns Command with converted parameters.\n */\n public prepareCommand(\n commandTemplate: string,\n ...parameters: Measurement[]\n ): string {\n const request: requests.PrepareCommandRequest & gateway.Message = {\n ...requests.PrepareCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n commandTemplate: commandTemplate,\n parameters: parameters,\n toBinary() {\n return requests.PrepareCommandRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/prepare_command',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets the user-assigned device label.\n * The label is stored on the controller and recognized by other software.\n * @param label Label to set.\n */\n public async setLabel(\n label: string\n ): Promise<void> {\n const request: requests.DeviceSetStorageRequest & gateway.Message = {\n ...requests.DeviceSetStorageRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n value: label,\n toBinary() {\n return requests.DeviceSetStorageRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/set_label', request);\n }\n\n /**\n * Gets the device name.\n * @returns The label.\n */\n private _retrieveLabel(): string {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/get_label',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns a string that represents the device.\n * @returns A string that represents the device.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/device_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns a serialization of the current device state that can be saved and reapplied.\n * @returns A serialization of the current state of the device.\n */\n public async getState(): Promise<string> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.StringResponse>(\n 'device/get_state',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Applies a saved state to this device.\n * @param state The state object to apply to this device.\n * @param [options.deviceOnly=false] If true, only device scope settings and features will be set.\n * @returns Reports of any issues that were handled, but caused the state to not be exactly restored.\n */\n public async setState(\n state: string,\n options: Device.SetStateOptions = {}\n ): Promise<SetStateDeviceResponse> {\n const {\n deviceOnly = false,\n } = options;\n const request: requests.SetStateRequest & gateway.Message = {\n ...requests.SetStateRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n state: state,\n deviceOnly: deviceOnly,\n toBinary() {\n return requests.SetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<SetStateDeviceResponse>(\n 'device/set_device_state',\n request,\n SetStateDeviceResponse.fromBinary);\n return response;\n }\n\n /**\n * Checks if a state can be applied to this device.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @returns An object listing errors that come up when trying to set the state.\n */\n public async canSetState(\n state: string\n ): Promise<CanSetStateDeviceResponse> {\n const request: requests.CanSetStateRequest & gateway.Message = {\n ...requests.CanSetStateRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n state: state,\n toBinary() {\n return requests.CanSetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<CanSetStateDeviceResponse>(\n 'device/can_set_state',\n request,\n CanSetStateDeviceResponse.fromBinary);\n return response;\n }\n\n /**\n * Waits for the device to start responding to messages.\n * Useful to call after resetting the device.\n * Throws RequestTimeoutException upon timeout.\n * @param timeout For how long to wait in milliseconds for the device to start responding.\n */\n public async waitToRespond(\n timeout: number\n ): Promise<void> {\n const request: requests.WaitToRespondRequest & gateway.Message = {\n ...requests.WaitToRespondRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n timeout: timeout,\n toBinary() {\n return requests.WaitToRespondRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/wait_to_respond', request);\n }\n\n /**\n * Changes the address of this device.\n * After the address is successfully changed, the existing device class instance no longer represents the device.\n * Instead, use the new device instance returned by this method.\n * @param address The new address to assign to the device.\n * @returns New device instance with the new address.\n */\n public async renumber(\n address: number\n ): Promise<Device> {\n if (address < 1 || address > 99) {\n throw new TypeError('Invalid value; device addresses are numbered from 1 to 99.');\n }\n const request: requests.RenumberRequest & gateway.Message = {\n ...requests.RenumberRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n address: address,\n toBinary() {\n return requests.RenumberRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'device/renumber',\n request,\n requests.IntResponse.fromBinary);\n return new Device(this.connection, response.value);\n }\n\n /**\n * Restores most of the settings to their default values.\n * Deletes all triggers, stream and PVT buffers, servo tunings.\n * Deletes all zaber storage keys.\n * Disables locksteps, unparks axes.\n * Preserves storage, communication settings, peripherals (unless hard is specified).\n * The device needs to be identified again after the restore.\n * @param [hard=false] If true, completely erases device's memory. The device also resets.\n */\n public async restore(\n hard: boolean = false\n ): Promise<void> {\n const request: requests.DeviceRestoreRequest & gateway.Message = {\n ...requests.DeviceRestoreRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n hard: hard,\n toBinary() {\n return requests.DeviceRestoreRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/restore', request);\n }\n\n /**\n * Returns identity.\n * @returns Device identity.\n */\n private _retrieveIdentity(): DeviceIdentity {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<DeviceIdentity>(\n 'device/get_identity',\n request,\n DeviceIdentity.fromBinary);\n return response;\n }\n\n /**\n * Returns whether or not the device have been identified.\n * @returns True if the device has already been identified. False otherwise.\n */\n private _retrieveIsIdentified(): boolean {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.BoolResponse>(\n 'device/get_is_identified',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Device {\n export interface IdentifyOptions {\n /**\n * The identification assumes the specified firmware version\n * instead of the version queried from the device.\n * Providing this argument can lead to unexpected compatibility issues.\n */\n assumeVersion?: FirmwareVersion;\n }\n export interface GenericCommandOptions {\n /**\n * Optional axis number to send the command to.\n */\n axis?: number;\n /**\n * Controls whether to throw an exception when the device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n /**\n * Optional axis number to send the command to.\n */\n axis?: number;\n /**\n * Controls whether to throw an exception when a device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandNoResponseOptions {\n /**\n * Optional axis number to send the command to.\n * Specifying -1 omits the number completely.\n */\n axis?: number;\n }\n export interface SetStateOptions {\n /**\n * If true, only device scope settings and features will be set.\n */\n deviceOnly?: boolean;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"finalizer.js","sourceRoot":"","sources":["../../src/finalizer.ts"],"names":[],"mappings":";;;AAAA,IAAI,oBAAkE,CAAC;AAEvE,IAAI,OAAO,oBAAoB,KAAK,WAAW,EAAE,CAAC;IAChD,oBAAoB,GAAG,IAAI,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;AACxE,CAAC;AAED;;;GAGG;AACI,MAAM,uBAAuB,GAAG,CAAC,QAAgB,EAAE,OAAmB,EAAE,EAAE;IAC/E,IAAI,oBAAoB,IAAI,IAAI,EAAE,CAAC;QACjC,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,2EAA2E,QAAQ,CAAC,WAAW,CAAC,IAAI,0BAA0B,CAAC,CAAC;QAC7I,OAAO;IACT,CAAC;IACD,oBAAoB,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC,CAAC;AAPW,QAAA,uBAAuB,2BAOlC","sourcesContent":["let finalizationRegistry: FinalizationRegistry<() => void> | undefined;\n\nif (typeof FinalizationRegistry !== 'undefined') {\n finalizationRegistry = new FinalizationRegistry(cleanup => cleanup());\n}\n\n/**\n * @param instance what to finalize\n * @param cleanup callback performing the finalization (MUST NOT hold reference to instance)\n */\nexport const registerForFinalization = (instance: object, cleanup: () => void) => { // eslint-disable-line @typescript-eslint/ban-types\n if (finalizationRegistry == null) {\n // eslint-disable-next-line no-console\n console.warn(`FinalizationRegistry is not supported by your environment, instances of ${instance.constructor.name} must be freed manually.`);\n return;\n }\n finalizationRegistry.register(instance, cleanup);\n};\n"]}
1
+ {"version":3,"file":"finalizer.js","sourceRoot":"","sources":["../../src/finalizer.ts"],"names":[],"mappings":";;;AAAA,IAAI,oBAAkE,CAAC;AAEvE,IAAI,OAAO,oBAAoB,KAAK,WAAW,EAAE,CAAC;IAChD,oBAAoB,GAAG,IAAI,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;AACxE,CAAC;AAED;;;GAGG;AACI,MAAM,uBAAuB,GAAG,CAAC,QAAgB,EAAE,OAAmB,EAAE,EAAE;IAC/E,IAAI,oBAAoB,IAAI,IAAI,EAAE,CAAC;QACjC,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,2EAA2E,QAAQ,CAAC,WAAW,CAAC,IAAI,0BAA0B,CAAC,CAAC;QAC7I,OAAO;IACT,CAAC;IACD,oBAAoB,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC,CAAC;AAPW,QAAA,uBAAuB,2BAOlC","sourcesContent":["let finalizationRegistry: FinalizationRegistry<() => void> | undefined;\n\nif (typeof FinalizationRegistry !== 'undefined') {\n finalizationRegistry = new FinalizationRegistry(cleanup => cleanup());\n}\n\n/**\n * @param instance what to finalize\n * @param cleanup callback performing the finalization (MUST NOT hold reference to instance)\n */\nexport const registerForFinalization = (instance: object, cleanup: () => void) => {\n if (finalizationRegistry == null) {\n // eslint-disable-next-line no-console\n console.warn(`FinalizationRegistry is not supported by your environment, instances of ${instance.constructor.name} must be freed manually.`);\n return;\n }\n finalizationRegistry.register(instance, cleanup);\n};\n"]}
@@ -11,6 +11,7 @@ try {
11
11
  module.exports.loadDll(execLibPath);
12
12
  }
13
13
  catch (error) {
14
- throw new Error(`Failed to load bindings at "${execLibPath}" (${error})`);
14
+ const errorStr = error instanceof Error ? String(error) : JSON.stringify(error);
15
+ throw new Error(`Failed to load bindings at "${execLibPath}" (${errorStr})`);
15
16
  }
16
17
  //# sourceMappingURL=bindings.exec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bindings.exec.js","sourceRoot":"","sources":["../../../src/gateway/bindings.exec.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,yCAA4C;AAE5C,MAAM,WAAW,GAAG,yBAAc,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,cAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,yBAAc,GAAG,cAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,yBAAc,CAAC;AACzG,IAAI,CAAC;IACH,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC,CAAC;IACpE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;AACtC,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC;IACf,MAAM,IAAI,KAAK,CAAC,+BAA+B,WAAW,MAAM,KAAK,GAAG,CAAC,CAAC;AAC5E,CAAC","sourcesContent":["import path from 'path';\nimport { bindingLibPath } from './bindings';\n\nconst execLibPath = bindingLibPath.at(-1) !== path.sep ? `${bindingLibPath}${path.sep}` : bindingLibPath;\ntry {\n process.dlopen(module, path.join(execLibPath, 'zaber-motion.node'));\n module.exports.loadDll(execLibPath);\n} catch (error) {\n throw new Error(`Failed to load bindings at \"${execLibPath}\" (${error})`);\n}\n"]}
1
+ {"version":3,"file":"bindings.exec.js","sourceRoot":"","sources":["../../../src/gateway/bindings.exec.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,yCAA4C;AAE5C,MAAM,WAAW,GAAG,yBAAc,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,cAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,yBAAc,GAAG,cAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,yBAAc,CAAC;AACzG,IAAI,CAAC;IACH,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC,CAAC;IACpE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;AACtC,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC;IACf,MAAM,QAAQ,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAChF,MAAM,IAAI,KAAK,CAAC,+BAA+B,WAAW,MAAM,QAAQ,GAAG,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["import path from 'path';\nimport { bindingLibPath } from './bindings';\n\nconst execLibPath = bindingLibPath.at(-1) !== path.sep ? `${bindingLibPath}${path.sep}` : bindingLibPath;\ntry {\n process.dlopen(module, path.join(execLibPath, 'zaber-motion.node'));\n module.exports.loadDll(execLibPath);\n} catch (error) {\n const errorStr = error instanceof Error ? String(error) : JSON.stringify(error);\n throw new Error(`Failed to load bindings at \"${execLibPath}\" (${errorStr})`);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bindings.js","sourceRoot":"","sources":["../../../src/gateway/bindings.ts"],"names":[],"mappings":";;;AAGA,IAAI,OAAO,GAAQ,MAAM,CAAC;AACf,QAAA,cAAc,GAAG,EAAE,CAAC;AAC/B,IAAI,MAAM,GAAG,KAAK,CAAC;AACnB,IAAI,QAAa,CAAC;AAClB,IAAI,aAAa,GAA0B,EAAE,CAAC;AAI9C,SAAgB,MAAM,CAAC,GAAQ,EAAE,OAAgB;IAC/C,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,GAAG,GAAG,CAAC;IACd,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACpB,sBAAc,GAAG,OAAO,CAAC;IAC3B,CAAC;AACH,CAAC;AARD,wBAQC;AAEM,MAAM,UAAU,GAAG,GAAQ,EAAE;IAClC,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;QACrB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,MAAM,GAAG,IAAI,CAAC;IACd,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QACvB,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACxC,CAAC;SAAM,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QAC9B,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC;IAChD,CAAC;SAAM,CAAC;QACN,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC;IAChD,CAAC;IAED,aAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC/C,aAAa,GAAG,IAAI,CAAC;IAErB,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAjBW,QAAA,UAAU,cAiBrB;AAEK,MAAM,eAAe,GAAG,CAAC,EAAc,EAAE,EAAE;IAChD,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IACD,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzB,CAAC,CAAC;AALW,QAAA,eAAe,mBAK1B","sourcesContent":["/* eslint-disable @typescript-eslint/no-var-requires */\ntype Env = 'node' | 'wasm' | 'exec';\n\nlet execEnv: Env = 'node';\nexport let bindingLibPath = '';\nlet locked = false;\nlet bindings: any;\nlet initCallbacks: (() => void)[] | null = [];\n\nexport function setEnv(env: Exclude<Env, 'exec'>): void;\nexport function setEnv(env: 'exec', libPath: string): void;\nexport function setEnv(env: Env, libPath?: string): void {\n if (locked) {\n throw new Error('Library was already loaded.');\n }\n execEnv = env;\n if (libPath != null) {\n bindingLibPath = libPath;\n }\n}\n\nexport const getBinding = (): any => {\n if (bindings != null) {\n return bindings;\n }\n locked = true;\n if (execEnv === 'exec') {\n bindings = require('./bindings.exec');\n } else if (execEnv === 'node') {\n bindings = require('./bindings.node').binding;\n } else {\n bindings = require('./bindings.wasm').binding;\n }\n\n initCallbacks!.forEach(callback => callback());\n initCallbacks = null;\n\n return bindings;\n};\n\nexport const addInitCallback = (cb: () => void) => {\n if (initCallbacks == null) {\n throw new Error('Library was already loaded.');\n }\n initCallbacks.push(cb);\n};\n"]}
1
+ {"version":3,"file":"bindings.js","sourceRoot":"","sources":["../../../src/gateway/bindings.ts"],"names":[],"mappings":";;;AA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CAAC;IACD,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzB,CAAC,CAAC;AALW,QAAA,eAAe,mBAK1B","sourcesContent":["/* eslint-disable @typescript-eslint/no-require-imports */\ntype Env = 'node' | 'wasm' | 'exec';\n\nlet execEnv: Env = 'node';\nexport let bindingLibPath = '';\nlet locked = false;\nlet bindings: any;\nlet initCallbacks: (() => void)[] | null = [];\n\nexport function setEnv(env: Exclude<Env, 'exec'>): void;\nexport function setEnv(env: 'exec', libPath: string): void;\nexport function setEnv(env: Env, libPath?: string): void {\n if (locked) {\n throw new Error('Library was already loaded.');\n }\n execEnv = env;\n if (libPath != null) {\n bindingLibPath = libPath;\n }\n}\n\nexport const getBinding = (): any => {\n if (bindings != null) {\n return bindings;\n }\n locked = true;\n if (execEnv === 'exec') {\n bindings = require('./bindings.exec');\n } else if (execEnv === 'node') {\n bindings = require('./bindings.node').binding;\n } else {\n bindings = require('./bindings.wasm').binding;\n }\n\n initCallbacks!.forEach(callback => callback());\n initCallbacks = null;\n\n return bindings;\n};\n\nexport const addInitCallback = (cb: () => void) => {\n if (initCallbacks == null) {\n throw new Error('Library was already loaded.');\n }\n initCallbacks.push(cb);\n};\n"]}
@@ -9,7 +9,7 @@ const pkg_up_1 = __importDefault(require("pkg-up"));
9
9
  const node_pre_gyp_1 = __importDefault(require("@mapbox/node-pre-gyp"));
10
10
  const packageJsonPath = pkg_up_1.default.sync({ cwd: __dirname });
11
11
  const bindingPath = node_pre_gyp_1.default.find(packageJsonPath);
12
- // eslint-disable-next-line @typescript-eslint/no-var-requires
12
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
13
13
  exports.binding = require(bindingPath);
14
14
  let dllPath = path_1.default.dirname(bindingPath) + path_1.default.sep;
15
15
  const isElectron = !!process.versions.electron;
@@ -1 +1 @@
1
- {"version":3,"file":"bindings.node.js","sourceRoot":"","sources":["../../../src/gateway/bindings.node.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,oDAA2B;AAC3B,wEAA0C;AAE1C,MAAM,eAAe,GAAG,gBAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;AACvD,MAAM,WAAW,GAAG,sBAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AACjD,8DAA8D;AACjD,QAAA,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAE5C,IAAI,OAAO,GAAG,cAAI,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,cAAI,CAAC,GAAG,CAAC;AAEnD,MAAM,UAAU,GAAG,CAAC,CAAE,OAAO,CAAC,QAA8C,CAAC,QAAQ,CAAC;AACtF,IAAI,UAAU,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC;IACzD,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;AAC7D,CAAC;AAED,eAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC","sourcesContent":["import path from 'path';\n\nimport pkgUp from 'pkg-up';\nimport binary from '@mapbox/node-pre-gyp';\n\nconst packageJsonPath = pkgUp.sync({ cwd: __dirname });\nconst bindingPath = binary.find(packageJsonPath);\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nexport const binding = require(bindingPath);\n\nlet dllPath = path.dirname(bindingPath) + path.sep;\n\nconst isElectron = !!(process.versions as unknown as Record<string, string>).electron;\nif (isElectron && !dllPath.includes('app.asar.unpacked')) {\n dllPath = dllPath.replace('app.asar', 'app.asar.unpacked');\n}\n\nbinding.loadDll(dllPath);\n"]}
1
+ {"version":3,"file":"bindings.node.js","sourceRoot":"","sources":["../../../src/gateway/bindings.node.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,oDAA2B;AAC3B,wEAA0C;AAE1C,MAAM,eAAe,GAAG,gBAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;AACvD,MAAM,WAAW,GAAG,sBAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AACjD,iEAAiE;AACpD,QAAA,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAE5C,IAAI,OAAO,GAAG,cAAI,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,cAAI,CAAC,GAAG,CAAC;AAEnD,MAAM,UAAU,GAAG,CAAC,CAAE,OAAO,CAAC,QAA8C,CAAC,QAAQ,CAAC;AACtF,IAAI,UAAU,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC;IACzD,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;AAC7D,CAAC;AAED,eAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC","sourcesContent":["import path from 'path';\n\nimport pkgUp from 'pkg-up';\nimport binary from '@mapbox/node-pre-gyp';\n\nconst packageJsonPath = pkgUp.sync({ cwd: __dirname });\nconst bindingPath = binary.find(packageJsonPath);\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nexport const binding = require(bindingPath);\n\nlet dllPath = path.dirname(bindingPath) + path.sep;\n\nconst isElectron = !!(process.versions as unknown as Record<string, string>).electron;\nif (isElectron && !dllPath.includes('app.asar.unpacked')) {\n dllPath = dllPath.replace('app.asar', 'app.asar.unpacked');\n}\n\nbinding.loadDll(dllPath);\n"]}
@@ -1,6 +1,6 @@
1
1
  export declare const binding: {
2
2
  setEventHandler: (eventHandler: (eventUint8Array: Uint8Array) => void) => void;
3
- setEventsEnabled: (enabled: boolean) => void;
3
+ setEventsEnabled: () => void;
4
4
  callAsync: (data: Uint8Array, resolve: (buffer: Uint8Array) => void) => void;
5
5
  callSync: (data: Uint8Array) => Uint8Array;
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"bindings.wasm.d.ts","sourceRoot":"","sources":["../../../src/gateway/bindings.wasm.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;sDACgC,UAAU,KAAK,IAAI,KAAG,IAAI;gCAMhD,OAAO,KAAG,IAAI;sBACxB,UAAU,oBAAoB,UAAU,KAAK,IAAI,KAAG,IAAI;qBAMzD,UAAU,KAAG,UAAU;CAKzC,CAAC"}
1
+ {"version":3,"file":"bindings.wasm.d.ts","sourceRoot":"","sources":["../../../src/gateway/bindings.wasm.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;sDACgC,UAAU,KAAK,IAAI,KAAG,IAAI;4BAMtD,IAAI;sBACR,UAAU,oBAAoB,UAAU,KAAK,IAAI,KAAG,IAAI;qBAMzD,UAAU,KAAG,UAAU;CAKzC,CAAC"}
@@ -5,8 +5,8 @@ exports.binding = {
5
5
  setEventHandler: (eventHandler) => {
6
6
  window.__zmlSetEventHandler((eventString) => eventHandler(decodeBase64(eventString)));
7
7
  },
8
- // eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-function
9
- setEventsEnabled: (enabled) => { },
8
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
9
+ setEventsEnabled: () => { },
10
10
  callAsync: (data, resolve) => {
11
11
  const requestBytesString = encodeBase64(data);
12
12
  window.__zmlRequest(requestBytesString, (responseString) => resolve(decodeBase64(responseString)));
@@ -19,8 +19,8 @@ exports.binding = {
19
19
  };
20
20
  function encodeBase64(buffer) {
21
21
  const output = [];
22
- for (let i = 0; i < buffer.length; i++) {
23
- output.push(String.fromCharCode(buffer[i]));
22
+ for (const segment of buffer) {
23
+ output.push(String.fromCharCode(segment));
24
24
  }
25
25
  return window.btoa(output.join(''));
26
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"bindings.wasm.js","sourceRoot":"","sources":["../../../src/gateway/bindings.wasm.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG;IACrB,eAAe,EAAE,CAAC,YAAmD,EAAQ,EAAE;QAC7E,MAAM,CAAC,oBAAoB,CAAC,CAAC,WAAmB,EAAE,EAAE,CACl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Handler: (eventUint8Array: Uint8Array) => void): void => {\n window.__zmlSetEventHandler((eventString: string) =>\n eventHandler(decodeBase64(eventString))\n );\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-function\n setEventsEnabled: (enabled: boolean): void => {},\n callAsync: (data: Uint8Array, resolve: (buffer: Uint8Array) => void): void => {\n const requestBytesString = encodeBase64(data);\n window.__zmlRequest(requestBytesString, (responseString: string) =>\n resolve(decodeBase64(responseString))\n );\n },\n callSync: (data: Uint8Array): Uint8Array => {\n const requestBytesString = encodeBase64(data);\n const responseString = window.__zmlRequest(requestBytesString);\n return decodeBase64(responseString);\n }\n};\n\nfunction encodeBase64(buffer: Uint8Array) {\n const output = [];\n for (let i = 0; i < buffer.length; i++) {\n output.push(String.fromCharCode(buffer[i]));\n }\n return window.btoa(output.join(''));\n}\n\nfunction decodeBase64(chars: string) {\n return Uint8Array.from(window.atob(chars), c => c.charCodeAt(0));\n}\n"]}
1
+ {"version":3,"file":"bindings.wasm.js","sourceRoot":"","sources":["../../../src/gateway/bindings.wasm.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG;IACrB,eAAe,EAAE,CAAC,YAAmD,EAAQ,EAAE;QAC7E,MAAM,CAAC,oBAAoB,CAAC,CAAC,WAAmB,EAAE,EAAE,CAClD,YAAY,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CACxC,CAAC;IACJ,CAAC;IACD,gEAAgE;IAChE,gBAAgB,EAAE,GAAS,EAAE,GAAE,CAAC;IAChC,SAAS,EAAE,CAAC,IAAgB,EAAE,OAAqC,EAAQ,EAAE;QAC3E,MAAM,kBAAkB,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QAC9C,MAAM,CAAC,YAAY,CAAC,kBAAkB,EAAE,CAAC,cAAsB,EAAE,EAAE,CACjE,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,CACtC,CAAC;IACJ,CAAC;IACD,QAAQ,EAAE,CAAC,IAAgB,EAAc,EAAE;QACzC,MAAM,kBAAkB,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QAC9C,MAAM,cAAc,GAAG,MAAM,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;QAC/D,OAAO,YAAY,CAAC,cAAc,CAAC,CAAC;IACtC,CAAC;CACF,CAAC;AAEF,SAAS,YAAY,CAAC,MAAkB;IACtC,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,MAAM,OAAO,IAAI,MAAM,EAAE,CAAC;QAC7B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AACnE,CAAC","sourcesContent":["export const binding = {\n setEventHandler: (eventHandler: (eventUint8Array: Uint8Array) => void): void => {\n window.__zmlSetEventHandler((eventString: string) =>\n eventHandler(decodeBase64(eventString))\n );\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n setEventsEnabled: (): void => {},\n callAsync: (data: Uint8Array, resolve: (buffer: Uint8Array) => void): void => {\n const requestBytesString = encodeBase64(data);\n window.__zmlRequest(requestBytesString, (responseString: string) =>\n resolve(decodeBase64(responseString))\n );\n },\n callSync: (data: Uint8Array): Uint8Array => {\n const requestBytesString = encodeBase64(data);\n const responseString = window.__zmlRequest(requestBytesString);\n return decodeBase64(responseString);\n }\n};\n\nfunction encodeBase64(buffer: Uint8Array) {\n const output = [];\n for (const segment of buffer) {\n output.push(String.fromCharCode(segment));\n }\n return window.btoa(output.join(''));\n}\n\nfunction decodeBase64(chars: string) {\n return Uint8Array.from(window.atob(chars), c => c.charCodeAt(0));\n}\n"]}
@@ -2,6 +2,6 @@ import { Serializable } from './serialization';
2
2
  import { FromBinary } from './message';
3
3
  export declare function callAsync(request: string, requestData?: Serializable): Promise<null>;
4
4
  export declare function callAsync<TReturn>(request: string, requestData: Serializable | undefined, responseProto: FromBinary<TReturn>): Promise<TReturn>;
5
- export declare function callSync(request: string, requestData?: Serializable | undefined): null;
5
+ export declare function callSync(request: string, requestData?: Serializable): null;
6
6
  export declare function callSync<TReturn>(request: string, requestData: Serializable | undefined, responseProto: FromBinary<TReturn>): TReturn;
7
7
  //# sourceMappingURL=call.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../../src/gateway/call.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAA0B,MAAM,iBAAiB,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAW,MAAM,WAAW,CAAC;AAGhD,wBAAsB,SAAS,CAC7B,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,YAAY,GACzB,OAAO,CAAC,IAAI,CAAC,CAAC;AAEjB,wBAAsB,SAAS,CAAC,OAAO,EACrC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,YAAY,GAAG,SAAS,EACrC,aAAa,EAAE,UAAU,CAAC,OAAO,CAAC,GACjC,OAAO,CAAC,OAAO,CAAC,CAAC;AAyBpB,wBAAgB,QAAQ,CACtB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,YAAY,GAAG,SAAS,GACrC,IAAI,CAAC;AAER,wBAAgB,QAAQ,CAAC,OAAO,EAC9B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,YAAY,GAAG,SAAS,EACrC,aAAa,EAAE,UAAU,CAAC,OAAO,CAAC,GACjC,OAAO,CAAC"}
1
+ {"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../../src/gateway/call.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,Y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AAO,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["import { getBinding } from './bindings';\nimport { Serializable, serialize, deserialize } from './serialization';\nimport { convertToException } from './convert_exceptions';\nimport { FromBinary, Message } from './message';\nimport { GatewayRequest, GatewayResponse, ResponseType } from '../requests';\n\nexport async function callAsync(\n request: string,\n requestData?: Serializable\n): Promise<null>;\n\nexport async function callAsync<TReturn>(\n request: string,\n requestData: Serializable | undefined,\n responseProto: FromBinary<TReturn>,\n): Promise<TReturn>;\n\nexport async function callAsync<TReturn>(\n request: string,\n requestData?: Serializable | undefined,\n responseProto?: FromBinary<TReturn>,\n): Promise<TReturn | null> {\n const requestProto: GatewayRequest & Message = {\n request,\n toBinary() {\n return GatewayRequest.toBinary(this);\n },\n };\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<TReturn>(\n request: string,\n requestData: Serializable | undefined,\n responseProto: FromBinary<TReturn>,\n): TReturn;\n\nexport function callSync<TReturn>(\n request: string,\n requestData?: Serializable,\n responseProto?: FromBinary<TReturn>,\n): TReturn | null {\n const requestProto: GatewayRequest & Message = {\n request,\n toBinary() {\n return GatewayRequest.toBinary(this);\n },\n };\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<TReturn>(structBuffers: Uint8Array[], responseProto?: FromBinary<TReturn>): TReturn | null {\n const response = GatewayResponse.fromBinary(structBuffers[0]);\n\n if (response.response !== ResponseType.OK) {\n throw convertToException(response.errorType, response.errorMessage, 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(structBuffers[1]);\n } else {\n return null;\n }\n}\n"]}
1
+ {"version":3,"file":"call.js","sourceRoot":"","sources":["../../../src/gateway/call.ts"],"names":[],"mappings":";;;AAAA,yCAAwC;AACxC,mDAAuE;AACvE,6DAA0D;AAE1D,0CAA4E;AAarE,KAAK,UAAU,SAAS,CAC7B,OAAe,EACf,WAA0B,EAC1B,aAAmC;IAEnC,MAAM,YAAY,GAA6B;QAC7C,OAAO;QACP,QAAQ;YACN,OAAO,yBAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC;KACF,CAAC;IAEF,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;AArBD,8BAqBC;AAaD,SAAgB,QAAQ,CACtB,OAAe,EACf,WAA0B,EAC1B,aAAmC;IAEnC,MAAM,YAAY,GAA6B;QAC7C,OAAO;QACP,QAAQ;YACN,OAAO,yBAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC;KACF,CAAC;IAEF,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;AAnBD,4BAmBC;AAED,SAAS,eAAe,CAAU,aAA2B,EAAE,aAAmC;IAChG,MAAM,QAAQ,GAAG,0BAAe,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAE9D,IAAI,QAAQ,CAAC,QAAQ,KAAK,uBAAY,CAAC,EAAE,EAAE,CAAC;QAC1C,MAAM,IAAA,uCAAkB,EAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IACxF,CAAC;IAED,wBAAwB;IACxB,IAAI,aAAa,IAAI,aAAa,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;IACD,wBAAwB;IACxB,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IACD,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["import { getBinding } from './bindings';\nimport { Serializable, serialize, deserialize } from './serialization';\nimport { convertToException } from './convert_exceptions';\nimport { FromBinary, Message } from './message';\nimport { GatewayRequest, GatewayResponse, ResponseType } from '../requests';\n\nexport async function callAsync(\n request: string,\n requestData?: Serializable\n): Promise<null>;\n\nexport async function callAsync<TReturn>(\n request: string,\n requestData: Serializable | undefined,\n responseProto: FromBinary<TReturn>,\n): Promise<TReturn>;\n\nexport async function callAsync<TReturn>(\n request: string,\n requestData?: Serializable,\n responseProto?: FromBinary<TReturn>,\n): Promise<TReturn | null> {\n const requestProto: GatewayRequest & Message = {\n request,\n toBinary() {\n return GatewayRequest.toBinary(this);\n },\n };\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,\n): null;\n\nexport function callSync<TReturn>(\n request: string,\n requestData: Serializable | undefined,\n responseProto: FromBinary<TReturn>,\n): TReturn;\n\nexport function callSync<TReturn>(\n request: string,\n requestData?: Serializable,\n responseProto?: FromBinary<TReturn>,\n): TReturn | null {\n const requestProto: GatewayRequest & Message = {\n request,\n toBinary() {\n return GatewayRequest.toBinary(this);\n },\n };\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<TReturn>(structBuffers: Uint8Array[], responseProto?: FromBinary<TReturn>): TReturn | null {\n const response = GatewayResponse.fromBinary(structBuffers[0]);\n\n if (response.response !== ResponseType.OK) {\n throw convertToException(response.errorType, response.errorMessage, 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(structBuffers[1]);\n } else {\n return null;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/gateway/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAY,MAAM,MAAM,CAAC;AAW5C,UAAU,QAAQ;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;CAChB;AAID,eAAO,MAAM,MAAM,EAAE,UAAU,CAAC,QAAQ,CActC,CAAC;AAgCH,eAAO,MAAM,WAAW,yBAA0B,MAAM,cAAc,WAAW,QAAQ,CAAC,kBAIvF,CAAC"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/gateway/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAY,MAAM,MAAM,CAAC;AAW5C,UAAU,QAAQ;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;CAChB;AAID,eAAO,MAAM,MAAM,sBAcjB,CAAC;AAgCH,eAAO,MAAM,WAAW,yBAA0B,MAAM,cAAc,WAAW,QAAQ,CAAC,kBAIvF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/gateway/events.ts"],"names":[],"mappings":";;;AAAA,+BAA4C;AAC5C,8CAA6C;AAE7C,0CAGqB;AAErB,yCAAyD;AACzD,mDAA8C;AAO9C,MAAM,aAAa,GAAG,IAAI,GAAG,EAAsB,CAAC;AAEvC,QAAA,MAAM,GAAyB,IAAI,iBAAU,CAAC,CAAC,QAA4B,EAAE,EAAE;IAC1F,IAAI,aAAa,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QAC7B,IAAA,qBAAU,GAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;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,CAAC;YAC7B,IAAA,qBAAU,GAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QACvC,CAAC;IACH,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,YAAY,GAAyD;IACzE,YAAY,EAAE,oBAAS,CAAC,UAAU;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E,CAAC,SAAS,KAAK,iBAAiB,CAAC,EAC1D,IAAA,eAAG,EAAc,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAU,CAAC,CAC5C,CAAC;AAJS,QAAA,WAAW,eAIpB","sourcesContent":["import { Observable, Observer } from 'rxjs';\nimport { filter, map } from 'rxjs/operators';\n\nimport {\n GatewayEvent, TestEvent, DisconnectedEvent, UnknownResponseEventWrapper,\n UnknownBinaryResponseEventWrapper, AlertEventWrapper, BinaryReplyOnlyEventWrapper,\n} from '../requests';\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> = new Observable((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]: (buffer: Uint8Array) => unknown } = {\n 'test/event': TestEvent.fromBinary,\n 'interface/unknown_response': UnknownResponseEventWrapper.fromBinary,\n 'binary/interface/unknown_response': UnknownBinaryResponseEventWrapper.fromBinary,\n 'interface/alert': AlertEventWrapper.fromBinary,\n 'binary/interface/reply_only': BinaryReplyOnlyEventWrapper.fromBinary,\n 'interface/disconnected': DisconnectedEvent.fromBinary,\n};\n\nconst eventHandler = (eventBuffer: Buffer) => {\n const structBuffers = deserialize(eventBuffer);\n const event = GatewayEvent.fromBinary(structBuffers[0]);\n const eventData = structBuffers[1] || null;\n\n const eventName = event.event;\n const eventParser = eventParsers[eventName];\n /* istanbul ignore if */\n if (eventParser == null) {\n throw new Error(`Unknown event: ${eventName}`);\n }\n\n const eventObject: SdkEvent = { eventType: event.event, event: eventParser(eventData) };\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":";;;AAAA,+BAA4C;AAC5C,8CAA6C;AAE7C,0CAGqB;AAErB,yCAAyD;AACzD,mDAA8C;AAO9C,MAAM,aAAa,GAAG,IAAI,GAAG,EAAsB,CAAC;AAEvC,QAAA,MAAM,GAAG,IAAI,iBAAU,CAAW,CAAC,QAA4B,EAAE,EAAE;IAC9E,IAAI,aAAa,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QAC7B,IAAA,qBAAU,GAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;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,CAAC;YAC7B,IAAA,qBAAU,GAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QACvC,CAAC;IACH,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,YAAY,GAAoD;IACpE,YAAY,EAAE,oBAAS,CAAC,UAAU;IAClC,4BAA4B,EAAE,sCAA2B,CAAC,UAAU;IACpE,mCAAmC,EAAE,4CAAiC,CAAC,UAAU;IACjF,iBAAiB,EAAE,4BAAiB,CAAC,UAAU;IAC/C,6BAA6B,EAAE,sCAA2B,CAAC,UAAU;IACrE,wBAAwB,EAAE,4BAAiB,CAAC,UAAU;CACvD,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,WAAmB,EAAE,EAAE;IAC3C,MAAM,aAAa,GAAG,IAAA,2BAAW,EAAC,WAAW,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,uBAAY,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IACxD,MAAM,SAAS,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAE3C,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC;IAC9B,MAAM,WAAW,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAC5C,wBAAwB;IACxB,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,kBAAkB,SAAS,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,WAAW,GAAa,EAAE,SAAS,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC;IAExF,KAAK,MAAM,QAAQ,IAAI,aAAa,EAAE,CAAC;QACrC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC,CAAC;AAEF,IAAA,0BAAe,EAAC,GAAG,EAAE,CAAC,IAAA,qBAAU,GAAE,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;AAE3D,MAAM,WAAW,GAAG,CAAI,iBAAyB,EAAE,EAAE,CAAC,CAAC,MAA4B,EAAE,EAAE,CAC5F,MAAM,CAAC,IAAI,CACT,IAAA,kBAAM,EAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,SAAS,KAAK,iBAAiB,CAAC,EAC1D,IAAA,eAAG,EAAc,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAU,CAAC,CAC5C,CAAC;AAJS,QAAA,WAAW,eAIpB","sourcesContent":["import { Observable, Observer } from 'rxjs';\nimport { filter, map } from 'rxjs/operators';\n\nimport {\n GatewayEvent, TestEvent, DisconnectedEvent, UnknownResponseEventWrapper,\n UnknownBinaryResponseEventWrapper, AlertEventWrapper, BinaryReplyOnlyEventWrapper,\n} from '../requests';\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 = new Observable<SdkEvent>((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: Record<string, (buffer: Uint8Array) => unknown> = {\n 'test/event': TestEvent.fromBinary,\n 'interface/unknown_response': UnknownResponseEventWrapper.fromBinary,\n 'binary/interface/unknown_response': UnknownBinaryResponseEventWrapper.fromBinary,\n 'interface/alert': AlertEventWrapper.fromBinary,\n 'binary/interface/reply_only': BinaryReplyOnlyEventWrapper.fromBinary,\n 'interface/disconnected': DisconnectedEvent.fromBinary,\n};\n\nconst eventHandler = (eventBuffer: Buffer) => {\n const structBuffers = deserialize(eventBuffer);\n const event = GatewayEvent.fromBinary(structBuffers[0]);\n const eventData = structBuffers[1] || null;\n\n const eventName = event.event;\n const eventParser = eventParsers[eventName];\n /* istanbul ignore if */\n if (eventParser == null) {\n throw new Error(`Unknown event: ${eventName}`);\n }\n\n const eventObject: SdkEvent = { eventType: event.event, event: eventParser(eventData) };\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.sanitizer = void 0;
4
4
  exports.sanitizer = {
5
5
  sanitizeNumber(value, label) {
6
6
  if (typeof value !== 'number') {
7
- throw new TypeError(`Expected ${label} to be number but got ${value}.`);
7
+ throw new TypeError(`Expected ${label} to be number but got ${JSON.stringify(value)}.`);
8
8
  }
9
9
  return value;
10
10
  },
@@ -24,7 +24,7 @@ exports.sanitizer = {
24
24
  return '';
25
25
  }
26
26
  if (typeof value !== 'string') {
27
- throw new TypeError(`Expected ${label} to be string but got ${value}.`);
27
+ throw new TypeError(`Expected ${label} to be string but got ${JSON.stringify(value)}.`);
28
28
  }
29
29
  return value;
30
30
  },
@@ -40,7 +40,7 @@ exports.sanitizer = {
40
40
  return '';
41
41
  } // Units.NATIVE
42
42
  if (typeof value !== 'string') {
43
- throw new TypeError(`Expected ${label} to be Units string but got ${value}.`);
43
+ throw new TypeError(`Expected ${label} to be Units string but got ${JSON.stringify(value)}.`);
44
44
  }
45
45
  return value;
46
46
  },
@@ -1 +1 @@
1
- {"version":3,"file":"sanitizer.js","sourceRoot":"","sources":["../../../src/gateway/sanitizer.ts"],"names":[],"mappings":";;;AAIa,QAAA,SAAS,GAAG;IACvB,cAAc,CAAC,KAAa,EAAE,KAAa;QACzC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,SAAS,CAAC,YAAY,KAAK,yBAAyB,KAAK,GAAG,CAAC,CAAC;QAC1E,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,WAAW,CAAC,KAAa,EAAE,KAAa;QACtC,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACrD,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,CAAC;YACtC,MAAM,IAAI,SAAS,CAAC,YAAY,KAAK,0BAA0B,UAAU,GAAG,CAAC,CAAC;QAChF,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,YAAY,CAAC,KAAc,EAAE,KAAa;QACxC,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IACD,cAAc,CAAC,KAAa,EAAE,KAAa;QACzC,4DAA4D;QAC5D,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAAC,OAAO,EAAE,CAAA;QAAC,CAAC;QAEhC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,SAAS,CAAC,YAAY,KAAK,yBAAyB,KAAK,GAAG,CAAC,CAAC;QAC1E,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,YAAY,CACV,KAAY,EACZ,QAAgB,EAChB,QAA+B,EAC/B,KAAa;QAEb,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;YACzD,MAAM,IAAI,SAAS,CAAC,YAAY,KAAK,mBAAmB,QAAQ,iBAAiB,KAAK,GAAG,CAAC,CAAC;QAC7F,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,aAAa,CAAC,KAAY,EAAE,KAAa;QACvC,oDAAoD;QACpD,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAAC,OAAO,EAAE,CAAA;QAAC,CAAC,CAAC,eAAe;QAEhD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,SAAS,CAAC,YAAY,KAAK,+BAA+B,KAAK,GAAG,CAAC,CAAC;QAChF,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAC","sourcesContent":["import type { Units } from '../units';\n\ntype EnumDefinition<T> = Record<string | number, string | T>;\n\nexport const sanitizer = {\n sanitizeNumber(value: number, label: string): number {\n if (typeof value !== 'number') {\n throw new TypeError(`Expected ${label} to be number but got ${value}.`);\n }\n return value;\n },\n sanitizeInt(value: number, label: string): number {\n const safeNumber = this.sanitizeNumber(value, label);\n if (!Number.isSafeInteger(safeNumber)) {\n throw new TypeError(`Expected ${label} to be integer but got ${safeNumber}.`);\n }\n return safeNumber;\n },\n sanitizeBool(value: boolean, label: string): boolean { // eslint-disable-line @typescript-eslint/no-unused-vars\n return Boolean(value);\n },\n sanitizeString(value: string, label: string): string {\n // null is tolerated for strings defaulting in empty string.\n if (value == null) { return '' }\n\n if (typeof value !== 'string') {\n throw new TypeError(`Expected ${label} to be string but got ${value}.`);\n }\n return value;\n },\n sanitizeEnum<TEnum extends number>(\n value: TEnum,\n enumName: string,\n enumType: EnumDefinition<TEnum>,\n label: string,\n ): TEnum {\n if (typeof value !== 'number' || enumType[value] == null) {\n throw new TypeError(`Expected ${label} to be value of ${enumName} enum but got ${value}.`);\n }\n return value;\n },\n sanitizeUnits(value: Units, label: string): Units {\n // null is tolerated for units defaulting to NATIVE.\n if (value == null) { return '' } // Units.NATIVE\n\n if (typeof value !== 'string') {\n throw new TypeError(`Expected ${label} to be Units string but got ${value}.`);\n }\n return value;\n },\n};\n"]}
1
+ {"version":3,"file":"sanitizer.js","sourceRoot":"","sources":["../../../src/gateway/sanitizer.ts"],"names":[],"mappings":";;;AAIa,QAAA,SAAS,GAAG;IACvB,cAAc,CAAC,KAAa,EAAE,KAAa;QACzC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,SAAS,CAAC,YAAY,KAAK,yBAAyB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC1F,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,WAAW,CAAC,KAAa,EAAE,KAAa;QACtC,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACrD,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,CAAC;YACtC,MAAM,IAAI,SAAS,CAAC,YAAY,KAAK,0BAA0B,UAAU,GAAG,CAAC,CAAC;QAChF,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,YAAY,CAAC,KAAc,EAAE,KAAa;QACxC,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IACD,cAAc,CAAC,KAAa,EAAE,KAAa;QACzC,4DAA4D;QAC5D,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAAC,OAAO,EAAE,CAAA;QAAC,CAAC;QAEhC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,SAAS,CAAC,YAAY,KAAK,yBAAyB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC1F,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,YAAY,CACV,KAAY,EACZ,QAAgB,EAChB,QAA+B,EAC/B,KAAa;QAEb,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;YACzD,MAAM,IAAI,SAAS,CAAC,YAAY,KAAK,mBAAmB,QAAQ,iBAAiB,KAAK,GAAG,CAAC,CAAC;QAC7F,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,aAAa,CAAC,KAAY,EAAE,KAAa;QACvC,oDAAoD;QACpD,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAAC,OAAO,EAAE,CAAA;QAAC,CAAC,CAAC,eAAe;QAEhD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,SAAS,CAAC,YAAY,KAAK,+BAA+B,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChG,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAC","sourcesContent":["import type { Units } from '../units';\n\ntype EnumDefinition<T> = Record<string | number, string | T>;\n\nexport const sanitizer = {\n sanitizeNumber(value: number, label: string): number {\n if (typeof value !== 'number') {\n throw new TypeError(`Expected ${label} to be number but got ${JSON.stringify(value)}.`);\n }\n return value;\n },\n sanitizeInt(value: number, label: string): number {\n const safeNumber = this.sanitizeNumber(value, label);\n if (!Number.isSafeInteger(safeNumber)) {\n throw new TypeError(`Expected ${label} to be integer but got ${safeNumber}.`);\n }\n return safeNumber;\n },\n sanitizeBool(value: boolean, label: string): boolean { // eslint-disable-line @typescript-eslint/no-unused-vars\n return Boolean(value);\n },\n sanitizeString(value: string, label: string): string {\n // null is tolerated for strings defaulting in empty string.\n if (value == null) { return '' }\n\n if (typeof value !== 'string') {\n throw new TypeError(`Expected ${label} to be string but got ${JSON.stringify(value)}.`);\n }\n return value;\n },\n sanitizeEnum<TEnum extends number>(\n value: TEnum,\n enumName: string,\n enumType: EnumDefinition<TEnum>,\n label: string,\n ): TEnum {\n if (typeof value !== 'number' || enumType[value] == null) {\n throw new TypeError(`Expected ${label} to be value of ${enumName} enum but got ${value}.`);\n }\n return value;\n },\n sanitizeUnits(value: Units, label: string): Units {\n // null is tolerated for units defaulting to NATIVE.\n if (value == null) { return '' } // Units.NATIVE\n\n if (typeof value !== 'string') {\n throw new TypeError(`Expected ${label} to be Units string but got ${JSON.stringify(value)}.`);\n }\n return value;\n },\n};\n"]}
@@ -1,6 +1,6 @@
1
1
  export interface Serializable {
2
2
  toBinary(): Uint8Array;
3
3
  }
4
- export declare const serialize: (...messages: Array<Serializable | undefined>) => Uint8Array;
4
+ export declare const serialize: (...messages: (Serializable | undefined)[]) => Uint8Array;
5
5
  export declare const deserialize: (buffer: Uint8Array) => Uint8Array[];
6
6
  //# sourceMappingURL=serialization.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../../../src/gateway/serialization.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAAG,QAAQ,IAAI,UAAU,CAAA;CAAE;AAIxD,eAAO,MAAM,SAAS,gBAAiB,MAAM,YAAY,GAAG,SAAS,CAAC,eA0BrE,CAAC;AAEF,eAAO,MAAM,WAAW,WAAY,UAAU,iBAc7C,CAAC"}
1
+ {"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../../../src/gateway/serialization.ts"],"names":[],"mappings":"AAA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CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC5B,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAC3B,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AA1BW,QAAA,SAAS,aA0BpB;AAEK,MAAM,WAAW,GAAG,CAAC,MAAkB,EAAE,EAAE;IAChD,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC7C,IAAI,MAAM,GAAG,cAAc,CAAC;IAC5B,MAAM,OAAO,GAAiB,EAAE,CAAC;IACjC,OAAO,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC9C,MAAM,IAAI,cAAc,CAAC;QAEzB,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;QACzD,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAE3B,MAAM,IAAI,IAAI,CAAC;IACjB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAdW,QAAA,WAAW,eActB","sourcesContent":["export interface Serializable { toBinary(): Uint8Array }\n\nconst SIZE_TYPE_SIZE = 4; // uint32\n\nexport const serialize = (...messages: Array<Serializable | undefined>) => {\n const buffers: Uint8Array[] = [];\n\n let size = SIZE_TYPE_SIZE; // total length\n for (const message of messages.filter(m => m != null)) {\n const bytes = message!.toBinary();\n buffers.push(bytes);\n size += SIZE_TYPE_SIZE + bytes.length; // length + structure\n }\n\n const buffer = new Uint8Array(size);\n const dataView = new DataView(buffer.buffer);\n let offset = 0;\n\n dataView.setUint32(offset, size, true);\n offset += SIZE_TYPE_SIZE;\n\n for (const message of buffers) {\n dataView.setUint32(offset, message.length, true);\n offset += SIZE_TYPE_SIZE;\n\n buffer.set(message, offset);\n offset += message.length;\n }\n\n return buffer;\n};\n\nexport const deserialize = (buffer: Uint8Array) => {\n const dataView = new DataView(buffer.buffer);\n let offset = SIZE_TYPE_SIZE;\n const buffers: Uint8Array[] = [];\n while (offset < buffer.length) {\n const size = dataView.getUint32(offset, true);\n offset += SIZE_TYPE_SIZE;\n\n const structBuffer = buffer.slice(offset, offset + size);\n buffers.push(structBuffer);\n\n offset += size;\n }\n return buffers;\n};\n"]}
1
+ {"version":3,"file":"serialization.js","sourceRoot":"","sources":["../../../src/gateway/serialization.ts"],"names":[],"mappings":";;;AAEA,MAAM,cAAc,GAAG,CAAC,CAAC,CAAC,SAAS;AAE5B,MAAM,SAAS,GAAG,CAAC,GAAG,QAAsC,EAAE,EAAE;IACrE,MAAM,OAAO,GAAiB,EAAE,CAAC;IAEjC,IAAI,IAAI,GAAG,cAAc,CAAC,CAAC,eAAe;IAC1C,KAAK,MAAM,OAAO,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC;QACtD,MAAM,KAAK,GAAG,OAAQ,CAAC,QAAQ,EAAE,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpB,IAAI,IAAI,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,qBAAqB;IAC9D,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC7C,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACvC,MAAM,IAAI,cAAc,CAAC;IAEzB,KAAK,MAAM,OAAO,IAAI,OAAO,EAAE,CAAC;QAC9B,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACjD,MAAM,IAAI,cAAc,CAAC;QAEzB,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC5B,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAC3B,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AA1BW,QAAA,SAAS,aA0BpB;AAEK,MAAM,WAAW,GAAG,CAAC,MAAkB,EAAE,EAAE;IAChD,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC7C,IAAI,MAAM,GAAG,cAAc,CAAC;IAC5B,MAAM,OAAO,GAAiB,EAAE,CAAC;IACjC,OAAO,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC9C,MAAM,IAAI,cAAc,CAAC;QAEzB,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;QACzD,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAE3B,MAAM,IAAI,IAAI,CAAC;IACjB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAdW,QAAA,WAAW,eActB","sourcesContent":["export interface Serializable { toBinary(): Uint8Array }\n\nconst SIZE_TYPE_SIZE = 4; // uint32\n\nexport const serialize = (...messages: (Serializable | undefined)[]) => {\n const buffers: Uint8Array[] = [];\n\n let size = SIZE_TYPE_SIZE; // total length\n for (const message of messages.filter(m => m != null)) {\n const bytes = message!.toBinary();\n buffers.push(bytes);\n size += SIZE_TYPE_SIZE + bytes.length; // length + structure\n }\n\n const buffer = new Uint8Array(size);\n const dataView = new DataView(buffer.buffer);\n let offset = 0;\n\n dataView.setUint32(offset, size, true);\n offset += SIZE_TYPE_SIZE;\n\n for (const message of buffers) {\n dataView.setUint32(offset, message.length, true);\n offset += SIZE_TYPE_SIZE;\n\n buffer.set(message, offset);\n offset += message.length;\n }\n\n return buffer;\n};\n\nexport const deserialize = (buffer: Uint8Array) => {\n const dataView = new DataView(buffer.buffer);\n let offset = SIZE_TYPE_SIZE;\n const buffers: Uint8Array[] = [];\n while (offset < buffer.length) {\n const size = dataView.getUint32(offset, true);\n offset += SIZE_TYPE_SIZE;\n\n const structBuffer = buffer.slice(offset, offset + size);\n buffers.push(structBuffer);\n\n offset += size;\n }\n return buffers;\n};\n"]}
@@ -130,7 +130,7 @@ class Library {
130
130
  const request = {
131
131
  ...requests.CheckVersionRequest.DEFAULT,
132
132
  host: 'js',
133
- version: '7.3.0',
133
+ version: '7.4.1',
134
134
  toBinary() {
135
135
  return requests.CheckVersionRequest.toBinary(this);
136
136
  },
@@ -1 +1 @@
1
- {"version":3,"file":"library.js","sourceRoot":"","sources":["../../src/library.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,mDAAqC;AACrC,qDAAuC;AAIvC,MAAa,OAAO;IAClB;;;;OAIG;IACI,MAAM,CAAC,YAAY,CACxB,IAAmB,EACnB,QAAiB;QAEjB,MAAM,OAAO,GAAmD;YAC9D,GAAG,QAAQ,CAAC,mBAAmB,CAAC,OAAO;YACvC,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,QAAQ;YAClB,QAAQ;gBACN,OAAO,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,iBAAiB,CAC7B,UAA8B,EAC9B,aAAsB;QAEtB,MAAM,OAAO,GAAwD;YACnE,GAAG,QAAQ,CAAC,wBAAwB,CAAC,OAAO;YAC5C,UAAU,EAAE,UA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BAAoB,CAChC,MAAc;QAEd,MAAM,OAAO,GAA0C;YACrD,GAAG,QAAQ,CAAC,UAAU,CAAC,OAAO;YAC9B,KAAK,EAAE,MAAM;YACb,QAAQ;gBACN,OAAO,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC5C,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,iCAAiC,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,YAAY;QACxB,MAAM,OAAO,GAAmD;YAC9D,GAAG,QAAQ,CAAC,mBAAmB,CAAC,OAAO;YACvC,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,OAAO;YAChB,QAAQ;gBACN,OAAO,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;CACF;AAtID,0BAsIC;AAED,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from './gateway';\nimport * as requests from './requests';\nimport { LogOutputMode } from './log_output_mode';\nimport { DeviceDbSourceType } from './device_db_source_type';\n\nexport class Library {\n /**\n * Sets library logging output.\n * @param mode Logging output mode.\n * @param filePath Path of the file to open.\n */\n public static setLogOutput(\n mode: LogOutputMode,\n filePath?: string\n ): void {\n const request: requests.SetLogOutputRequest & gateway.Message = {\n ...requests.SetLogOutputRequest.DEFAULT,\n mode: mode,\n filePath: filePath,\n toBinary() {\n return requests.SetLogOutputRequest.toBinary(this);\n },\n };\n\n gateway.callSync('logging/set_output', request);\n }\n\n /**\n * Sets source of Device DB data. Allows selection of a web service or a local file.\n * @param sourceType Source type.\n * @param urlOrFilePath URL of the web service or path to the local file.\n * Leave empty for the default URL of Zaber web service.\n */\n public static setDeviceDbSource(\n sourceType: DeviceDbSourceType,\n urlOrFilePath?: string\n ): void {\n const request: requests.SetDeviceDbSourceRequest & gateway.Message = {\n ...requests.SetDeviceDbSourceRequest.DEFAULT,\n sourceType: sourceType,\n urlOrFilePath: urlOrFilePath,\n toBinary() {\n return requests.SetDeviceDbSourceRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/set_source', request);\n }\n\n /**\n * Enables Device DB store.\n * The store uses filesystem to save information obtained from the Device DB.\n * The stored data are later used instead of the Device DB.\n * @param storeLocation Specifies relative or absolute path of the folder used by the store.\n * If left empty defaults to a folder in user home directory.\n * Must be accessible by the process.\n */\n public static enableDeviceDbStore(\n storeLocation?: string\n ): void {\n const request: requests.ToggleDeviceDbStoreRequest & gateway.Message = {\n ...requests.ToggleDeviceDbStoreRequest.DEFAULT,\n toggleOn: true,\n storeLocation: storeLocation,\n toBinary() {\n return requests.ToggleDeviceDbStoreRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/toggle_store', request);\n }\n\n /**\n * Disables Device DB store.\n */\n public static disableDeviceDbStore(): void {\n const request: requests.ToggleDeviceDbStoreRequest & gateway.Message = {\n ...requests.ToggleDeviceDbStoreRequest.DEFAULT,\n toBinary() {\n return requests.ToggleDeviceDbStoreRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/toggle_store', request);\n }\n\n /**\n * Disables certain customer checks (like FF flag).\n * @param mode Whether to turn internal mode on or off.\n */\n public static setInternalMode(\n mode: boolean\n ): void {\n const request: requests.SetInternalModeRequest & gateway.Message = {\n ...requests.SetInternalModeRequest.DEFAULT,\n mode: mode,\n toBinary() {\n return requests.SetInternalModeRequest.toBinary(this);\n },\n };\n\n gateway.callSync('library/set_internal_mode', request);\n }\n\n /**\n * Sets the period between polling for IDLE during movements.\n * Caution: Setting the period too low may cause performance issues.\n * @param period Period in milliseconds.\n * Negative value restores the default period.\n */\n public static setIdlePollingPeriod(\n period: number\n ): void {\n const request: requests.IntRequest & gateway.Message = {\n ...requests.IntRequest.DEFAULT,\n value: period,\n toBinary() {\n return requests.IntRequest.toBinary(this);\n },\n };\n\n gateway.callSync('library/set_idle_polling_period', request);\n }\n\n /**\n * Throws an error if the version of the loaded shared library does not match the caller's version.\n */\n public static checkVersion(): void {\n const request: requests.CheckVersionRequest & gateway.Message = {\n ...requests.CheckVersionRequest.DEFAULT,\n host: 'js',\n version: '7.3.0',\n toBinary() {\n return requests.CheckVersionRequest.toBinary(this);\n },\n };\n\n gateway.callSync('library/check_version', request);\n }\n}\n\ngateway.addInitCallback(Library.checkVersion);\n"]}
1
+ {"version":3,"file":"library.js","sourceRoot":"","sources":["../../src/library.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,mDAAqC;AACrC,qDAAuC;AAIvC,MAAa,OAAO;IAClB;;;;OAIG;IACI,MAAM,CAAC,YAAY,CACxB,IAAmB,EACnB,QAAiB;QAEjB,MAAM,OAAO,GAAmD;YAC9D,GAAG,QAAQ,CAAC,mBAAmB,CAAC,OAAO;YACvC,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,QAAQ;YAClB,QAAQ;gBACN,OAAO,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,iBAAiB,CAC7B,UAA8B,EAC9B,aAAsB;QAEtB,MAAM,OAAO,GAAwD;YACnE,GAAG,QAAQ,CAAC,wBAAwB,CAAC,OAAO;YAC5C,UAAU,EAAE,UAAU;YACtB,aAAa,EAAE,aAAa;YAC5B,QAAQ;gBACN,OAAO,QAAQ,CAAC,wBAAwB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC1D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AAQ;gBACN,OAAO,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC5C,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,iCAAiC,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,YAAY;QACxB,MAAM,OAAO,GAAmD;YAC9D,GAAG,QAAQ,CAAC,mBAAmB,CAAC,OAAO;YACvC,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,OAAO;YAChB,QAAQ;gBACN,OAAO,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;CACF;AAtID,0BAsIC;AAED,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from './gateway';\nimport * as requests from './requests';\nimport { LogOutputMode } from './log_output_mode';\nimport { DeviceDbSourceType } from './device_db_source_type';\n\nexport class Library {\n /**\n * Sets library logging output.\n * @param mode Logging output mode.\n * @param filePath Path of the file to open.\n */\n public static setLogOutput(\n mode: LogOutputMode,\n filePath?: string\n ): void {\n const request: requests.SetLogOutputRequest & gateway.Message = {\n ...requests.SetLogOutputRequest.DEFAULT,\n mode: mode,\n filePath: filePath,\n toBinary() {\n return requests.SetLogOutputRequest.toBinary(this);\n },\n };\n\n gateway.callSync('logging/set_output', request);\n }\n\n /**\n * Sets source of Device DB data. Allows selection of a web service or a local file.\n * @param sourceType Source type.\n * @param urlOrFilePath URL of the web service or path to the local file.\n * Leave empty for the default URL of Zaber web service.\n */\n public static setDeviceDbSource(\n sourceType: DeviceDbSourceType,\n urlOrFilePath?: string\n ): void {\n const request: requests.SetDeviceDbSourceRequest & gateway.Message = {\n ...requests.SetDeviceDbSourceRequest.DEFAULT,\n sourceType: sourceType,\n urlOrFilePath: urlOrFilePath,\n toBinary() {\n return requests.SetDeviceDbSourceRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/set_source', request);\n }\n\n /**\n * Enables Device DB store.\n * The store uses filesystem to save information obtained from the Device DB.\n * The stored data are later used instead of the Device DB.\n * @param storeLocation Specifies relative or absolute path of the folder used by the store.\n * If left empty defaults to a folder in user home directory.\n * Must be accessible by the process.\n */\n public static enableDeviceDbStore(\n storeLocation?: string\n ): void {\n const request: requests.ToggleDeviceDbStoreRequest & gateway.Message = {\n ...requests.ToggleDeviceDbStoreRequest.DEFAULT,\n toggleOn: true,\n storeLocation: storeLocation,\n toBinary() {\n return requests.ToggleDeviceDbStoreRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/toggle_store', request);\n }\n\n /**\n * Disables Device DB store.\n */\n public static disableDeviceDbStore(): void {\n const request: requests.ToggleDeviceDbStoreRequest & gateway.Message = {\n ...requests.ToggleDeviceDbStoreRequest.DEFAULT,\n toBinary() {\n return requests.ToggleDeviceDbStoreRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/toggle_store', request);\n }\n\n /**\n * Disables certain customer checks (like FF flag).\n * @param mode Whether to turn internal mode on or off.\n */\n public static setInternalMode(\n mode: boolean\n ): void {\n const request: requests.SetInternalModeRequest & gateway.Message = {\n ...requests.SetInternalModeRequest.DEFAULT,\n mode: mode,\n toBinary() {\n return requests.SetInternalModeRequest.toBinary(this);\n },\n };\n\n gateway.callSync('library/set_internal_mode', request);\n }\n\n /**\n * Sets the period between polling for IDLE during movements.\n * Caution: Setting the period too low may cause performance issues.\n * @param period Period in milliseconds.\n * Negative value restores the default period.\n */\n public static setIdlePollingPeriod(\n period: number\n ): void {\n const request: requests.IntRequest & gateway.Message = {\n ...requests.IntRequest.DEFAULT,\n value: period,\n toBinary() {\n return requests.IntRequest.toBinary(this);\n },\n };\n\n gateway.callSync('library/set_idle_polling_period', request);\n }\n\n /**\n * Throws an error if the version of the loaded shared library does not match the caller's version.\n */\n public static checkVersion(): void {\n const request: requests.CheckVersionRequest & gateway.Message = {\n ...requests.CheckVersionRequest.DEFAULT,\n host: 'js',\n version: '7.4.1',\n toBinary() {\n return requests.CheckVersionRequest.toBinary(this);\n },\n };\n\n gateway.callSync('library/check_version', request);\n }\n}\n\ngateway.addInitCallback(Library.checkVersion);\n"]}
@@ -0,0 +1,13 @@
1
+ export interface DeviceRestoreRequest {
2
+ interfaceId: number;
3
+ device: number;
4
+ axis: number;
5
+ hard: boolean;
6
+ }
7
+ export declare const DeviceRestoreRequest: {
8
+ fromBinary: (buffer: Uint8Array) => DeviceRestoreRequest;
9
+ toBinary: (value: DeviceRestoreRequest) => Uint8Array;
10
+ DEFAULT: Readonly<DeviceRestoreRequest>;
11
+ sanitize: (value: DeviceRestoreRequest) => DeviceRestoreRequest;
12
+ };
13
+ //# sourceMappingURL=device_restore_request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device_restore_request.d.ts","sourceRoot":"","sources":["../../../src/requests/device_restore_request.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IAEpB,MAAM,EAAE,MAAM,CAAC;IAEf,IAAI,EAAE,MAAM,CAAC;IAEb,IAAI,EAAE,OAAO,CAAC;CAEf;AAED,eAAO,MAAM,oBAAoB;yBACV,UAAU,KAAG,oBAAoB;sBACpC,oBAAoB,KAAG,UAAU;;sBAOjC,oBAAoB,KAAG,oBAAoB;CAU9D,CAAC"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeviceRestoreRequest = void 0;
4
+ /* This file is generated. Do not modify by hand. */
5
+ const bson_1 = require("bson");
6
+ const sanitizer_1 = require("../gateway/sanitizer");
7
+ exports.DeviceRestoreRequest = {
8
+ fromBinary: (buffer) => bson_1.BSON.deserialize(buffer),
9
+ toBinary: (value) => bson_1.BSON.serialize(exports.DeviceRestoreRequest.sanitize(value)),
10
+ DEFAULT: Object.freeze({
11
+ interfaceId: 0,
12
+ device: 0,
13
+ axis: 0,
14
+ hard: false,
15
+ }),
16
+ sanitize: (value) => {
17
+ if (value == null) {
18
+ throw new TypeError('Expected DeviceRestoreRequest object but got null or undefined.');
19
+ }
20
+ if (typeof value !== 'object') {
21
+ throw new TypeError(`Expected DeviceRestoreRequest object but got ${typeof value}.`);
22
+ }
23
+ return {
24
+ interfaceId: sanitizer_1.sanitizer.sanitizeInt(value.interfaceId, 'interfaceId'),
25
+ device: sanitizer_1.sanitizer.sanitizeInt(value.device, 'device'),
26
+ axis: sanitizer_1.sanitizer.sanitizeInt(value.axis, 'axis'),
27
+ hard: sanitizer_1.sanitizer.sanitizeBool(value.hard, 'hard'),
28
+ };
29
+ },
30
+ };
31
+ //# sourceMappingURL=device_restore_request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device_restore_request.js","sourceRoot":"","sources":["../../../src/requests/device_restore_request.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACpD,+BAA4B;AAC5B,oDAAiD;AAapC,QAAA,oBAAoB,GAAG;IAClC,UAAU,EAAE,CAAC,MAAkB,EAAwB,EAAE,CAAC,WAAI,CAAC,WAAW,CAAC,MAAM,CAAyB;IAC1G,QAAQ,EAAE,CAAC,KAA2B,EAAc,EAAE,CAAC,WAAI,CAAC,SAAS,CAAC,4BAAoB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC3G,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;QACrB,WAAW,EAAE,CAAC;QACd,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;QACP,IAAI,EAAE,KAAK;KACZ,CAAmC;IACpC,QAAQ,EAAE,CAAC,KAA2B,EAAwB,EAAE;QAC9D,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,iEAAiE,CAAC,CAAA;QAAC,CAAC;QAC7G,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,gDAAgD,OAAO,KAAK,GAAG,CAAC,CAAA;QAAC,CAAC;QACvH,OAAO;YACL,WAAW,EAAE,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,WAAW,EAAE,aAAa,CAAC;YACpE,MAAM,EAAE,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC;YACrD,IAAI,EAAE,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC;YAC/C,IAAI,EAAE,qBAAS,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC;SACjD,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/* This file is generated. Do not modify by hand. */\nimport { BSON } from 'bson';\nimport { sanitizer } from '../gateway/sanitizer';\n\nexport interface DeviceRestoreRequest {\n interfaceId: number;\n\n device: number;\n\n axis: number;\n\n hard: boolean;\n\n}\n\nexport const DeviceRestoreRequest = {\n fromBinary: (buffer: Uint8Array): DeviceRestoreRequest => BSON.deserialize(buffer) as DeviceRestoreRequest,\n toBinary: (value: DeviceRestoreRequest): Uint8Array => BSON.serialize(DeviceRestoreRequest.sanitize(value)),\n DEFAULT: Object.freeze({\n interfaceId: 0,\n device: 0,\n axis: 0,\n hard: false,\n }) as Readonly<DeviceRestoreRequest>,\n sanitize: (value: DeviceRestoreRequest): DeviceRestoreRequest => {\n if (value == null) { throw new TypeError('Expected DeviceRestoreRequest object but got null or undefined.') }\n if (typeof value !== 'object') { throw new TypeError(`Expected DeviceRestoreRequest object but got ${typeof value}.`) }\n return {\n interfaceId: sanitizer.sanitizeInt(value.interfaceId, 'interfaceId'),\n device: sanitizer.sanitizeInt(value.device, 'device'),\n axis: sanitizer.sanitizeInt(value.axis, 'axis'),\n hard: sanitizer.sanitizeBool(value.hard, 'hard'),\n };\n },\n};\n"]}
@@ -0,0 +1,13 @@
1
+ export interface DriverEnableRequest {
2
+ interfaceId: number;
3
+ device: number;
4
+ axis: number;
5
+ timeout: number;
6
+ }
7
+ export declare const DriverEnableRequest: {
8
+ fromBinary: (buffer: Uint8Array) => DriverEnableRequest;
9
+ toBinary: (value: DriverEnableRequest) => Uint8Array;
10
+ DEFAULT: Readonly<DriverEnableRequest>;
11
+ sanitize: (value: DriverEnableRequest) => DriverEnableRequest;
12
+ };
13
+ //# sourceMappingURL=driver_enable_request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"driver_enable_request.d.ts","sourceRoot":"","sources":["../../../src/requests/driver_enable_request.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IAEpB,MAAM,EAAE,MAAM,CAAC;IAEf,IAAI,EAAE,MAAM,CAAC;IAEb,OAAO,EAAE,MAAM,CAAC;CAEjB;AAED,eAAO,MAAM,mBAAmB;yBACT,UAAU,KAAG,mBAAmB;sBACnC,mBAAmB,KAAG,UAAU;;sBAOhC,mBAAmB,KAAG,mBAAmB;CAU5D,CAAC"}