How to use node-opcua-extension-object - 6 common examples

To help you get started, we’ve selected a few node-opcua-extension-object examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-opcua / node-opcua / packages / node-opcua-service-secure-channel / schemas / deprecated_ResponseHeader_schema.js View on Github external
"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"                 },
github node-opcua / node-opcua / packages / node-opcua-service-secure-channel / schemas / deprecated_RequestHeader_schema.js View on Github external
"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
github node-opcua / node-opcua / packages / node-opcua-schemas / source / dynamic_extension_object.ts View on Github external
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);
github node-opcua / node-opcua / packages / node-opcua-service-secure-channel / deprecated_generate.js View on Github external
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");
github node-opcua / node-opcua / packages / node-opcua-service-session / schemas / ActivateSessionRequest_schema.js View on Github external
"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;
github node-opcua / node-opcua / packages / node-opcua-service-secure-channel / deprecated_generate.js View on Github external
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");

node-opcua-extension-object

pure nodejs OPCUA SDK - module extension-object

MIT
Latest version published 2 months ago

Package Health Score

86 / 100
Full package analysis