opcua-webapi-ts 1.1.9 → 1.1.11

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DingYan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -26,9 +26,33 @@ npm run build
26
26
 
27
27
  ### Publishing
28
28
 
29
- First build the package then run `npm publish`
29
+ Build the package before publishing:
30
+
31
+ ```bash
32
+ npm install
33
+ npm run build
34
+ ```
35
+
36
+ Then publish it to npm:
37
+
38
+ ```bash
39
+ npm publish
40
+ ```
30
41
 
31
42
  ### Consuming
43
+
44
+ ```bash
32
45
  npm install opcua-webapi-ts
46
+ ```
33
47
 
34
- !Note: Currently, the source code of this module is on AtomGit platform, and it will be available on GitHub soon.
48
+ CommonJS:
49
+
50
+ ```js
51
+ const { UaWebClient } = require("opcua-webapi-ts")
52
+ ```
53
+
54
+ TypeScript:
55
+
56
+ ```ts
57
+ import { UaWebClient } from "opcua-webapi-ts"
58
+ ```
@@ -95,7 +95,7 @@ class UaWebClient {
95
95
  new common_1.UaReadValueId(nodeId, opcua_webapi_1.Attributes.NodeClass),
96
96
  new common_1.UaReadValueId(nodeId, opcua_webapi_1.Attributes.BrowseName),
97
97
  new common_1.UaReadValueId(nodeId, opcua_webapi_1.Attributes.DisplayName),
98
- new common_1.UaReadValueId(nodeId, opcua_webapi_1.Attributes.UserWriteMask)
98
+ new common_1.UaReadValueId(nodeId, opcua_webapi_1.Attributes.WriteMask)
99
99
  ];
100
100
  if (returnDescription) {
101
101
  nodesToRead.push(new common_1.UaReadValueId(nodeId, opcua_webapi_1.Attributes.Description));
@@ -6,13 +6,8 @@ const types_1 = require("../types");
6
6
  const nodes_1 = require("../nodes");
7
7
  class UaRange {
8
8
  constructor(low, high) {
9
- this._low = (low) ? low : Number.MIN_SAFE_INTEGER;
10
- this._high = (high) ? high : Number.MAX_SAFE_INTEGER;
11
- if (this._high < this._low) {
12
- let tmp = this._high;
13
- this._low = this._high;
14
- this._high = tmp;
15
- }
9
+ this._low = low;
10
+ this._high = high;
16
11
  }
17
12
  get low() {
18
13
  return this._low;
@@ -15,7 +15,7 @@ class UaLocalizedText {
15
15
  toString() {
16
16
  return `Text: ${this._text} Locale: ${this._locale}`;
17
17
  }
18
- from(text) {
18
+ static from(text) {
19
19
  return new UaLocalizedText(text);
20
20
  }
21
21
  }
@@ -95,7 +95,7 @@ class UaWebClient {
95
95
  new common_1.UaReadValueId(nodeId, opcua_webapi_1.Attributes.NodeClass),
96
96
  new common_1.UaReadValueId(nodeId, opcua_webapi_1.Attributes.BrowseName),
97
97
  new common_1.UaReadValueId(nodeId, opcua_webapi_1.Attributes.DisplayName),
98
- new common_1.UaReadValueId(nodeId, opcua_webapi_1.Attributes.UserWriteMask)
98
+ new common_1.UaReadValueId(nodeId, opcua_webapi_1.Attributes.WriteMask)
99
99
  ];
100
100
  if (returnDescription) {
101
101
  nodesToRead.push(new common_1.UaReadValueId(nodeId, opcua_webapi_1.Attributes.Description));
@@ -6,13 +6,8 @@ const types_1 = require("../types");
6
6
  const nodes_1 = require("../nodes");
7
7
  class UaRange {
8
8
  constructor(low, high) {
9
- this._low = (low) ? low : Number.MIN_SAFE_INTEGER;
10
- this._high = (high) ? high : Number.MAX_SAFE_INTEGER;
11
- if (this._high < this._low) {
12
- let tmp = this._high;
13
- this._low = this._high;
14
- this._high = tmp;
15
- }
9
+ this._low = low;
10
+ this._high = high;
16
11
  }
17
12
  get low() {
18
13
  return this._low;
@@ -6,5 +6,5 @@ export declare class UaLocalizedText {
6
6
  get text(): string;
7
7
  get locale(): string | null;
8
8
  toString(): string;
9
- from(text: string): UaLocalizedText;
9
+ static from(text: string): UaLocalizedText;
10
10
  }
@@ -15,7 +15,7 @@ class UaLocalizedText {
15
15
  toString() {
16
16
  return `Text: ${this._text} Locale: ${this._locale}`;
17
17
  }
18
- from(text) {
18
+ static from(text) {
19
19
  return new UaLocalizedText(text);
20
20
  }
21
21
  }
package/package.json CHANGED
@@ -1,21 +1,37 @@
1
1
  {
2
2
  "name": "opcua-webapi-ts",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
4
4
  "description": "Provides OPC UA WebAPI wrapper and client based on opcua-webapi-typescript",
5
5
  "author": "DingYan",
6
+ "license": "MIT",
6
7
  "main": "./dist/cjs/index.js",
7
- "typings": "./dist/index.d.ts",
8
- "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "require": "./dist/cjs/index.js",
13
+ "default": "./dist/cjs/index.js"
14
+ }
15
+ },
9
16
  "files": [
10
17
  "dist/**/*"
11
18
  ],
19
+ "keywords": [
20
+ "opcua",
21
+ "opc-ua",
22
+ "webapi",
23
+ "typescript"
24
+ ],
12
25
  "scripts": {
13
26
  "build": "tsc && tsc -p tsconfig.cjs.json",
14
27
  "prepare": "npm run build",
15
- "dev": "ts-node-dev --no-notify --respawn --transpile-only test/test"
28
+ "dev": "tsx watch --clear-screen=false test/test.ts"
16
29
  },
17
30
  "dependencies": {
18
- "opcua-webapi": "^1.504.2",
19
- "typescript": "^6.0.2"
31
+ "opcua-webapi": "^1.504.2"
32
+ },
33
+ "devDependencies": {
34
+ "tsx": "^4.22.3",
35
+ "typescript": "^6.0.3"
20
36
  }
21
37
  }