@zaber/motion 7.6.0 → 7.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1415,7 +1415,7 @@ go.mongodb.org/mongo-driver v1.14.0
1415
1415
  limitations under the License.
1416
1416
 
1417
1417
  ------------------
1418
- golang.org/x/crypto v0.11.0
1418
+ golang.org/x/crypto v0.17.0
1419
1419
  ------------------
1420
1420
  Copyright (c) 2009 The Go Authors. All rights reserved.
1421
1421
 
@@ -1508,7 +1508,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1508
1508
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1509
1509
 
1510
1510
  ------------------
1511
- golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4
1511
+ golang.org/x/mod v0.8.0
1512
1512
  ------------------
1513
1513
  Copyright (c) 2009 The Go Authors. All rights reserved.
1514
1514
 
@@ -1601,7 +1601,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1601
1601
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1602
1602
 
1603
1603
  ------------------
1604
- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f
1604
+ golang.org/x/sys v0.5.0
1605
1605
  ------------------
1606
1606
  Copyright (c) 2009 The Go Authors. All rights reserved.
1607
1607
 
@@ -1694,7 +1694,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1694
1694
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1695
1695
 
1696
1696
  ------------------
1697
- golang.org/x/tools v0.1.12
1697
+ golang.org/x/tools v0.6.0
1698
1698
  ------------------
1699
1699
  Copyright (c) 2009 The Go Authors. All rights reserved.
1700
1700
 
@@ -1755,35 +1755,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1755
1755
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1756
1756
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1757
1757
 
1758
- ------------------
1759
- gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
1760
- ------------------
1761
- Gocheck - A rich testing framework for Go
1762
-
1763
- Copyright (c) 2010-2013 Gustavo Niemeyer <gustavo@niemeyer.net>
1764
-
1765
- All rights reserved.
1766
-
1767
- Redistribution and use in source and binary forms, with or without
1768
- modification, are permitted provided that the following conditions are met:
1769
-
1770
- 1. Redistributions of source code must retain the above copyright notice, this
1771
- list of conditions and the following disclaimer.
1772
- 2. Redistributions in binary form must reproduce the above copyright notice,
1773
- this list of conditions and the following disclaimer in the documentation
1774
- and/or other materials provided with the distribution.
1775
-
1776
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1777
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1778
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
1779
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
1780
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
1781
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
1782
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
1783
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1784
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
1785
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1786
-
1787
1758
  ------------------
1788
1759
  gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
1789
1760
  ------------------
@@ -19,6 +19,11 @@ export declare class Transport {
19
19
  * Also closes the connection using the transport.
20
20
  */
21
21
  close(): Promise<void>;
22
+ /**
23
+ * Frees the transport instance.
24
+ * @param transportId Transport ID to be freed.
25
+ */
26
+ private static _free;
22
27
  /**
23
28
  * Closes the transport with error.
24
29
  * Also closes the connection using the transport propagating the error.
@@ -39,5 +44,11 @@ export declare class Transport {
39
44
  * @returns Message generated by the connection.
40
45
  */
41
46
  read(): Promise<string>;
47
+ /**
48
+ * Releases the native resources of the connection.
49
+ * Should only be called if your environment does not support FinalizationRegistry.
50
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry
51
+ */
52
+ free(): void;
42
53
  }
43
54
  //# sourceMappingURL=transport.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../src/ascii/transport.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,qBAAa,SAAS;IACpB;;OAEG;IACH,IAAW,WAAW,IAAI,MAAM,CAE/B;IACD,OAAO,CAAC,YAAY,CAAS;gBAEjB,WAAW,EAAE,MAAM;IAI/B;;;OAGG;WACW,IAAI,IAAI,SAAS;IAe/B;;;OAGG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAYnC;;;;OAIG;IACU,cAAc,CACzB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC;IAahB;;;;OAIG;IACU,KAAK,CAChB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC;IAahB;;;;;;OAMG;IACU,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;CAerC"}
1
+ {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../src/ascii/transport.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,qBAAa,SAAS;IACpB;;OAEG;IACH,IAAW,WAAW,IAAI,MAAM,CAE/B;IACD,OAAO,CAAC,YAAY,CAAS;gBAEjB,WAAW,EAAE,MAAM;IAK/B;;;OAGG;WACW,IAAI,IAAI,SAAS;IAe/B;;;OAGG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAYnC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,KAAK;IAcpB;;;;OAIG;IACU,cAAc,CACzB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC;IAahB;;;;OAIG;IACU,KAAK,CAChB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC;IAahB;;;;;;OAMG;IACU,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;IAgBpC;;;;MAIE;IACK,IAAI,IAAI,IAAI;CAGpB"}
@@ -28,6 +28,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
28
28
  exports.Transport = void 0;
29
29
  const gateway = __importStar(require("../gateway"));
30
30
  const requests = __importStar(require("../requests"));
31
+ const finalizer_1 = require("../finalizer");
31
32
  /**
32
33
  * Connection transport backend allowing to carry Zaber ASCII protocol over arbitrary protocols.
33
34
  * Can only be used with a single connection.
@@ -41,6 +42,7 @@ class Transport {
41
42
  }
42
43
  constructor(transportId) {
43
44
  this._transportId = transportId;
45
+ (0, finalizer_1.registerForFinalization)(this, Transport._free.bind(null, transportId));
44
46
  }
45
47
  /**
46
48
  * Creates new instance allowing to read/write messages from/to a single connection.
@@ -70,6 +72,20 @@ class Transport {
70
72
  };
71
73
  await gateway.callAsync('custom/interface/close', request);
72
74
  }
75
+ /**
76
+ * Frees the transport instance.
77
+ * @param transportId Transport ID to be freed.
78
+ */
79
+ static _free(transportId) {
80
+ const request = {
81
+ ...requests.CustomInterfaceCloseRequest.DEFAULT,
82
+ transportId: transportId,
83
+ toBinary() {
84
+ return requests.CustomInterfaceCloseRequest.toBinary(this);
85
+ },
86
+ };
87
+ gateway.callSync('custom/interface/free', request);
88
+ }
73
89
  /**
74
90
  * Closes the transport with error.
75
91
  * Also closes the connection using the transport propagating the error.
@@ -120,6 +136,14 @@ class Transport {
120
136
  const response = await gateway.callAsync('custom/interface/read', request, requests.StringResponse.fromBinary);
121
137
  return response.value;
122
138
  }
139
+ /**
140
+ * Releases the native resources of the connection.
141
+ * Should only be called if your environment does not support FinalizationRegistry.
142
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry
143
+ */
144
+ free() {
145
+ Transport._free(this.transportId);
146
+ }
123
147
  }
124
148
  exports.Transport = Transport;
125
149
  //# sourceMappingURL=transport.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../src/ascii/transport.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,sDAAwC;AAExC;;;GAGG;AACH,MAAa,SAAS;IACpB;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAGD,YAAY,WAAmB;QAC7B,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,IAAI;QAChB,MAAM,OAAO,GAA4C;YACvD,GAAG,QAAQ,CAAC,YAAY,CAAC,OAAO;YAChC,QAAQ;gBACN,OAAO,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC9C,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,uBAAuB,EACvB,OAAO,EACP,QAAQ,CAAC,2BAA2B,CAAC,UAAU,CAAC,CAAC;QACnD,OAAO,IAAI,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,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Q,CAAC,0BAA0B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC5D,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,uBAAuB,EACvB,OAAO,EACP,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AA9GD,8BA8GC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\n\n/**\n * Connection transport backend allowing to carry Zaber ASCII protocol over arbitrary protocols.\n * Can only be used with a single connection.\n */\nexport class Transport {\n /**\n * The transport ID identifies this transport instance with the underlying library.\n */\n public get transportId(): number {\n return this._transportId;\n }\n private _transportId: number;\n\n constructor(transportId: number) {\n this._transportId = transportId;\n }\n\n /**\n * Creates new instance allowing to read/write messages from/to a single connection.\n * @returns New instance of transport.\n */\n public static open(): Transport {\n const request: requests.EmptyRequest & gateway.Message = {\n ...requests.EmptyRequest.DEFAULT,\n toBinary() {\n return requests.EmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.CustomInterfaceOpenResponse>(\n 'custom/interface/open',\n request,\n requests.CustomInterfaceOpenResponse.fromBinary);\n return new Transport(response.transportId);\n }\n\n /**\n * Closes the transport.\n * Also closes the connection using the transport.\n */\n public async close(): Promise<void> {\n const request: requests.CustomInterfaceCloseRequest & gateway.Message = {\n ...requests.CustomInterfaceCloseRequest.DEFAULT,\n transportId: this.transportId,\n toBinary() {\n return requests.CustomInterfaceCloseRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('custom/interface/close', request);\n }\n\n /**\n * Closes the transport with error.\n * Also closes the connection using the transport propagating the error.\n * @param errorMessage Error to be propagated.\n */\n public async closeWithError(\n errorMessage: string\n ): Promise<void> {\n const request: requests.CustomInterfaceCloseRequest & gateway.Message = {\n ...requests.CustomInterfaceCloseRequest.DEFAULT,\n transportId: this.transportId,\n errorMessage: errorMessage,\n toBinary() {\n return requests.CustomInterfaceCloseRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('custom/interface/close', request);\n }\n\n /**\n * Writes a single message to the connection.\n * The message will be processed as a reply from the device.\n * @param message Single message of Zaber ASCII protocol.\n */\n public async write(\n message: string\n ): Promise<void> {\n const request: requests.CustomInterfaceWriteRequest & gateway.Message = {\n ...requests.CustomInterfaceWriteRequest.DEFAULT,\n transportId: this.transportId,\n message: message,\n toBinary() {\n return requests.CustomInterfaceWriteRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('custom/interface/write', request);\n }\n\n /**\n * Reads a single message generated by the connection.\n * The message is a request for the device.\n * Read should be called continuously in a loop to ensure all generated messages are processed.\n * Subsequent read call confirms that previous message was delivered to the device.\n * @returns Message generated by the connection.\n */\n public async read(): Promise<string> {\n const request: requests.CustomInterfaceReadRequest & gateway.Message = {\n ...requests.CustomInterfaceReadRequest.DEFAULT,\n transportId: this.transportId,\n toBinary() {\n return requests.CustomInterfaceReadRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.StringResponse>(\n 'custom/interface/read',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n"]}
1
+ {"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../src/ascii/transport.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,sDAAwC;AACxC,4CAAuD;AAEvD;;;GAGG;AACH,MAAa,SAAS;IACpB;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAGD,YAAY,WAAmB;QAC7B,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAA,mCAAuB,EAAC,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAA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n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { registerForFinalization } from '../finalizer';\n\n/**\n * Connection transport backend allowing to carry Zaber ASCII protocol over arbitrary protocols.\n * Can only be used with a single connection.\n */\nexport class Transport {\n /**\n * The transport ID identifies this transport instance with the underlying library.\n */\n public get transportId(): number {\n return this._transportId;\n }\n private _transportId: number;\n\n constructor(transportId: number) {\n this._transportId = transportId;\n registerForFinalization(this, Transport._free.bind(null, transportId));\n }\n\n /**\n * Creates new instance allowing to read/write messages from/to a single connection.\n * @returns New instance of transport.\n */\n public static open(): Transport {\n const request: requests.EmptyRequest & gateway.Message = {\n ...requests.EmptyRequest.DEFAULT,\n toBinary() {\n return requests.EmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.CustomInterfaceOpenResponse>(\n 'custom/interface/open',\n request,\n requests.CustomInterfaceOpenResponse.fromBinary);\n return new Transport(response.transportId);\n }\n\n /**\n * Closes the transport.\n * Also closes the connection using the transport.\n */\n public async close(): Promise<void> {\n const request: requests.CustomInterfaceCloseRequest & gateway.Message = {\n ...requests.CustomInterfaceCloseRequest.DEFAULT,\n transportId: this.transportId,\n toBinary() {\n return requests.CustomInterfaceCloseRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('custom/interface/close', request);\n }\n\n /**\n * Frees the transport instance.\n * @param transportId Transport ID to be freed.\n */\n private static _free(\n transportId: number\n ): void {\n const request: requests.CustomInterfaceCloseRequest & gateway.Message = {\n ...requests.CustomInterfaceCloseRequest.DEFAULT,\n transportId: transportId,\n toBinary() {\n return requests.CustomInterfaceCloseRequest.toBinary(this);\n },\n };\n\n gateway.callSync('custom/interface/free', request);\n }\n\n /**\n * Closes the transport with error.\n * Also closes the connection using the transport propagating the error.\n * @param errorMessage Error to be propagated.\n */\n public async closeWithError(\n errorMessage: string\n ): Promise<void> {\n const request: requests.CustomInterfaceCloseRequest & gateway.Message = {\n ...requests.CustomInterfaceCloseRequest.DEFAULT,\n transportId: this.transportId,\n errorMessage: errorMessage,\n toBinary() {\n return requests.CustomInterfaceCloseRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('custom/interface/close', request);\n }\n\n /**\n * Writes a single message to the connection.\n * The message will be processed as a reply from the device.\n * @param message Single message of Zaber ASCII protocol.\n */\n public async write(\n message: string\n ): Promise<void> {\n const request: requests.CustomInterfaceWriteRequest & gateway.Message = {\n ...requests.CustomInterfaceWriteRequest.DEFAULT,\n transportId: this.transportId,\n message: message,\n toBinary() {\n return requests.CustomInterfaceWriteRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('custom/interface/write', request);\n }\n\n /**\n * Reads a single message generated by the connection.\n * The message is a request for the device.\n * Read should be called continuously in a loop to ensure all generated messages are processed.\n * Subsequent read call confirms that previous message was delivered to the device.\n * @returns Message generated by the connection.\n */\n public async read(): Promise<string> {\n const request: requests.CustomInterfaceReadRequest & gateway.Message = {\n ...requests.CustomInterfaceReadRequest.DEFAULT,\n transportId: this.transportId,\n toBinary() {\n return requests.CustomInterfaceReadRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.StringResponse>(\n 'custom/interface/read',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Releases the native resources of the connection.\n * Should only be called if your environment does not support FinalizationRegistry.\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n */\n public free(): void {\n Transport._free(this.transportId);\n }\n}\n"]}
@@ -2,6 +2,7 @@ import { CommandFailedException } from './command_failed_exception';
2
2
  import { CommandFailedExceptionData } from './command_failed_exception_data';
3
3
  /**
4
4
  * Thrown when a command is rejected because the device is in EtherCAT Control (remote) mode.
5
+ * Change the device setting comm.ethercat.remote to 0 to switch to local control.
5
6
  */
6
7
  export declare class RemoteModeException extends CommandFailedException {
7
8
  constructor(message: string, customData: Uint8Array | CommandFailedExceptionData);
@@ -1 +1 @@
1
- {"version":3,"file":"remote_mode_exception.d.ts","sourceRoot":"","sources":["../../../src/exceptions/remote_mode_exception.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,sBAAsB;gBAE3D,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,UAAU,GAAG,0BAA0B;CAKtD"}
1
+ {"version":3,"file":"remote_mode_exception.d.ts","sourceRoot":"","sources":["../../../src/exceptions/remote_mode_exception.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,sBAAsB;gBAE3D,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,UAAU,GAAG,0BAA0B;CAKtD"}
@@ -6,6 +6,7 @@ exports.RemoteModeException = void 0;
6
6
  const command_failed_exception_1 = require("./command_failed_exception");
7
7
  /**
8
8
  * Thrown when a command is rejected because the device is in EtherCAT Control (remote) mode.
9
+ * Change the device setting comm.ethercat.remote to 0 to switch to local control.
9
10
  */
10
11
  class RemoteModeException extends command_failed_exception_1.CommandFailedException {
11
12
  constructor(message, customData) {
@@ -1 +1 @@
1
- {"version":3,"file":"remote_mode_exception.js","sourceRoot":"","sources":["../../../src/exceptions/remote_mode_exception.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAEtD,yEAAoE;AAGpE;;GAEG;AACH,MAAa,mBAAoB,SAAQ,iDAAsB;IAC7D,YACE,OAAe,EACf,UAAmD;QAEnD,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAC3B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;CACF;AARD,kDAQC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { CommandFailedException } from './command_failed_exception';\nimport { CommandFailedExceptionData } from './command_failed_exception_data';\n\n/**\n * Thrown when a command is rejected because the device is in EtherCAT Control (remote) mode.\n */\nexport class RemoteModeException extends CommandFailedException {\n constructor(\n message: string,\n customData: Uint8Array | CommandFailedExceptionData\n ) {\n super(message, customData);\n Object.setPrototypeOf(this, RemoteModeException.prototype);\n }\n}\n"]}
1
+ {"version":3,"file":"remote_mode_exception.js","sourceRoot":"","sources":["../../../src/exceptions/remote_mode_exception.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAEtD,yEAAoE;AAGpE;;;GAGG;AACH,MAAa,mBAAoB,SAAQ,iDAAsB;IAC7D,YACE,OAAe,EACf,UAAmD;QAEnD,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAC3B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;CACF;AARD,kDAQC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { CommandFailedException } from './command_failed_exception';\nimport { CommandFailedExceptionData } from './command_failed_exception_data';\n\n/**\n * Thrown when a command is rejected because the device is in EtherCAT Control (remote) mode.\n * Change the device setting comm.ethercat.remote to 0 to switch to local control.\n */\nexport class RemoteModeException extends CommandFailedException {\n constructor(\n message: string,\n customData: Uint8Array | CommandFailedExceptionData\n ) {\n super(message, customData);\n Object.setPrototypeOf(this, RemoteModeException.prototype);\n }\n}\n"]}
@@ -1,2 +1,3 @@
1
1
  export function wasmExec(): void;
2
+ export const WASM_EXEC_VERSION: "go1.23.0";
2
3
  //# sourceMappingURL=wasm-exec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wasm-exec.d.ts","sourceRoot":"","sources":["../../../src/gateway/wasm-exec.js"],"names":[],"mappings":"AAYkB,iCA0iBjB"}
1
+ {"version":3,"file":"wasm-exec.d.ts","sourceRoot":"","sources":["../../../src/gateway/wasm-exec.js"],"names":[],"mappings":"AAkBkB,iCA0iBjB;AA/iBD,2CAAqC"}
@@ -1,13 +1,19 @@
1
+ "use strict";
2
+ // Copyright 2018 The Go Authors. All rights reserved.
3
+ // Use of this source code is governed by a BSD-style
4
+ // license that can be found in the LICENSE file.
5
+ Object.defineProperty(exports, "__esModule", { value: true });
1
6
  /*
2
7
  IMPORTANT
3
8
  This file was copied from `https://github.com/golang/go/blob/go1.23.0/misc/wasm/wasm_exec.js`.
4
- It has been modified a bit to reduce webpack warnings about how the `require()` function is being used
9
+ It has been modified a bit to reduce webpack warnings about how the `require()` function is being used.
10
+
11
+ When the version of go is updated, this script may also need to be updated.
12
+
13
+ The following constant has been added for gulpfile verification.
5
14
  */
6
- // Copyright 2018 The Go Authors. All rights reserved.
7
- // Use of this source code is governed by a BSD-style
8
- // license that can be found in the LICENSE file.
15
+ const WASM_EXEC_VERSION = 'go1.23.0';
9
16
  'use strict';
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
17
  const wasmExec = (() => {
12
18
  const enosys = () => {
13
19
  const err = new Error('not implemented');
@@ -508,5 +514,6 @@ const wasmExec = (() => {
508
514
  });
509
515
  module.exports = {
510
516
  wasmExec,
517
+ WASM_EXEC_VERSION,
511
518
  };
512
519
  //# sourceMappingURL=wasm-exec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wasm-exec.js","sourceRoot":"","sources":["../../../src/gateway/wasm-exec.js"],"names":[],"mappings":"AAAA;;;;EAIE;AAEF,sDAAsD;AACtD,qDAAqD;AACrD,iDAAiD;AAEjD,YAAY,CAAC;;AAEb,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE;IACrB,MAAM,MAAM,GAAG,GAAG,EAAE;QAClB,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,iBAAiB,CAAC,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,IAAI,CAAC;YACpC,IAAI,MAAM,IAAI,eAAe,EAAE,CAAC;gBAC9B,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;YAC1F,CAAC;YAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACnC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAChB,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC7B,CAAC;YACD,MAAM,IAAI,CAAC,YAAY,CAAC;QAC1B,CAAC;QAED,OAAO;YACL,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAChB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;YACnD,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YAC5B,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAChB,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC7B,CAAC;QACH,CAAC;QAED,gBAAgB,CAAC,EAAE;YACjB,MAAM,EAAE,GAAG,IAAI,CAAC;YAChB,OAAO;gBACL,MAAM,KAAK,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;gBACtD,EAAE,CAAC,aAAa,GAAG,KAAK,CAAC;gBACzB,EAAE,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO,KAAK,CAAC,MAAM,CAAC;YACtB,CAAC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,GAAG;IACf,QAAQ;CACT,CAAC","sourcesContent":["/*\nIMPORTANT\nThis file was copied from `https://github.com/golang/go/blob/go1.23.0/misc/wasm/wasm_exec.js`.\nIt has been modified a bit to reduce webpack warnings about how the `require()` function is being used\n*/\n\n// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n'use strict';\n\nconst wasmExec = (() => {\n const enosys = () => {\n const err = new Error('not implemented');\n err.code = 'ENOSYS';\n return err;\n };\n\n if (!globalThis.fs) {\n let outputBuf = '';\n globalThis.fs = {\n constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused\n writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf('\\n');\n if (nl != -1) {\n console.log(outputBuf.substring(0, nl));\n outputBuf = outputBuf.substring(nl + 1);\n }\n return buf.length;\n },\n write(fd, buf, offset, length, position, callback) {\n if (offset !== 0 || length !== buf.length || position !== null) {\n callback(enosys());\n return;\n }\n const n = this.writeSync(fd, buf);\n callback(null, n);\n },\n chmod(path, mode, callback) { callback(enosys()); },\n chown(path, uid, gid, callback) { callback(enosys()); },\n close(fd, callback) { callback(enosys()); },\n fchmod(fd, mode, callback) { callback(enosys()); },\n fchown(fd, uid, gid, callback) { callback(enosys()); },\n fstat(fd, callback) { callback(enosys()); },\n fsync(fd, callback) { callback(null); },\n ftruncate(fd, length, callback) { callback(enosys()); },\n lchown(path, uid, gid, callback) { callback(enosys()); },\n link(path, link, callback) { callback(enosys()); },\n lstat(path, callback) { callback(enosys()); },\n mkdir(path, perm, callback) { callback(enosys()); },\n open(path, flags, mode, callback) { callback(enosys()); },\n read(fd, buffer, offset, length, position, callback) { callback(enosys()); },\n readdir(path, callback) { callback(enosys()); },\n readlink(path, callback) { callback(enosys()); },\n rename(from, to, callback) { callback(enosys()); },\n rmdir(path, callback) { callback(enosys()); },\n stat(path, callback) { callback(enosys()); },\n symlink(path, link, callback) { callback(enosys()); },\n truncate(path, length, callback) { callback(enosys()); },\n unlink(path, callback) { callback(enosys()); },\n utimes(path, atime, mtime, callback) { callback(enosys()); },\n };\n }\n\n if (!globalThis.process) {\n globalThis.process = {\n getuid() { return -1; },\n getgid() { return -1; },\n geteuid() { return -1; },\n getegid() { return -1; },\n getgroups() { throw enosys(); },\n pid: -1,\n ppid: -1,\n umask() { throw enosys(); },\n cwd() { throw enosys(); },\n chdir() { throw enosys(); },\n };\n }\n\n if (!globalThis.crypto) {\n throw new Error('globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)');\n }\n\n if (!globalThis.performance) {\n throw new Error('globalThis.performance is not available, polyfill required (performance.now only)');\n }\n\n if (!globalThis.TextEncoder) {\n throw new Error('globalThis.TextEncoder is not available, polyfill required');\n }\n\n if (!globalThis.TextDecoder) {\n throw new Error('globalThis.TextDecoder is not available, polyfill required');\n }\n\n const encoder = new TextEncoder('utf-8');\n const decoder = new TextDecoder('utf-8');\n\n globalThis.Go = class {\n constructor() {\n this.argv = ['js'];\n this.env = {};\n this.exit = code => {\n if (code !== 0) {\n console.warn('exit code:', code);\n }\n };\n this._exitPromise = new Promise(resolve => {\n this._resolveExitPromise = resolve;\n });\n this._pendingEvent = null;\n this._scheduledTimeouts = new Map();\n this._nextCallbackTimeoutID = 1;\n\n const setInt64 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n };\n\n const setInt32 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n };\n\n const getInt64 = addr => {\n const low = this.mem.getUint32(addr + 0, true);\n const high = this.mem.getInt32(addr + 4, true);\n return low + high * 4294967296;\n };\n\n const loadValue = addr => {\n const f = this.mem.getFloat64(addr, true);\n if (f === 0) {\n return undefined;\n }\n if (!isNaN(f)) {\n return f;\n }\n\n const id = this.mem.getUint32(addr, true);\n return this._values[id];\n };\n\n const storeValue = (addr, v) => {\n const nanHead = 0x7FF80000;\n\n if (typeof v === 'number' && v !== 0) {\n if (isNaN(v)) {\n this.mem.setUint32(addr + 4, nanHead, true);\n this.mem.setUint32(addr, 0, true);\n return;\n }\n this.mem.setFloat64(addr, v, true);\n return;\n }\n\n if (v === undefined) {\n this.mem.setFloat64(addr, 0, true);\n return;\n }\n\n let id = this._ids.get(v);\n if (id === undefined) {\n id = this._idPool.pop();\n if (id === undefined) {\n id = this._values.length;\n }\n this._values[id] = v;\n this._goRefCounts[id] = 0;\n this._ids.set(v, id);\n }\n this._goRefCounts[id]++;\n let typeFlag = 0;\n switch (typeof v) {\n case 'object':\n if (v !== null) {\n typeFlag = 1;\n }\n break;\n case 'string':\n typeFlag = 2;\n break;\n case 'symbol':\n typeFlag = 3;\n break;\n case 'function':\n typeFlag = 4;\n break;\n }\n this.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n this.mem.setUint32(addr, id, true);\n };\n\n const loadSlice = addr => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return new Uint8Array(this._inst.exports.mem.buffer, array, len);\n };\n\n const loadSliceOfValues = addr => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n const a = new Array(len);\n for (let i = 0; i < len; i++) {\n a[i] = loadValue(array + i * 8);\n }\n return a;\n };\n\n const loadString = addr => {\n const saddr = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n };\n\n const timeOrigin = Date.now() - performance.now();\n this.importObject = {\n _gotest: {\n add: (a, b) => a + b,\n },\n gojs: {\n // Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n // may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n // function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n // This changes the SP, thus we have to update the SP used by the imported function.\n\n // func wasmExit(code int32)\n 'runtime.wasmExit': sp => {\n sp >>>= 0;\n const code = this.mem.getInt32(sp + 8, true);\n this.exited = true;\n delete this._inst;\n delete this._values;\n delete this._goRefCounts;\n delete this._ids;\n delete this._idPool;\n this.exit(code);\n },\n\n // func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n 'runtime.wasmWrite': sp => {\n sp >>>= 0;\n const fd = getInt64(sp + 8);\n const p = getInt64(sp + 16);\n const n = this.mem.getInt32(sp + 24, true);\n fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n },\n\n // func resetMemoryDataView()\n 'runtime.resetMemoryDataView': sp => {\n sp >>>= 0;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n\n // func nanotime1() int64\n 'runtime.nanotime1': sp => {\n sp >>>= 0;\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);\n },\n\n // func walltime() (sec int64, nsec int32)\n 'runtime.walltime': sp => {\n sp >>>= 0;\n const msec = (new Date).getTime();\n setInt64(sp + 8, msec / 1000);\n this.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);\n },\n\n // func scheduleTimeoutEvent(delay int64) int32\n 'runtime.scheduleTimeoutEvent': sp => {\n sp >>>= 0;\n const id = this._nextCallbackTimeoutID;\n this._nextCallbackTimeoutID++;\n this._scheduledTimeouts.set(id, setTimeout(\n () => {\n this._resume();\n while (this._scheduledTimeouts.has(id)) {\n // for some reason Go failed to register the timeout event, log and try again\n // (temporary workaround for https://github.com/golang/go/issues/28975)\n console.warn('scheduleTimeoutEvent: missed timeout event');\n this._resume();\n }\n },\n getInt64(sp + 8),\n ));\n this.mem.setInt32(sp + 16, id, true);\n },\n\n // func clearTimeoutEvent(id int32)\n 'runtime.clearTimeoutEvent': sp => {\n sp >>>= 0;\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n\n // func getRandomData(r []byte)\n 'runtime.getRandomData': sp => {\n sp >>>= 0;\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n\n // func finalizeRef(v ref)\n 'syscall/js.finalizeRef': sp => {\n sp >>>= 0;\n const id = this.mem.getUint32(sp + 8, true);\n this._goRefCounts[id]--;\n if (this._goRefCounts[id] === 0) {\n const v = this._values[id];\n this._values[id] = null;\n this._ids.delete(v);\n this._idPool.push(id);\n }\n },\n\n // func stringVal(value string) ref\n 'syscall/js.stringVal': sp => {\n sp >>>= 0;\n storeValue(sp + 24, loadString(sp + 8));\n },\n\n // func valueGet(v ref, p string) ref\n 'syscall/js.valueGet': sp => {\n sp >>>= 0;\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = this._inst.exports.getsp() >>> 0; // see comment above\n storeValue(sp + 32, result);\n },\n\n // func valueSet(v ref, p string, x ref)\n 'syscall/js.valueSet': sp => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n\n // func valueDelete(v ref, p string)\n 'syscall/js.valueDelete': sp => {\n sp >>>= 0;\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n\n // func valueIndex(v ref, i int) ref\n 'syscall/js.valueIndex': sp => {\n sp >>>= 0;\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n\n // valueSetIndex(v ref, i int, x ref)\n 'syscall/js.valueSetIndex': sp => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n\n // func valueCall(v ref, m string, args []ref) (ref, bool)\n 'syscall/js.valueCall': sp => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const m = Reflect.get(v, loadString(sp + 16));\n const args = loadSliceOfValues(sp + 32);\n const result = Reflect.apply(m, v, args);\n sp = this._inst.exports.getsp() >>> 0; // see comment above\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0; // see comment above\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n\n // func valueInvoke(v ref, args []ref) (ref, bool)\n 'syscall/js.valueInvoke': sp => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.apply(v, undefined, args);\n sp = this._inst.exports.getsp() >>> 0; // see comment above\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0; // see comment above\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n\n // func valueNew(v ref, args []ref) (ref, bool)\n 'syscall/js.valueNew': sp => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = this._inst.exports.getsp() >>> 0; // see comment above\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0; // see comment above\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n\n // func valueLength(v ref) int\n 'syscall/js.valueLength': sp => {\n sp >>>= 0;\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n\n // valuePrepareString(v ref) (ref, int)\n 'syscall/js.valuePrepareString': sp => {\n sp >>>= 0;\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n\n // valueLoadString(v ref, b []byte)\n 'syscall/js.valueLoadString': sp => {\n sp >>>= 0;\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n\n // func valueInstanceOf(v ref, t ref) bool\n 'syscall/js.valueInstanceOf': sp => {\n sp >>>= 0;\n this.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);\n },\n\n // func copyBytesToGo(dst []byte, src ref) (int, bool)\n 'syscall/js.copyBytesToGo': sp => {\n sp >>>= 0;\n const dst = loadSlice(sp + 8);\n const src = loadValue(sp + 32);\n if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n\n // func copyBytesToJS(dst ref, src []byte) (int, bool)\n 'syscall/js.copyBytesToJS': sp => {\n sp >>>= 0;\n const dst = loadValue(sp + 8);\n const src = loadSlice(sp + 16);\n if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n\n 'debug': value => {\n console.log(value);\n },\n }\n };\n }\n\n async run(instance) {\n if (!(instance instanceof WebAssembly.Instance)) {\n throw new Error('Go.run: WebAssembly.Instance expected');\n }\n this._inst = instance;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n this._values = [ // JS values that Go currently has references to, indexed by reference id\n NaN,\n 0,\n null,\n true,\n false,\n globalThis,\n this,\n ];\n this._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id\n this._ids = new Map([ // mapping from JS values to reference ids\n [0, 1],\n [null, 2],\n [true, 3],\n [false, 4],\n [globalThis, 5],\n [this, 6],\n ]);\n this._idPool = []; // unused ids that have been garbage collected\n this.exited = false; // whether the Go program has exited\n\n // Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.\n let offset = 4096;\n\n const strPtr = str => {\n const ptr = offset;\n const bytes = encoder.encode(`${str}\\0`);\n new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n offset += bytes.length;\n if (offset % 8 !== 0) {\n offset += 8 - (offset % 8);\n }\n return ptr;\n };\n\n const argc = this.argv.length;\n\n const argvPtrs = [];\n this.argv.forEach(arg => {\n argvPtrs.push(strPtr(arg));\n });\n argvPtrs.push(0);\n\n const keys = Object.keys(this.env).sort();\n keys.forEach(key => {\n argvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n });\n argvPtrs.push(0);\n\n const argv = offset;\n argvPtrs.forEach(ptr => {\n this.mem.setUint32(offset, ptr, true);\n this.mem.setUint32(offset + 4, 0, true);\n offset += 8;\n });\n\n // The linker guarantees global data starts from at least wasmMinDataAddr.\n // Keep in sync with cmd/link/internal/ld/data.go:wasmMinDataAddr.\n const wasmMinDataAddr = 4096 + 8192;\n if (offset >= wasmMinDataAddr) {\n throw new Error('total length of command line and environment variables exceeds limit');\n }\n\n this._inst.exports.run(argc, argv);\n if (this.exited) {\n this._resolveExitPromise();\n }\n await this._exitPromise;\n }\n\n _resume() {\n if (this.exited) {\n throw new Error('Go program has already exited');\n }\n this._inst.exports.resume();\n if (this.exited) {\n this._resolveExitPromise();\n }\n }\n\n _makeFuncWrapper(id) {\n const go = this;\n return function() {\n const event = { id: id, this: this, args: arguments };\n go._pendingEvent = event;\n go._resume();\n return event.result;\n };\n }\n };\n});\n\nmodule.exports = {\n wasmExec,\n};\n"]}
1
+ {"version":3,"file":"wasm-exec.js","sourceRoot":"","sources":["../../../src/gateway/wasm-exec.js"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,qDAAqD;AACrD,iDAAiD;;AAEjD;;;;;;;;EAQE;AACF,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAErC,YAAY,CAAC;AAGb,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE;IACrB,MAAM,MAAM,GAAG,GAAG,EAAE;QAClB,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACzC,GAAG,CAAC,IAAI,GAAG,QAAQ,CAAC;QACpB,OAAO,GAAG,CAAC;IACb,CAAC,CAAC;IAEF,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;QACnB,IAAI,SAAS,GAAG,EAAE,CAAC;QACnB,UAAU,CAAC,EAAE,GAAG;YACd,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,SAAS;YACtG,SAAS,CAAC,EAAE,EAAE,GAAG;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AAC;YACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YAC5B,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAChB,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC7B,CAAC;QACH,CAAC;QAED,gBAAgB,CAAC,EAAE;YACjB,MAAM,EAAE,GAAG,IAAI,CAAC;YAChB,OAAO;gBACL,MAAM,KAAK,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;gBACtD,EAAE,CAAC,aAAa,GAAG,KAAK,CAAC;gBACzB,EAAE,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO,KAAK,CAAC,MAAM,CAAC;YACtB,CAAC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,GAAG;IACf,QAAQ;IACR,iBAAiB;CAClB,CAAC","sourcesContent":["// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/*\nIMPORTANT\nThis file was copied from `https://github.com/golang/go/blob/go1.23.0/misc/wasm/wasm_exec.js`.\nIt has been modified a bit to reduce webpack warnings about how the `require()` function is being used.\n\nWhen the version of go is updated, this script may also need to be updated. \n\nThe following constant has been added for gulpfile verification.\n*/\nconst WASM_EXEC_VERSION = 'go1.23.0';\n\n'use strict';\n\n\nconst wasmExec = (() => {\n const enosys = () => {\n const err = new Error('not implemented');\n err.code = 'ENOSYS';\n return err;\n };\n\n if (!globalThis.fs) {\n let outputBuf = '';\n globalThis.fs = {\n constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused\n writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf('\\n');\n if (nl != -1) {\n console.log(outputBuf.substring(0, nl));\n outputBuf = outputBuf.substring(nl + 1);\n }\n return buf.length;\n },\n write(fd, buf, offset, length, position, callback) {\n if (offset !== 0 || length !== buf.length || position !== null) {\n callback(enosys());\n return;\n }\n const n = this.writeSync(fd, buf);\n callback(null, n);\n },\n chmod(path, mode, callback) { callback(enosys()); },\n chown(path, uid, gid, callback) { callback(enosys()); },\n close(fd, callback) { callback(enosys()); },\n fchmod(fd, mode, callback) { callback(enosys()); },\n fchown(fd, uid, gid, callback) { callback(enosys()); },\n fstat(fd, callback) { callback(enosys()); },\n fsync(fd, callback) { callback(null); },\n ftruncate(fd, length, callback) { callback(enosys()); },\n lchown(path, uid, gid, callback) { callback(enosys()); },\n link(path, link, callback) { callback(enosys()); },\n lstat(path, callback) { callback(enosys()); },\n mkdir(path, perm, callback) { callback(enosys()); },\n open(path, flags, mode, callback) { callback(enosys()); },\n read(fd, buffer, offset, length, position, callback) { callback(enosys()); },\n readdir(path, callback) { callback(enosys()); },\n readlink(path, callback) { callback(enosys()); },\n rename(from, to, callback) { callback(enosys()); },\n rmdir(path, callback) { callback(enosys()); },\n stat(path, callback) { callback(enosys()); },\n symlink(path, link, callback) { callback(enosys()); },\n truncate(path, length, callback) { callback(enosys()); },\n unlink(path, callback) { callback(enosys()); },\n utimes(path, atime, mtime, callback) { callback(enosys()); },\n };\n }\n\n if (!globalThis.process) {\n globalThis.process = {\n getuid() { return -1; },\n getgid() { return -1; },\n geteuid() { return -1; },\n getegid() { return -1; },\n getgroups() { throw enosys(); },\n pid: -1,\n ppid: -1,\n umask() { throw enosys(); },\n cwd() { throw enosys(); },\n chdir() { throw enosys(); },\n };\n }\n\n if (!globalThis.crypto) {\n throw new Error('globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)');\n }\n\n if (!globalThis.performance) {\n throw new Error('globalThis.performance is not available, polyfill required (performance.now only)');\n }\n\n if (!globalThis.TextEncoder) {\n throw new Error('globalThis.TextEncoder is not available, polyfill required');\n }\n\n if (!globalThis.TextDecoder) {\n throw new Error('globalThis.TextDecoder is not available, polyfill required');\n }\n\n const encoder = new TextEncoder('utf-8');\n const decoder = new TextDecoder('utf-8');\n\n globalThis.Go = class {\n constructor() {\n this.argv = ['js'];\n this.env = {};\n this.exit = code => {\n if (code !== 0) {\n console.warn('exit code:', code);\n }\n };\n this._exitPromise = new Promise(resolve => {\n this._resolveExitPromise = resolve;\n });\n this._pendingEvent = null;\n this._scheduledTimeouts = new Map();\n this._nextCallbackTimeoutID = 1;\n\n const setInt64 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n };\n\n const setInt32 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n };\n\n const getInt64 = addr => {\n const low = this.mem.getUint32(addr + 0, true);\n const high = this.mem.getInt32(addr + 4, true);\n return low + high * 4294967296;\n };\n\n const loadValue = addr => {\n const f = this.mem.getFloat64(addr, true);\n if (f === 0) {\n return undefined;\n }\n if (!isNaN(f)) {\n return f;\n }\n\n const id = this.mem.getUint32(addr, true);\n return this._values[id];\n };\n\n const storeValue = (addr, v) => {\n const nanHead = 0x7FF80000;\n\n if (typeof v === 'number' && v !== 0) {\n if (isNaN(v)) {\n this.mem.setUint32(addr + 4, nanHead, true);\n this.mem.setUint32(addr, 0, true);\n return;\n }\n this.mem.setFloat64(addr, v, true);\n return;\n }\n\n if (v === undefined) {\n this.mem.setFloat64(addr, 0, true);\n return;\n }\n\n let id = this._ids.get(v);\n if (id === undefined) {\n id = this._idPool.pop();\n if (id === undefined) {\n id = this._values.length;\n }\n this._values[id] = v;\n this._goRefCounts[id] = 0;\n this._ids.set(v, id);\n }\n this._goRefCounts[id]++;\n let typeFlag = 0;\n switch (typeof v) {\n case 'object':\n if (v !== null) {\n typeFlag = 1;\n }\n break;\n case 'string':\n typeFlag = 2;\n break;\n case 'symbol':\n typeFlag = 3;\n break;\n case 'function':\n typeFlag = 4;\n break;\n }\n this.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n this.mem.setUint32(addr, id, true);\n };\n\n const loadSlice = addr => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return new Uint8Array(this._inst.exports.mem.buffer, array, len);\n };\n\n const loadSliceOfValues = addr => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n const a = new Array(len);\n for (let i = 0; i < len; i++) {\n a[i] = loadValue(array + i * 8);\n }\n return a;\n };\n\n const loadString = addr => {\n const saddr = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n };\n\n const timeOrigin = Date.now() - performance.now();\n this.importObject = {\n _gotest: {\n add: (a, b) => a + b,\n },\n gojs: {\n // Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n // may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n // function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n // This changes the SP, thus we have to update the SP used by the imported function.\n\n // func wasmExit(code int32)\n 'runtime.wasmExit': sp => {\n sp >>>= 0;\n const code = this.mem.getInt32(sp + 8, true);\n this.exited = true;\n delete this._inst;\n delete this._values;\n delete this._goRefCounts;\n delete this._ids;\n delete this._idPool;\n this.exit(code);\n },\n\n // func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n 'runtime.wasmWrite': sp => {\n sp >>>= 0;\n const fd = getInt64(sp + 8);\n const p = getInt64(sp + 16);\n const n = this.mem.getInt32(sp + 24, true);\n fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n },\n\n // func resetMemoryDataView()\n 'runtime.resetMemoryDataView': sp => {\n sp >>>= 0;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n\n // func nanotime1() int64\n 'runtime.nanotime1': sp => {\n sp >>>= 0;\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);\n },\n\n // func walltime() (sec int64, nsec int32)\n 'runtime.walltime': sp => {\n sp >>>= 0;\n const msec = (new Date).getTime();\n setInt64(sp + 8, msec / 1000);\n this.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);\n },\n\n // func scheduleTimeoutEvent(delay int64) int32\n 'runtime.scheduleTimeoutEvent': sp => {\n sp >>>= 0;\n const id = this._nextCallbackTimeoutID;\n this._nextCallbackTimeoutID++;\n this._scheduledTimeouts.set(id, setTimeout(\n () => {\n this._resume();\n while (this._scheduledTimeouts.has(id)) {\n // for some reason Go failed to register the timeout event, log and try again\n // (temporary workaround for https://github.com/golang/go/issues/28975)\n console.warn('scheduleTimeoutEvent: missed timeout event');\n this._resume();\n }\n },\n getInt64(sp + 8),\n ));\n this.mem.setInt32(sp + 16, id, true);\n },\n\n // func clearTimeoutEvent(id int32)\n 'runtime.clearTimeoutEvent': sp => {\n sp >>>= 0;\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n\n // func getRandomData(r []byte)\n 'runtime.getRandomData': sp => {\n sp >>>= 0;\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n\n // func finalizeRef(v ref)\n 'syscall/js.finalizeRef': sp => {\n sp >>>= 0;\n const id = this.mem.getUint32(sp + 8, true);\n this._goRefCounts[id]--;\n if (this._goRefCounts[id] === 0) {\n const v = this._values[id];\n this._values[id] = null;\n this._ids.delete(v);\n this._idPool.push(id);\n }\n },\n\n // func stringVal(value string) ref\n 'syscall/js.stringVal': sp => {\n sp >>>= 0;\n storeValue(sp + 24, loadString(sp + 8));\n },\n\n // func valueGet(v ref, p string) ref\n 'syscall/js.valueGet': sp => {\n sp >>>= 0;\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = this._inst.exports.getsp() >>> 0; // see comment above\n storeValue(sp + 32, result);\n },\n\n // func valueSet(v ref, p string, x ref)\n 'syscall/js.valueSet': sp => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n\n // func valueDelete(v ref, p string)\n 'syscall/js.valueDelete': sp => {\n sp >>>= 0;\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n\n // func valueIndex(v ref, i int) ref\n 'syscall/js.valueIndex': sp => {\n sp >>>= 0;\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n\n // valueSetIndex(v ref, i int, x ref)\n 'syscall/js.valueSetIndex': sp => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n\n // func valueCall(v ref, m string, args []ref) (ref, bool)\n 'syscall/js.valueCall': sp => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const m = Reflect.get(v, loadString(sp + 16));\n const args = loadSliceOfValues(sp + 32);\n const result = Reflect.apply(m, v, args);\n sp = this._inst.exports.getsp() >>> 0; // see comment above\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0; // see comment above\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n\n // func valueInvoke(v ref, args []ref) (ref, bool)\n 'syscall/js.valueInvoke': sp => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.apply(v, undefined, args);\n sp = this._inst.exports.getsp() >>> 0; // see comment above\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0; // see comment above\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n\n // func valueNew(v ref, args []ref) (ref, bool)\n 'syscall/js.valueNew': sp => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = this._inst.exports.getsp() >>> 0; // see comment above\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0; // see comment above\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n\n // func valueLength(v ref) int\n 'syscall/js.valueLength': sp => {\n sp >>>= 0;\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n\n // valuePrepareString(v ref) (ref, int)\n 'syscall/js.valuePrepareString': sp => {\n sp >>>= 0;\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n\n // valueLoadString(v ref, b []byte)\n 'syscall/js.valueLoadString': sp => {\n sp >>>= 0;\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n\n // func valueInstanceOf(v ref, t ref) bool\n 'syscall/js.valueInstanceOf': sp => {\n sp >>>= 0;\n this.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);\n },\n\n // func copyBytesToGo(dst []byte, src ref) (int, bool)\n 'syscall/js.copyBytesToGo': sp => {\n sp >>>= 0;\n const dst = loadSlice(sp + 8);\n const src = loadValue(sp + 32);\n if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n\n // func copyBytesToJS(dst ref, src []byte) (int, bool)\n 'syscall/js.copyBytesToJS': sp => {\n sp >>>= 0;\n const dst = loadValue(sp + 8);\n const src = loadSlice(sp + 16);\n if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n\n 'debug': value => {\n console.log(value);\n },\n }\n };\n }\n\n async run(instance) {\n if (!(instance instanceof WebAssembly.Instance)) {\n throw new Error('Go.run: WebAssembly.Instance expected');\n }\n this._inst = instance;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n this._values = [ // JS values that Go currently has references to, indexed by reference id\n NaN,\n 0,\n null,\n true,\n false,\n globalThis,\n this,\n ];\n this._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id\n this._ids = new Map([ // mapping from JS values to reference ids\n [0, 1],\n [null, 2],\n [true, 3],\n [false, 4],\n [globalThis, 5],\n [this, 6],\n ]);\n this._idPool = []; // unused ids that have been garbage collected\n this.exited = false; // whether the Go program has exited\n\n // Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.\n let offset = 4096;\n\n const strPtr = str => {\n const ptr = offset;\n const bytes = encoder.encode(`${str}\\0`);\n new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n offset += bytes.length;\n if (offset % 8 !== 0) {\n offset += 8 - (offset % 8);\n }\n return ptr;\n };\n\n const argc = this.argv.length;\n\n const argvPtrs = [];\n this.argv.forEach(arg => {\n argvPtrs.push(strPtr(arg));\n });\n argvPtrs.push(0);\n\n const keys = Object.keys(this.env).sort();\n keys.forEach(key => {\n argvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n });\n argvPtrs.push(0);\n\n const argv = offset;\n argvPtrs.forEach(ptr => {\n this.mem.setUint32(offset, ptr, true);\n this.mem.setUint32(offset + 4, 0, true);\n offset += 8;\n });\n\n // The linker guarantees global data starts from at least wasmMinDataAddr.\n // Keep in sync with cmd/link/internal/ld/data.go:wasmMinDataAddr.\n const wasmMinDataAddr = 4096 + 8192;\n if (offset >= wasmMinDataAddr) {\n throw new Error('total length of command line and environment variables exceeds limit');\n }\n\n this._inst.exports.run(argc, argv);\n if (this.exited) {\n this._resolveExitPromise();\n }\n await this._exitPromise;\n }\n\n _resume() {\n if (this.exited) {\n throw new Error('Go program has already exited');\n }\n this._inst.exports.resume();\n if (this.exited) {\n this._resolveExitPromise();\n }\n }\n\n _makeFuncWrapper(id) {\n const go = this;\n return function() {\n const event = { id: id, this: this, args: arguments };\n go._pendingEvent = event;\n go._resume();\n return event.result;\n };\n }\n };\n});\n\nmodule.exports = {\n wasmExec,\n WASM_EXEC_VERSION,\n};\n"]}
@@ -130,7 +130,7 @@ class Library {
130
130
  const request = {
131
131
  ...requests.CheckVersionRequest.DEFAULT,
132
132
  host: 'js',
133
- version: '7.6.0',
133
+ version: '7.6.2',
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,UAAU;YACtB,aAAa,EAAE,aAAa;YAC5B,QAAQ;gBACN,OAAO,QAAQ,CAAC,wBAAwB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC1D,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;IAED;;;;;;;OAOG;IACI,M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AAQ,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.6.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,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,CAAC,mBAAmB,CAC/B,aAAsB;QAEtB,MAAM,OAAO,GAA0D;YACrE,GAAG,QAAQ,CAAC,0BAA0B,CAAC,OAAO;YAC9C,QAAQ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AC9D,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.6.2',\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"]}
@@ -24,6 +24,11 @@ export declare class WdiAutofocusProvider {
24
24
  * Close the connection.
25
25
  */
26
26
  close(): Promise<void>;
27
+ /**
28
+ * Frees the connection.
29
+ * @param providerId The ID of the connection to free.
30
+ */
31
+ private static _free;
27
32
  /**
28
33
  * Generic read operation.
29
34
  * @param registerId Register address to read from.
@@ -61,6 +66,12 @@ export declare class WdiAutofocusProvider {
61
66
  * @returns A string that represents the connection.
62
67
  */
63
68
  toString(): string;
69
+ /**
70
+ * Releases the native resources of the connection.
71
+ * Should only be called if your environment does not support FinalizationRegistry.
72
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry
73
+ */
74
+ free(): void;
64
75
  }
65
76
  declare namespace WdiAutofocusProvider {
66
77
  interface GenericReadOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"wdi_autofocus_provider.d.ts","sourceRoot":"","sources":["../../../src/microscopy/wdi_autofocus_provider.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E;;GAEG;AACH,qBAAa,oBAAoB;IAC/B;;OAEG;IACH,gBAAuB,gBAAgB,EAAE,MAAM,CAAM;IAErD;;OAEG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;IACD,OAAO,CAAC,WAAW,CAAS;gBAEhB,UAAU,EAAE,MAAM;IAI9B;;;;;OAKG;WACiB,OAAO,CACzB,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,MAA8C,GACnD,OAAO,CAAC,oBAAoB,CAAC;IAkBhC;;OAEG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAYnC;;;;;;;;OAQG;IACU,WAAW,CACtB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,oBAAoB,CAAC,kBAAuB,GACpD,OAAO,CAAC,MAAM,EAAE,CAAC;IA0BpB;;;;;;;OAOG;IACU,YAAY,CACvB,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,MAAU,EAChB,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,GAAE,oBAAoB,CAAC,mBAAwB,GACrD,OAAO,CAAC,IAAI,CAAC;IAqBhB;;OAEG;IACU,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAazC;;OAEG;IACU,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAa1C;;;OAGG;IACU,SAAS,IAAI,OAAO,CAAC,0BAA0B,CAAC;IAgB7D;;;OAGG;IACI,QAAQ,IAAI,MAAM;CAe1B;AAED,kBAAU,oBAAoB,CAAC;IAC7B,UAAiB,kBAAkB;QAC/B;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QACf;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB;IACD,UAAiB,mBAAmB;QAChC;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB;CACF"}
1
+ {"version":3,"file":"wdi_autofocus_provider.d.ts","sourceRoot":"","sources":["../../../src/microscopy/wdi_autofocus_provider.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E;;GAEG;AACH,qBAAa,oBAAoB;IAC/B;;OAEG;IACH,gBAAuB,gBAAgB,EAAE,MAAM,CAAM;IAErD;;OAEG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;IACD,OAAO,CAAC,WAAW,CAAS;gBAEhB,UAAU,EAAE,MAAM;IAK9B;;;;;OAKG;WACiB,OAAO,CACzB,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,MAA8C,GACnD,OAAO,CAAC,oBAAoB,CAAC;IAkBhC;;OAEG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAYnC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,KAAK;IAcpB;;;;;;;;OAQG;IACU,WAAW,CACtB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,oBAAoB,CAAC,kBAAuB,GACpD,OAAO,CAAC,MAAM,EAAE,CAAC;IA0BpB;;;;;;;OAOG;IACU,YAAY,CACvB,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,MAAU,EAChB,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,GAAE,oBAAoB,CAAC,mBAAwB,GACrD,OAAO,CAAC,IAAI,CAAC;IAqBhB;;OAEG;IACU,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAazC;;OAEG;IACU,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAa1C;;;OAGG;IACU,SAAS,IAAI,OAAO,CAAC,0BAA0B,CAAC;IAgB7D;;;OAGG;IACI,QAAQ,IAAI,MAAM;IAgBzB;;;;MAIE;IACK,IAAI,IAAI,IAAI;CAGpB;AAED,kBAAU,oBAAoB,CAAC;IAC7B,UAAiB,kBAAkB;QAC/B;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QACf;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB;IACD,UAAiB,mBAAmB;QAChC;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB;CACF"}
@@ -28,6 +28,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
28
28
  exports.WdiAutofocusProvider = void 0;
29
29
  const gateway = __importStar(require("../gateway"));
30
30
  const requests = __importStar(require("../requests"));
31
+ const finalizer_1 = require("../finalizer");
31
32
  /**
32
33
  * Class representing access to WDI Autofocus connection.
33
34
  */
@@ -40,6 +41,7 @@ class WdiAutofocusProvider {
40
41
  }
41
42
  constructor(providerId) {
42
43
  this._providerId = providerId;
44
+ (0, finalizer_1.registerForFinalization)(this, WdiAutofocusProvider._free.bind(null, providerId));
43
45
  }
44
46
  /**
45
47
  * Opens a TCP connection to WDI autofocus.
@@ -73,6 +75,20 @@ class WdiAutofocusProvider {
73
75
  };
74
76
  await gateway.callAsync('wdi/close', request);
75
77
  }
78
+ /**
79
+ * Frees the connection.
80
+ * @param providerId The ID of the connection to free.
81
+ */
82
+ static _free(providerId) {
83
+ const request = {
84
+ ...requests.InterfaceEmptyRequest.DEFAULT,
85
+ interfaceId: providerId,
86
+ toBinary() {
87
+ return requests.InterfaceEmptyRequest.toBinary(this);
88
+ },
89
+ };
90
+ gateway.callSync('wdi/free', request);
91
+ }
76
92
  /**
77
93
  * Generic read operation.
78
94
  * @param registerId Register address to read from.
@@ -181,6 +197,14 @@ class WdiAutofocusProvider {
181
197
  const response = gateway.callSync('wdi/to_string', request, requests.StringResponse.fromBinary);
182
198
  return response.value;
183
199
  }
200
+ /**
201
+ * Releases the native resources of the connection.
202
+ * Should only be called if your environment does not support FinalizationRegistry.
203
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry
204
+ */
205
+ free() {
206
+ WdiAutofocusProvider._free(this.providerId);
207
+ }
184
208
  }
185
209
  exports.WdiAutofocusProvider = WdiAutofocusProvider;
186
210
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"wdi_autofocus_provider.js","sourceRoot":"","sources":["../../../src/microscopy/wdi_autofocus_provider.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,sDAAwC;AAGxC;;GAEG;AACH,MAAa,oBAAoB;IAM/B;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD,YAAY,UAAkB;QAC5B,IAAI,CAAC,WAAW,GAAG,UAAU,CAA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UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;;AA3MH,oDA4MC;AA3MC;;GAEG;AACoB,qCAAgB,GAAW,EAAE,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 { WdiAutofocusProviderStatus } from './wdi_autofocus_provider_status';\n\n/**\n * Class representing access to WDI Autofocus connection.\n */\nexport class WdiAutofocusProvider {\n /**\n * Default port number for TCP connections to WDI autofocus.\n */\n public static readonly DEFAULT_TCP_PORT: number = 27;\n\n /**\n * The ID identifies the autofocus with the underlying library.\n */\n public get providerId(): number {\n return this._providerId;\n }\n private _providerId: number;\n\n constructor(providerId: number) {\n this._providerId = providerId;\n }\n\n /**\n * Opens a TCP connection to WDI autofocus.\n * @param hostName Hostname or IP address.\n * @param [port=WdiAutofocusProvider.DEFAULT_TCP_PORT] Optional port number (defaults to 27).\n * @returns An object representing the autofocus connection.\n */\n public static async openTcp(\n hostName: string,\n port: number = WdiAutofocusProvider.DEFAULT_TCP_PORT\n ): Promise<WdiAutofocusProvider> {\n const request: requests.OpenInterfaceRequest & gateway.Message = {\n ...requests.OpenInterfaceRequest.DEFAULT,\n interfaceType: requests.InterfaceType.TCP,\n hostName: hostName,\n port: port,\n toBinary() {\n return requests.OpenInterfaceRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'wdi/open',\n request,\n requests.IntResponse.fromBinary);\n return new WdiAutofocusProvider(response.value);\n }\n\n /**\n * Close the connection.\n */\n public async close(): Promise<void> {\n const request: requests.InterfaceEmptyRequest & gateway.Message = {\n ...requests.InterfaceEmptyRequest.DEFAULT,\n interfaceId: this.providerId,\n toBinary() {\n return requests.InterfaceEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/close', request);\n }\n\n /**\n * Generic read operation.\n * @param registerId Register address to read from.\n * @param size Data size to read. Valid values are (1,2,4). Determines the data type (Byte, Word, DWord).\n * @param [options.count=1] Number of values to read (defaults to 1).\n * @param [options.offset=0] Offset within the register (defaults to 0).\n * @param [options.registerBank='U'] Register bank letter (defaults to U for user bank).\n * @returns Array of integers read from the device.\n */\n public async genericRead(\n registerId: number,\n size: number,\n options: WdiAutofocusProvider.GenericReadOptions = {}\n ): Promise<number[]> {\n const {\n count = 1,\n offset = 0,\n registerBank = 'U',\n } = options;\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: registerId,\n size: size,\n count: count,\n offset: offset,\n registerBank: registerBank,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntArrayResponse>(\n 'wdi/read',\n request,\n requests.IntArrayResponse.fromBinary);\n return response.values;\n }\n\n /**\n * Generic write operation.\n * @param registerId Register address to read from.\n * @param [size=0] Data size to write. Valid values are (0,1,2,4). Determines the data type (Nil, Byte, Word, DWord).\n * @param [data=[]] Array of values to write to the register. Empty array is allowed.\n * @param [options.offset=0] Offset within the register (defaults to 0).\n * @param [options.registerBank='U'] Register bank letter (defaults to U for user bank).\n */\n public async genericWrite(\n registerId: number,\n size: number = 0,\n data: number[] = [],\n options: WdiAutofocusProvider.GenericWriteOptions = {}\n ): Promise<void> {\n const {\n offset = 0,\n registerBank = 'U',\n } = options;\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: registerId,\n size: size,\n data: data,\n offset: offset,\n registerBank: registerBank,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/write', request);\n }\n\n /**\n * Enables the laser.\n */\n public async enableLaser(): Promise<void> {\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: 1,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/write', request);\n }\n\n /**\n * Disables the laser.\n */\n public async disableLaser(): Promise<void> {\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: 2,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/write', request);\n }\n\n /**\n * Gets the status of the autofocus.\n * @returns The status of the autofocus.\n */\n public async getStatus(): Promise<WdiAutofocusProviderStatus> {\n const request: requests.InterfaceEmptyRequest & gateway.Message = {\n ...requests.InterfaceEmptyRequest.DEFAULT,\n interfaceId: this.providerId,\n toBinary() {\n return requests.InterfaceEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.WdiGetStatusResponse>(\n 'wdi/get_status',\n request,\n requests.WdiGetStatusResponse.fromBinary);\n return response.status;\n }\n\n /**\n * Returns a string that represents the autofocus connection.\n * @returns A string that represents the connection.\n */\n public toString(): string {\n const request: requests.InterfaceEmptyRequest & gateway.Message = {\n ...requests.InterfaceEmptyRequest.DEFAULT,\n interfaceId: this.providerId,\n toBinary() {\n return requests.InterfaceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'wdi/to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace WdiAutofocusProvider {\n export interface GenericReadOptions {\n /**\n * Number of values to read (defaults to 1).\n */\n count?: number;\n /**\n * Offset within the register (defaults to 0).\n */\n offset?: number;\n /**\n * Register bank letter (defaults to U for user bank).\n */\n registerBank?: string;\n }\n export interface GenericWriteOptions {\n /**\n * Offset within the register (defaults to 0).\n */\n offset?: number;\n /**\n * Register bank letter (defaults to U for user bank).\n */\n registerBank?: string;\n }\n}\n"]}
1
+ {"version":3,"file":"wdi_autofocus_provider.js","sourceRoot":"","sources":["../../../src/microscopy/wdi_autof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CAAC,SAAS;QACpB,MAAM,OAAO,GAAqD;YAChE,GAAG,QAAQ,CAAC,qBAAqB,CAAC,OAAO;YACzC,WAAW,EAAE,IAAI,CAAC,UAAU;YAC5B,QAAQ;gBACN,OAAO,QAAQ,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACvD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,gBAAgB,EAChB,OAAO,EACP,QAAQ,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC,MAAM,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,MAAM,OAAO,GAAqD;YAChE,GAAG,QAAQ,CAAC,qBAAqB,CAAC,OAAO;YACzC,WAAW,EAAE,IAAI,CAAC,UAAU;YAC5B,QAAQ;gBACN,OAAO,QAAQ,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACvD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,eAAe,EACf,OAAO,EACP,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;IAED;;;;MAIE;IACK,IAAI;QACT,oBAAoB,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC9C,CAAC;;AAvOH,oDAwOC;AAvOC;;GAEG;AACoB,qCAAgB,GAAW,EAAE,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 { registerForFinalization } from '../finalizer';\nimport { WdiAutofocusProviderStatus } from './wdi_autofocus_provider_status';\n\n/**\n * Class representing access to WDI Autofocus connection.\n */\nexport class WdiAutofocusProvider {\n /**\n * Default port number for TCP connections to WDI autofocus.\n */\n public static readonly DEFAULT_TCP_PORT: number = 27;\n\n /**\n * The ID identifies the autofocus with the underlying library.\n */\n public get providerId(): number {\n return this._providerId;\n }\n private _providerId: number;\n\n constructor(providerId: number) {\n this._providerId = providerId;\n registerForFinalization(this, WdiAutofocusProvider._free.bind(null, providerId));\n }\n\n /**\n * Opens a TCP connection to WDI autofocus.\n * @param hostName Hostname or IP address.\n * @param [port=WdiAutofocusProvider.DEFAULT_TCP_PORT] Optional port number (defaults to 27).\n * @returns An object representing the autofocus connection.\n */\n public static async openTcp(\n hostName: string,\n port: number = WdiAutofocusProvider.DEFAULT_TCP_PORT\n ): Promise<WdiAutofocusProvider> {\n const request: requests.OpenInterfaceRequest & gateway.Message = {\n ...requests.OpenInterfaceRequest.DEFAULT,\n interfaceType: requests.InterfaceType.TCP,\n hostName: hostName,\n port: port,\n toBinary() {\n return requests.OpenInterfaceRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'wdi/open',\n request,\n requests.IntResponse.fromBinary);\n return new WdiAutofocusProvider(response.value);\n }\n\n /**\n * Close the connection.\n */\n public async close(): Promise<void> {\n const request: requests.InterfaceEmptyRequest & gateway.Message = {\n ...requests.InterfaceEmptyRequest.DEFAULT,\n interfaceId: this.providerId,\n toBinary() {\n return requests.InterfaceEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/close', request);\n }\n\n /**\n * Frees the connection.\n * @param providerId The ID of the connection to free.\n */\n private static _free(\n providerId: number\n ): void {\n const request: requests.InterfaceEmptyRequest & gateway.Message = {\n ...requests.InterfaceEmptyRequest.DEFAULT,\n interfaceId: providerId,\n toBinary() {\n return requests.InterfaceEmptyRequest.toBinary(this);\n },\n };\n\n gateway.callSync('wdi/free', request);\n }\n\n /**\n * Generic read operation.\n * @param registerId Register address to read from.\n * @param size Data size to read. Valid values are (1,2,4). Determines the data type (Byte, Word, DWord).\n * @param [options.count=1] Number of values to read (defaults to 1).\n * @param [options.offset=0] Offset within the register (defaults to 0).\n * @param [options.registerBank='U'] Register bank letter (defaults to U for user bank).\n * @returns Array of integers read from the device.\n */\n public async genericRead(\n registerId: number,\n size: number,\n options: WdiAutofocusProvider.GenericReadOptions = {}\n ): Promise<number[]> {\n const {\n count = 1,\n offset = 0,\n registerBank = 'U',\n } = options;\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: registerId,\n size: size,\n count: count,\n offset: offset,\n registerBank: registerBank,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntArrayResponse>(\n 'wdi/read',\n request,\n requests.IntArrayResponse.fromBinary);\n return response.values;\n }\n\n /**\n * Generic write operation.\n * @param registerId Register address to read from.\n * @param [size=0] Data size to write. Valid values are (0,1,2,4). Determines the data type (Nil, Byte, Word, DWord).\n * @param [data=[]] Array of values to write to the register. Empty array is allowed.\n * @param [options.offset=0] Offset within the register (defaults to 0).\n * @param [options.registerBank='U'] Register bank letter (defaults to U for user bank).\n */\n public async genericWrite(\n registerId: number,\n size: number = 0,\n data: number[] = [],\n options: WdiAutofocusProvider.GenericWriteOptions = {}\n ): Promise<void> {\n const {\n offset = 0,\n registerBank = 'U',\n } = options;\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: registerId,\n size: size,\n data: data,\n offset: offset,\n registerBank: registerBank,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/write', request);\n }\n\n /**\n * Enables the laser.\n */\n public async enableLaser(): Promise<void> {\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: 1,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/write', request);\n }\n\n /**\n * Disables the laser.\n */\n public async disableLaser(): Promise<void> {\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: 2,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/write', request);\n }\n\n /**\n * Gets the status of the autofocus.\n * @returns The status of the autofocus.\n */\n public async getStatus(): Promise<WdiAutofocusProviderStatus> {\n const request: requests.InterfaceEmptyRequest & gateway.Message = {\n ...requests.InterfaceEmptyRequest.DEFAULT,\n interfaceId: this.providerId,\n toBinary() {\n return requests.InterfaceEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.WdiGetStatusResponse>(\n 'wdi/get_status',\n request,\n requests.WdiGetStatusResponse.fromBinary);\n return response.status;\n }\n\n /**\n * Returns a string that represents the autofocus connection.\n * @returns A string that represents the connection.\n */\n public toString(): string {\n const request: requests.InterfaceEmptyRequest & gateway.Message = {\n ...requests.InterfaceEmptyRequest.DEFAULT,\n interfaceId: this.providerId,\n toBinary() {\n return requests.InterfaceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'wdi/to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Releases the native resources of the connection.\n * Should only be called if your environment does not support FinalizationRegistry.\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n */\n public free(): void {\n WdiAutofocusProvider._free(this.providerId);\n }\n}\n\nnamespace WdiAutofocusProvider {\n export interface GenericReadOptions {\n /**\n * Number of values to read (defaults to 1).\n */\n count?: number;\n /**\n * Offset within the register (defaults to 0).\n */\n offset?: number;\n /**\n * Register bank letter (defaults to U for user bank).\n */\n registerBank?: string;\n }\n export interface GenericWriteOptions {\n /**\n * Offset within the register (defaults to 0).\n */\n offset?: number;\n /**\n * Register bank letter (defaults to U for user bank).\n */\n registerBank?: string;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaber/motion",
3
- "version": "7.6.0",
3
+ "version": "7.6.2",
4
4
  "description": "Zaber Motion Library is a multi-platform library used to operate Zaber devices.",
5
5
  "keywords": [],
6
6
  "main": "dist/lib/index.js",