Dive into secure and efficient coding practices with our curated list of the top 10 examples showcasing 'node-opcua-extension-object' in functional components in JavaScript. Our advanced machine learning engine meticulously scans each line of code, cross-referencing millions of open source libraries to ensure your implementation is not just functional, but also robust and secure. Elevate your React applications to new heights by mastering the art of handling side effects, API calls, and asynchronous operations with confidence and precision.
"use strict";
const DiagnosticInfo = require("node-opcua-data-model").DiagnosticInfo;
const ExtensionObject = require("node-opcua-extension-object").ExtensionObject;
// OPC Unified Architecture, Part 4 $7.27 page 139
const ResponseHeader_Schema = {
name: "ResponseHeader",
fields: [
// The time the Server sent the response.
{ name: "timestamp", fieldType: "UtcTime", defaultValue: function () {
return new Date();
} },
// The requestHandle given by the Client to the request.
{ name: "requestHandle", fieldType: "IntegerId" },
// OPC UA-defined result of the Service invocation.
{ name: "serviceResult", fieldType: "StatusCode" },
"use strict";
const ExtensionObject = require("node-opcua-extension-object").ExtensionObject;
// OPC Unified Architecture, Part 4 $7.27 page 139
const RequestHeader_Schema = {
name: "RequestHeader",
fields: [
// The secret Session identifier used to verify that the request is associated with
// the Session. The SessionAuthenticationToken type is defined in 7.29.
{ name: "authenticationToken", fieldType: "NodeId" },
// The time the Client sent the request.
{ name: "timestamp", fieldType: "UtcTime", defaultValue: function () {
return new Date();
} },
// A requestHandle associated with the request. This client defined handle can
decodeArrayOrElement(typeDictionary, field, thisAny, stream);
break;
case FieldCategory.enumeration:
case FieldCategory.basic:
decodeArrayOrElement(typeDictionary, field, thisAny, stream, field.schema.decode);
break;
default:
/* istanbul ignore next*/
throw new Error("Invalid category " + field.category + " " + FieldCategory[field.category]);
}
}
}
class DynamicExtensionObject extends ExtensionObject {
public static schema: StructuredTypeSchema = ExtensionObject.schema;
public static possibleFields: string[] = [];
private readonly _typeDictionary: TypeDictionary;
private __schema?: StructuredTypeSchema;
constructor(options: any, schema: StructuredTypeSchema, typeDictionary: TypeDictionary) {
assert(schema, "expecting a schema here ");
assert(typeDictionary, "expecting a typeDic");
super(options);
options = options || {};
this.__schema = schema;
this._typeDictionary = typeDictionary;
check_options_correctness_against_schema(this, this.schema, options);
const generator = require("node-opcua-generator");
const getBuildInType = require("node-opcua-extension-object").ExtensionObject;
const ExtensionObject = require("node-opcua-extension-object").ExtensionObject;
generator.registerObject("AsymmetricAlgorithmSecurityHeader");
generator.registerObject("SymmetricAlgorithmSecurityHeader");
generator.registerObject("SequenceHeader");
generator.registerObject("ErrorMessage");
//xx generator.registerObject("DiagnosticInfo");
generator.registerObject("RequestHeader");
generator.registerObject("ResponseHeader");
generator.registerObject("ChannelSecurityToken");
generator.registerObject("SignatureData");
"use strict";
require("node-opcua-extension-object");
require("node-opcua-service-secure-channel");
const ExtensionObject = require("node-opcua-extension-object").ExtensionObject;
const ActivateSessionRequest_Schema = {
documentation: "Activates a session with the server.",
name: "ActivateSessionRequest",
fields: [
{ name:"requestHeader", fieldType:"RequestHeader", documentation:"A standard header included in all requests sent to a server." },
{ name:"clientSignature", fieldType:"SignatureData", documentation:"A signature created with the client certificate from the last server nonce returned by the server." },
{ name:"clientSoftwareCertificates", isArray:true, fieldType:"SignedSoftwareCertificate", documentation:"The software certificates owned by the client." },
{ name:"localeIds", isArray:true, fieldType:"LocaleId", documentation:"The locales to use with the session." },
{ name:"userIdentityToken", fieldType:"ExtensionObject", documentation:"The user identity to use with the session."},
{ name:"userTokenSignature", fieldType:"SignatureData", documentation:"A digital signature created with the user identity token."}
]
};
exports.ActivateSessionRequest_Schema = ActivateSessionRequest_Schema;
const generator = require("node-opcua-generator");
const getBuildInType = require("node-opcua-extension-object").ExtensionObject;
const ExtensionObject = require("node-opcua-extension-object").ExtensionObject;
generator.registerObject("AsymmetricAlgorithmSecurityHeader");
generator.registerObject("SymmetricAlgorithmSecurityHeader");
generator.registerObject("SequenceHeader");
generator.registerObject("ErrorMessage");
//xx generator.registerObject("DiagnosticInfo");
generator.registerObject("RequestHeader");
generator.registerObject("ResponseHeader");
generator.registerObject("ChannelSecurityToken");
generator.registerObject("SignatureData");
generator.registerObject("OpenSecureChannelRequest");