Skip to content

Commit

Permalink
Merge remote-tracking branch 'node-opcua/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
biancode committed Jan 21, 2024
2 parents bb42e92 + 2e6d593 commit 5efa781
Show file tree
Hide file tree
Showing 118 changed files with 760 additions and 209 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Professional support ensures the following:
- 🔐 confidentiality & privacy
- 🔍 dedicated investigation for your issue
- 🐛 prompt resolution of bugs or issues
- 📖 free access to the most up to date and online version of [node-opcua by example](https://leanpub.com/node-opcuabyexample-edition2022)
- 📖 free access to the most up to date and online version of [node-opcua by example](https://leanpub.com/node-opcuabyexample-edition2024)
You may also [contact Sterfive](https://www.sterfive.com) for dedicated professional support: mailto:contact@sterfive.com
Expand Down Expand Up @@ -59,7 +59,7 @@ Grants ensure the following:
**for community support**
- use [gitter](https://gitter.im/node-opcua/node-opcua)
- use [stackoverflow](https://stackoverflow.com/questions/tagged/node-opcua)
- access the "NodeOPCUA by example" book at https://leanpub.com/node-opcuabyexample-edition2022
- access the "NodeOPCUA by example" book at https://leanpub.com/node-opcuabyexample-edition2024
-->


Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Professional support ensures the following:
- 🔐 confidentiality & privacy
- 🔍 dedicated investigation for your issue
- 🐛 prompt resolution of bugs or issues
- 📖 free access to the most up to date and online version of [node-opcua by example](https://leanpub.com/node-opcuabyexample-edition2022)
- 📖 free access to the most up to date and online version of [node-opcua by example](https://leanpub.com/node-opcuabyexample-edition2024)
You may also [contact Sterfive](https://www.sterfive.com) for dedicated professional support: mailto:contact@sterfive.com
Expand Down Expand Up @@ -60,7 +60,7 @@ Grants ensure the following:
**for community support**
- use [gitter](https://gitter.im/node-opcua/node-opcua)
- use [stackoverflow](https://stackoverflow.com/questions/tagged/node-opcua)
- access the "NodeOPCUA by example" book at https://leanpub.com/node-opcuabyexample-edition2022
- access the "NodeOPCUA by example" book at https://leanpub.com/node-opcuabyexample-edition2024
-->

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Professional support ensures the following:
- 🔐 confidentiality & privacy
- 🔍 dedicated investigation for your issue
- 🐛 prompt resolution of bugs or issues
- 📖 free access to the most up to date and online version of [node-opcua by example](https://leanpub.com/node-opcuabyexample-edition2022)
- 📖 free access to the most up to date and online version of [node-opcua by example](https://leanpub.com/node-opcuabyexample-edition2024)
You may also [contact Sterfive directly](https://www.sterfive.com) for dedicated professional support: mailto:contact@sterfive.com
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)
Copyright (c) 2022-2024 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)

Copyright (c) 2014-2022 Etienne Rossignon

Expand Down
35 changes: 21 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ node-opcua is a full OPC UA stack for NodeJS and the Browser written in Typescri
[![Coverage Status](https://img.shields.io/coverallsCoverage/github/node-opcua/node-opcua)](https://coveralls.io/r/node-opcua/node-opcua)
[![Gitter chat](https://img.shields.io/gitter/room/node-opcua/node-opcua
)](https://gitter.im/node-opcua/node-opcua)
[![The Book](https://img.shields.io/static/v1?label=the%20book&message=NodeOPCUA%20by%20example&color=blueviolet&logo=leanpub)](https://leanpub.com/node-opcuabyexample-edition2022)
[![The Book](https://img.shields.io/static/v1?label=the%20book&message=NodeOPCUA%20by%20example&color=blueviolet&logo=leanpub)](https://leanpub.com/node-opcuabyexample-edition2024)

[![NPM download - server](https://img.shields.io/npm/dm/node-opcua.svg?logo=npm&label=node-opcua-server)](https://www.npmtrends.com/node-opcua-server)
[![NPM download - server -total](https://img.shields.io/npm/dt/node-opcua.svg?label=total)](https://www.npmtrends.com/node-opcua-server)
Expand All @@ -18,11 +18,17 @@ node-opcua is a full OPC UA stack for NodeJS and the Browser written in Typescri
[![NPM download - client -total](https://img.shields.io/npm/dt/node-opcua-client.svg?label=total)](https://www.npmtrends.com/node-opcua-client)


<!-- [![open collective badge](https://opencollective.com/node-opcua/tiers/sponsor/badge.svg?label=sponsor<!--&color=brightgreen")](https://opencollective.com/node-opcua#support)
-->
[![Financial contributors](https://opencollective.com/node-opcua/tiers/badge.svg)](https://opencollective.com/node-opcua#support)

[![Become a sponsor](https://opencollective.com/node-opcua/tiers/sponsor.svg?avatarHeight=36&width=600")](https://opencollective.com/node-opcua/contribute/sponsor-23291/checkout?interval=month&amount=500&contributeAs=me)

[Node-opcua](https://node-opcua.github.io/) is the OPC-UA stack running on NodeJS.

Why NodeJS ?

Because NodeJs is a great framework to design high-performing asynchronous applications.
Because NodeJs is a great framework for designing high-performing asynchronous applications.


## Getting started
Expand All @@ -33,7 +39,7 @@ Because NodeJs is a great framework to design high-performing asynchronous appli
$ cd mytest
$ npm init
$ npm install node-opcua --unsafe-perms
$ # create your first app.js file!
$ # Create your first app.js file!


### installing node-opcua samples as a node package
Expand All @@ -58,19 +64,19 @@ $ ./node_modules/.bin/simple_client -e "opc.tcp://opcuademo.sterfive.com:26543"
```


## Minimum nodejs requirement
## Minimum Nodejs requirement

* nodejs version 14 or above
* Nodejs version 18 or above

## tutorials and guided examples


[![The Book](https://img.shields.io/static/v1?label=the%20book&message=NodeOPCUA%20by%20example&color=blueviolet&logo=leanpub)](https://leanpub.com/node-opcuabyexample-edition2022). This book provides a large number of practical and ready-to-use and fully documented examples. It's the best starting point to learn about node-opcua.
[![The Book](https://img.shields.io/static/v1?label=the%20book&message=NodeOPCUA%20by%20example&color=blueviolet&logo=leanpub)](https://leanpub.com/node-opcuabyexample-edition2024). This book provides a large number of practical and ready-to-use and fully documented examples. It's the best starting point to learn about node-opcua.

## Sponsors & Backers

The funding of node-opcua enterily relies on its users.
The funding of node-opcua entirely relies on its users.
We appreciate that, once you have evaluated the software and you have decided to use it in one of your applications, you consider supporting our effort by either financially contributing to one of our sponsor programs:

- https://github.com/sponsors/node-opcua
Expand All @@ -80,7 +86,7 @@ Grants ensure the following:

- 🔨 Long-term maintenance of the project
- ⚙️ maintain the website and continuous integration platform
- 🛣 Progress on the road-map
- 🛣 Progress on the road map
- 🐛 Quick responses to bug reports
- 🚀 New features & enhancements
- ⚖️ representing the node-opcua user community at the OPC Foundation
Expand Down Expand Up @@ -177,7 +183,7 @@ Those are the items we would like to achieve in the next version of the API.
* [create a server](https://github.com/node-opcua/node-opcua/blob/master/documentation/creating_a_server.md)
* [create a client in typescript](https://github.com/node-opcua/node-opcua/blob/master/documentation/creating_a_client_typescript.md)

* more tutorials are available in the book (https://leanpub.com/node-opcuabyexample-edition2022)
* more tutorials are available in the book (https://leanpub.com/node-opcuabyexample-edition2024)
* more advanced examples and training material are available for the NodeOPCUA Subscription members at (https://support.sterfive.com)

### API reference
Expand Down Expand Up @@ -318,18 +324,19 @@ Those are the items we would like to achieve in the next version of the API.

## About licensing

The node-opcua core module is [copyrighted and licenced under the term of the "The MIT License"](./LICENSE).
The node-opcua core module is [copyrighted and licencsd under the term of the "The MIT License"](./LICENSE).

This means that :

- node-opcua comes without any warranty of any kind.
- you can freely reuse in an open-source application or a commercial application
- you have to clearly include the software copyright notice in all copies or substantial portions of the software.
- you can freely re-use in an open-source application or a commercial application
- you have to include the software copyright notice in all copies or substantial portions of the software.

You are strongly encourage to apply to our [NodeOPCUA Membership](https://support.sterfive.com) to get additional benefits and support.
You are strongly encouraged to apply to our [NodeOPCUA Membership](https://support.sterfive.com) to get additional benefits and support.


## Copyright

Copyright (c) 2022-2023 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)

Copyright (c) 2022-2024 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)
Copyright (c) 2014-2022 Etienne Rossignon
2 changes: 1 addition & 1 deletion packages/node-opcua-address-space-base/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)
Copyright (c) 2022-2024 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)

Copyright (c) 2014-2022 Etienne Rossignon

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,9 @@ export function reconstructFunctionalGroupType(extraInfo: CloneHelper) {

if (!folder.typeDefinitionObj) continue;

assert(folder.typeDefinitionObj.browseName.name!.toString() === "FunctionalGroupType");
if(folder.typeDefinitionObj.browseName.name!.toString() !== "FunctionalGroupType") {
continue;
}

// now create the same reference with the instantiated function group
const destFolder = info.cloned as BaseNode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)
Copyright (c) 2022-2024 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)

Copyright (c) 2014-2022 Etienne Rossignon

Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-address-space/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)
Copyright (c) 2022-2024 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)

Copyright (c) 2014-2022 Etienne Rossignon

Expand Down
80 changes: 80 additions & 0 deletions packages/node-opcua-address-space/test/test_issue_1277.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import should from "should";
import { DataType } from "node-opcua-variant";
import { nodesets } from "node-opcua-nodesets";

import { AddressSpace } from "..";
import { generateAddressSpace } from "../nodeJS";

function git1277(addressSpace: AddressSpace) {
const namespace = addressSpace.getOwnNamespace();

//PipeFolderType
const pipeFolderType = namespace.addObjectType({
browseName: "PipeFolderType",
subtypeOf: "FolderType"
});

const propertyType = addressSpace.findNode("ns=0;i=68")!;

const size = namespace.addVariable({
browseName: "Size",
organizedBy: pipeFolderType,
typeDefinition: propertyType.nodeId,
dataType: DataType.String,
modellingRule: "Mandatory"
});

const valve = namespace.addVariable({
browseName: "Valve",
organizedBy: pipeFolderType,
typeDefinition: "BaseDataVariableType",
dataType: DataType.Boolean,
modellingRule: "Mandatory"
});

//BoilerType
const boilerType = namespace.addObjectType({
browseName: "BoilerType"
});

const inputPipe = pipeFolderType.instantiate({
browseName: "InputPipe",
modellingRule: "Mandatory",
organizedBy: boilerType
});

const outputPipe = pipeFolderType.instantiate({
browseName: "OutputPipe",
modellingRule: "Mandatory",
organizedBy: boilerType
});

const objectFolder = namespace.addFolder("ObjectsFolder", {
//Folder
browseName: "Devices"
});

const myBoiler = boilerType.instantiate({
browseName: "MyBoiler",
organizedBy: objectFolder
});
return myBoiler;
}

const describe = require("node-opcua-leak-detector").describeWithLeakDetector;

describe("github #1277", () => {
it("should not crash when constructing a ObjectType containing 2 Folders", async () => {
const addressSpace = AddressSpace.create();
await generateAddressSpace(addressSpace, [nodesets.standard]);
addressSpace.registerNamespace("Private");
try {
git1277(addressSpace);
} catch (err) {
console.log(err);
should.not.exist(err, "Expecting no error here " + (err as Error).message);
} finally {
addressSpace.dispose();
}
});
});
2 changes: 1 addition & 1 deletion packages/node-opcua-aggregates/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)
Copyright (c) 2022-2024 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)

Copyright (c) 2014-2022 Etienne Rossignon

Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-alarm-condition/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)
Copyright (c) 2022-2024 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)

Copyright (c) 2014-2022 Etienne Rossignon

Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-assert/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)
Copyright (c) 2022-2024 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)

Copyright (c) 2014-2022 Etienne Rossignon

Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-basic-types/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)
Copyright (c) 2022-2024 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)

Copyright (c) 2014-2022 Etienne Rossignon

Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-benchmarker/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)
Copyright (c) 2022-2024 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)

Copyright (c) 2014-2022 Etienne Rossignon

Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-binary-stream/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)
Copyright (c) 2022-2024 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)

Copyright (c) 2014-2022 Etienne Rossignon

Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-buffer-utils/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)
Copyright (c) 2022-2024 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)

Copyright (c) 2014-2022 Etienne Rossignon

Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-certificate-manager/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)
Copyright (c) 2022-2024 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)

Copyright (c) 2014-2022 Etienne Rossignon

Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-chunkmanager/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)
Copyright (c) 2022-2024 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)

Copyright (c) 2014-2022 Etienne Rossignon

Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-chunkmanager/source/chunk_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export class ChunkManager extends EventEmitter {

public evaluateTotalLengthAndChunks(bodySize: number): { totalLength: number; chunkCount: number } {
const chunkCount = Math.ceil(bodySize / this.maxBodySize);
const totalLength = this.chunkSize + chunkCount;
const totalLength = this.chunkSize * chunkCount;
return { totalLength, chunkCount };
}

Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-client-crawler/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)
Copyright (c) 2022-2024 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)

Copyright (c) 2014-2022 Etienne Rossignon

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)
Copyright (c) 2022-2024 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)

Copyright (c) 2014-2022 Etienne Rossignon

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export async function _findEncodings(session: ISessionForBrowseAll, dataTypeNode
const nodeToBrowse: BrowseDescriptionLike = {
browseDirection: BrowseDirection.Forward,
includeSubtypes: true,
nodeClassMask: makeNodeClassMask("Object"),
// strictly speaking HasEncoding points to an Object of DataTypeEncodingType, but
// in some buggy server implementations ObjectType is used instead. (see #1232)
nodeClassMask: makeNodeClassMask("Object | ObjectType"),
nodeId: dataTypeNodeId,
referenceTypeId: resolveNodeId("HasEncoding"),
resultMask: makeResultMask("ReferenceType | IsForward | BrowseName | NodeClass | TypeDefinition")
Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-client-proxy/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)
Copyright (c) 2022-2024 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)

Copyright (c) 2014-2022 Etienne Rossignon

Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-client/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)
Copyright (c) 2022-2024 Sterfive SAS - 833264583 RCS ORLEANS - France (https://www.sterfive.com)

Copyright (c) 2014-2022 Etienne Rossignon

Expand Down
Loading

0 comments on commit 5efa781

Please sign in to comment.