Reads a single node's value.
Reads a single node's value.
Writes a single node's value.
Calls an OPC-UA method on the server.
Calls a server script on the server.
Creates a new Node on the server.
Adds references to a node.
The path to the project's configuration file.
The current project's configuration, with overrides (through ATSCM_PROJECT__
env vars) already handled.
static get | host | The atvise server's host. Can be overridden with the |
---|---|---|
static get | port | The atvise server ports to use. |
static get | login | The login to use. Return false if no login is required (default). |
static get | sourceNodeRegExp | A regular expression matching all source nodes. |
static get | ignoredNodesRegExp | A regular expression matching all ignored nodes. |
static | isExternal(id) | Returns |
static get | timeout | The connection timeout, in milliseconds. Can be overridden with the |
The action run when running "atscm init".
static | filesToHandle(langId) | Returns the globs of the processed files for the given config lanugage. |
---|---|---|
static | run(options) | Runs the task with the given options. |
A map providing dirnames for config langs
Options available for the "atscm init" command.
{@link InitOptions}, exported as an array. Required to run {@link Inquirer}.
A static class containing validators for the options used when running "atscm init".
static | name(value) | Validates a project name to be a valid npm package name. |
---|
Returns a buffer containing a {@link node-opcua~Variant}s encoded value.
Returns a {@link node-opcua~Variant} from a Buffer with the given dataType and arrayType.
An atscm project's configuration.
static get | host | The atvise-server's host. Defaults to localhost. |
---|---|---|
static get | port | The atvise-server ports to use. |
static get | login | The login to use. Return |
static get | xmlTransformerOptions | |
static get | useTransformers | The transformers to use in this project. Returns a {@link DisplayTransformer}, a {@link ScriptTransformer} and a {@link NewlinesTransformer} by default. |
static get | nodes | The atvise-server nodes that atscm should sync. Defaults to the nodes AGENT, SYSTEM, ObjectTypes.PROJECT* and VariableTypes.PROJECT. |
static get | nodesToWatch | The atvise-server nodes to watch in the corresponding tasks. Defaults to all nodes containing displays. |
static get | EditorRelatedNodes | An array of editor related node ids. They should be ignored in a atscm project. |
static get | ServerRelatedNodes | An array of server related node ids. They should be ignored in a atscm project as they are read-only. |
static get | AtscmRelatedNodes | Server nodes atscm manages itself. These include the serverscripts used during pull/push for example. |
static get | ignoreNodes | These nodes (and their subnodes, if any) will be ignored by atscm. Defaults to {@link Atviseproject.EditorRelatedNodes} combined with {@link Atviseproject.ServerRelatedNodes}. |
static | inspect() | Returns an object containing the properties to inspect. |
static get | vcs | The version control system to optimize tasks for. |
static get | preserveSortOrderNodes | If atvise builder sort order nodes should be stored. |
static get | timeout | The connection timeout, in milliseconds. |
static get | removeBuilderRefs | Remove |
static get | sortXMLAttributes | Sort XML attributes to minimize diffs between pulls. This will eventually default to true in a future atscm version. |
A stream that imports xml files in parallel.
get | methodId | Id of the |
---|---|---|
inputArguments(file) | Returns the arguments the | |
processErrorMessage(file) | Returns an error message specifically for the given file. | |
handleOutputArguments(file, outputArguments, callback) | Checks if the import succeeded and calls |
A stream that transforms read {@link ReadStream.ReadResult}s and stores the on the filesystem.
constructor(readStream) | Creates a new PullStream based on a stream that writes {@link ReadStream.ReadResult} which may be an instance of {@link ReadStream}. |
---|
A stream that transforms read {@link vinyl~File}s and pushes them to atvise server.
constructor(srcStream) | Creates a new PushSteam based on a source file stream. |
---|
Relative path to the rename file.
A stream that writes {@link Node}s to the file system.
constructor(options, options.path, options.base, options.cleanRenameConfig) | Creates a new WriteStream. | |
---|---|---|
get | isDestroyed | If the stream is destroyed. |
writeAsync(node) | ||
writeRenamefile() | Writes the updated rename config to disk. |
Creates a new {@link WriteStream} to write to path.
A node returned by the {@link SourceStream}.
valueSoFar | The node's value (may be incomplete, use {@link FileNode#value} to ensure). | |
---|---|---|
specialId | The id stored in the definition file | |
setRawValue(value) | ||
hasRawValue() | ||
get | stringValue | A node's raw value, decoded into a string. |
valueIsComplete() | ||
get | variantValue | A node's {@link node-opcua~Variant} value. |
get | value |
Returns true
for definition file paths.
Browses the local file system for nodes.
constructor(options, options.handleNode, options.readNodeFile) | Sets up a new browser. | |
---|---|---|
get | atserverVersion | |
browse(path, options) | Starts the browser at the given path. | |
processPath(options) | Enqueues a {@link SourceBrowser#_processPath} call with the given options. | |
readNode(undefined) | Can be called by transformers to read this path before finishing it's parent nodes. |
Starts a new source browser at the given path.
Switches keys and values in an object. E.G.: { "a": 1 } becomes { 1: "a" }.
Picks some properties from an object and returns a new object containing these.
Returns a promise that resolves after the given duration.
Wraps a function with an async callback in a promise.
Prints the progress of a task.
Sorts the given references before they are persisted to disk.
Adds additional infomation to the error's message and rethows it.
Closes open sessions once a task is complete.
An option the "atscm init" command handles. TODO: Support function values for name, message, default, choices...
constructor(messageOrOptions, messageOrOptions.type, messageOrOptions.message, messageOrOptions.default, messageOrOptions.validate, messageOrOptions.choices, messageOrOptions.when, defaultOrUndefined) | Creates a new option based either on a message and (optionally) a default value or some options. | |
---|---|---|
type | The option's {@link inquirer~PromptType}. Defaults to 'input'. | |
message | The option's message. A '?' sign is added automatically. | |
default | The default value to use. | |
choices | The choices available. Applies to list types only. | |
validate | Validates the user input for this option. | |
when | A function or boolean that indicates weather or not to prompt this option. | |
static get | DefaultType | The default {@link inquirer~PromptType} to use. Equals 'input'. |
References type ids.
Names for references.
The main model class.
addReference(type, id) | Adds a new reference. | |
---|---|---|
constructor(options, options.name, options.parent, options.nodeClass) | Creates a new node. | |
references | The node's references. | |
parent | ||
nodeClass | ||
get | parentResolvesMetadata | If the parent resolves metadata (for example: split transformer source files). |
markAsResolved(key) | ||
isResolved(key) | ||
setReferences(type, ids) | ||
markReferenceAsResolved(name, value) | ||
markAllReferencesAsResolved(name) | ||
hasUnresolvedReference(name) | ||
get | filePath | The node's file path. |
get | nodeId | The node's id. |
get | typeDefinition | The node's type definition if given. |
get | modellingRule | The node's modellingRule if given. |
hasTypeDefinition(typeDefName) | Returns | |
get | hasUnresolvedMetadata |
|
get | metadata | The metadata to store in the node's definition file. |
createChild(undefined) | Creates a new child node. | |
get | dataType | The node's data type. |
get | arrayType | The node's array type. |
get | isVariable | If the node is a variable. |
isVariableNode() | ||
get | isDisplay | If the node is an object display. |
get | isScript | If the node is a serverside script. |
get | isQuickDynamic | If the node is a quickdynamic. |
get | isDisplayScript | If the node is a display script. |
A wrapper around {@link node-opcua~NodeId}.
constructor(typeOrValue, value, namespace) | Creates a new NodeId. Can be called in multiple ways:
| |
---|---|---|
static | fromFilePath(path) | Creates a new NodeId based on a file path. |
get | filePath | The node id's value, encoded to a file path. |
get | parent | The parent node id, or |
isChildOf(parent) | Checks if the node is a child of another. | |
get | browseName | The node id's browsename as string. |
inspect(depth, options) | Returns a string in the format "namespace value" that is printed when inspecting the NodeId using {@link util~inspect}. |
Reverse map of {@link node-opcua~ReferenceTypeId}s.
Special characters in regular expressions.
A regular expression that matches all special characters in regular expressions.
Returns a string with all special regular expression characters escaped.
A stream that adds non-standard references to nodes when pushed.
constructor(options) | Creates a new stream for adding references to pushed nodes. | |
---|---|---|
referencesToAdd(file) | Returns the references that need to be set for a file. | |
dependenciesFor(file) | Returns the referenced nodes that should be processed before the given file. | |
get | scriptId | Id of the CreateNode script added with |
scriptParameters(file) | The options required to add references to the node for the given file. | |
processErrorMessage(file) | Prints an error message telling that adding one or more references failed. | |
handleOutputArguments(file, outArgs, callback) | Handles the results of a script call. |
A map providing shorter extensions for data types
A map providing data types for shorter extensions (Reverse of {@link DataTypeForExtension}).
An extension to {@link vinyl~File} providing some additional, atvise-related properties.
static | pathForReadResult(readResult) | Returns a storage path for a {@link ReadStream.ReadResult}. |
---|---|---|
static | encodeValue(value, dataType, arrayType) | Encodes a node's value to file contents. |
static | decodeValue(buffer, dataType, arrayType) | Decodes a file's contents to a node's value. |
static | normalizeMtime(date) | As file mtimes do not support millisecond resolution these must be removed before storing files. |
static | fromReadResult(readResult) | Creates a new {@link AtviseFile} for the given {@link ReadStream.ReadResult}. |
getMetadata() | Computes a file's metadata if needed. | |
get | nodeClass | The node's class. |
get | dataType | The file's {@link node-opcua~DataType}. |
get | arrayType | The file's {@link node-opcua~VariantArrayType}. |
get | references | The files's references. |
get | typeDefinition | The file's type definition. |
get | isReferenceConfig |
|
get | isDisplay |
|
get | isScript |
|
get | isQuickDynamic |
|
get | value | Returns the decoded node value for the file. |
contents | The file's contents. | |
get | createNodeValue | Returns the decoded node value for create node serverscript. |
get | nodeId | Returns the node id associated with the file. |
get | name | A file's browse and display name. |
get | parentNodeId | A file's parent's node id. |
clone(options) | Returns a new file with all attributes of the current file. | |
static | read(options) | Creates a new AtviseFile and reads it's contents. |
A stream that creates OPC-UA nodes for the passed {@link AtviseFiles}s.
get | scriptId | Id of the CreateNode script added with |
---|---|---|
scriptParameters(file) | The options required to create a node for the given file. | |
processErrorMessage(file) | Prints an error message telling that creating a node failed. | |
handleOutputArguments(file, outArgs, callback) | Handles the results of a script call. |
A node discovered while browsing the server's database.
id | The node's id. @type {NodeId} | |
---|---|---|
value | The node's value | |
addReferences(references) | Add multiple references at once. | |
createChild(options) | Creates new child node. |
Browses the server database.
constructor(options, options.concurrency, options.handleNode, options.recursive) | Creates a new node browser. | |
---|---|---|
queue | The queue used to process nodes in parallel | |
parentNode | A map that maps node ids against their discovered hierarchical parent nodes. Used to detect reference conflicts. | |
ensureHandled | ||
addNode(node) | Instructs the browser to handle a node that would otherwise be queued behind others (eg: its parent node). | |
browse(nodeIds) | Starts the browser of the given nodes. |
A stream of server nodes.
constructor(nodesToBrowse, options, options.recursive, options.ignoreNodes) | Creates new node stream. | |
---|---|---|
recursive | If the discovered nodes should be browsed as well. | |
get | isDestroyed | If the stream is destoyed. |
get | processed | The number of processed nodes. |
get | opsPerSecond | The number of processed chunks per second. |
A stream that process atvise server requests in parallel.
constructor(options, options.maxParallel) | Creates a new QueueStream with the given options. | |
---|---|---|
get | hasPending |
|
get | queueEmpty |
|
get | processed | The number of chunks already processed. |
get | opsPerSecond | The number of processed chunks per second. |
processErrorMessage(chunk) | The error message to use when processing a chunk fails. Must be overridden by all subclasses!. | |
processChunk(chunk, handleErrors) | The function to call when a chunk is ready to be processed. Must be overridden by all subclasses.. |
A wrapper around {@link node-opcua~ClientSession} used to connect to atvise server. The sessions currentyl being opened.
static | create() | Creates an {@link node-opcuaOPCUAClient} and opens a new {@link node-opcua~ClientSession}. If pooling is active, the shared session will be reused. |
---|---|---|
static | pool() | Starts pooling (reusing) sessions. Note that you'll have to manually close sessions using {@link Session.closeOpen}. |
static | close(session) | Closes the given session. When session pooling is active the session won't actually be closed and the returned Promise will resolve immediately. |
static get | open | The sessions currently open. Starting with version 1.0.0-beta.25 there will be one at most. |
static | closeOpen() | Closes all open sessions. |
An object transform stream connected to atvise server.
constructor(options, options.keepSessionAlive) | Creates a new Stream and starts opening a new session to atvise server. |
---|
An atvise-related resource type.
constructor(name, identifier) | Creates a new resource type. |
---|
The atvise types to handle. Ordering matters: The {@link MappingTransformer} takes the first match, therefore plain types should always come before resource types!
A mixin that transforms a regular stream into a {@link WaitingStream}, which makes it wait for a node's dependencies to be transformed.
A {@link QueueStream} that waits for a file's dependencies to be processed before the file is processed itself.
Watches the given nodes for value changes.
constructor(nodes) | Creates a new Watcher with the given nodes. | |
---|---|---|
subscriptionStarted | Resolved once the server subscription is set up. | |
close() | Ends monitoring nodes. |
A stream that writes all read {@link AtviseFile}s to their corresponding nodes on atvise server. The underlying {@link TreeStream} ensures the nodes are processed in an order that respects the parent-child relations between nodes. Nodes are created (if needed) before their children are processed.
constructor(createStream, addReferencesStream, options) | Creates a new write stream with the given {@link CreateNodeStream} and {@link AddReferencesStream}. Implementer have to ensure this create stream is actually piped. | |
---|---|---|
processErrorMessage(file) | The error message to use when writing a file fails. | |
dependenciesFor(file) | Returns a files parent node and type definition. | |
processChunk(file, handleErrors) | Writes an {@link AtviseFile} to it's corresponding node on atvise server. |
A stream that calls an OPC-UA method for all input files.
get | methodId | Must be implemented in all subclasses: The {@link NodeId} of the method to call. |
---|---|---|
get | methodBaseId | The {@link NodeId} of the object from which the method should get called. Defaults to the value of {@link NodeId#parent} of {@link CallMethodStream#methodId}. |
inputArguments(file) | The input arguments the method should be called with for a file. Needs to be overridden by subclasses in most cases. Returning | |
callRequest(file) | Creates a call method request object for a file. | |
handleOutputArguments(file, outputArgs, callback) | Must be implemented by all subclasses: If the method call returns a status code of {@link node-opcua~StatusCodes}.Good, this method decides if the output matches the expected results. | |
processErrorMessage(file) | Returns an error message specifically for the given file. | |
processChunk(file, handleErrors) | Performs an opcua method call for the given file. |
A stream that calls atvise server scripts for all passed nodes.
get | methodId | The id of the callScript method. |
---|---|---|
get | scriptId | Must be implemented by all subclasses: The id of the script to call. |
get | scriptBaseId | Id of the script's base object. |
scriptParameters(file) | Returns the parameters to call the script with for the given file. | |
inputArguments(file) | Creates the raw method input arguments for the given file. | |
processErrorMessage(file) | Returns the error message logged if running the script fails. | |
processChunk(file, handleErrors) | Calls the script specified in {@link CallScriptStream#scriptId}. If the script does not exist but could be imported by running |
The node containing the currently installed server-scripts version.
nonEmptyConfig(input) | Returns an object containing all non-empty properties of the input object. Returns null if no properties are non-empty. | |
---|---|---|
writeConfigFile(config, node, context) | Writes the config file to disk if needed. |
A transformer that transforms only some of the files read.
shouldBeTransformed(file) |
|
---|
A transformer that splits a node into multiple source nodes when pulling.
static get | extension | The extension to add to container node names when they are pulled. |
---|---|---|
static get | sourceExtensions | The source file extensions to allow. |
static | splitFile(node, newExtension) | Splits a {@link Node}: The resulting is a clone of the input file, with a different path. |
transformFromDB(node, context) | Renames a container node, should be called by all subclasses. | |
readNodeFile(node) | Returns | |
combineNodes(node, sourceNodes, context) | Combines the container node and the source nodes to one single node. | |
transformFromFilesystem(node, context) | Reads a given container nodes source nodes and combines them. |
The directions a transformer can be run in.
The base transformer class.
static | combinedTransformer(transformers, direction) | Returns a function that combines multiple transformer actions. |
---|---|---|
constructor(options, options.direction) | Creates a new Transformer with the specified options. | |
direction | ||
withDirection(direction) | Returns the Transformer with the given direction. | |
readNodeFile(node) | Determines if a node's value node should be read, e.G. The Variable.Bool file for a node defined in .Variable.Bool.Json. | |
transformFromDB(node, context) | Must be overridden by all subclasses: Transforms the given node when using {@link TransformDirection.FromDB}. | |
transformFromFilesystem(node, context) | Must be overridden by all subclasses: Transforms the given node when using {@link TransformDirection.FromFilesystem}. | |
compatTransform(direction, node, context) | A transform wrapper that works with both async/await (atscm >= 1) and callback-based (atscm < 1)transformers. |
A transformer used to transform XML documents.
constructor(options) | Creates a new XMLTransformer based on some options. | |
---|---|---|
get | builder | Returns the XML builder to use based on the current {@link Transformer#direction}. |
decodeContents(node) | Parses XML in a node's contents. | |
encodeContents(object) | Builds an XML string from an object. |
Imports all xml files needed for atscm usage.
Pulls the given nodes from the server.
Pulls all nodes from atvise server.
Pushes the given path to the server.
Pushes {@link AtviseFile}s to atvise server.
The task executed when running atscm watch
.
constructor | Creates a new watch task instance. Also creates a new Browsersync instance. | |
---|---|---|
browserSyncInstance | The Browsersync instance used. | |
get | directoryToWatch | The directory to watch. |
startFileWatcher() | Starts a file watcher for the directory {@link WatchTask#directoryToWatch}. | |
startServerWatcher() | Starts a watcher that watches the atvise server for changes. | |
initBrowserSync(options) | Initializes {@link WatchTask#browserSyncInstance}. | |
printTaskError(contextMessage, err) | Prints an error that happened while handling a change. | |
handleFileChange(path, root) | Handles a file change. | |
handleServerChange(readResult) | Handles an atvise server change. | |
run(options, options.open) | Starts the file and server watchers, initializes Browsersync and registers change event handlers. |
The gulp task invoced when running atscm watch
.
A transformer ensuring no invalid alarm condition filter nodes are pulled.
shouldBeTransformed(node) | Returns | |
---|---|---|
transformFromDB(node, undefined) | Removes filter alarm condition filter nodes that have an invalid dataType. | |
transformFromFilesystem() | Does nothing. |
A Transformer that maps {@link ReadStream.ReadResult}s to {@link AtviseFile}s.
constructor(options) | Creates a new mapping transformer. | |
---|---|---|
transformFromDB(node, encoding, callback) | Writes an {@link AtviseFile} for each {@link ReadStream.ReadResult} read. If a read file has a non-standard type (definition) an additional | |
transformFromFilesystem(node, encoding, callback) | Writes an {@link AtviseFile} for each {@link Node} read. | |
get | transformsReferenceConfigFiles |
|
A transformer that handles newline characters in files. During a pull, all breaks are converted the OS-native EOL character and (optionally) a trailing newline is added (for better git diffs). On push, CRLF characters are used and those trailing newlines are removed again.
constructor(options, options.trailingNewlines) | Creates a new newline transformer. | |
---|---|---|
shouldBeTransformed(file) | Returns | |
transformFromDB(file, enc, callback) | Adds converts line breaks to the current OS's native EOL characters and adds trailing newlines. | |
transformFromFilesystem(file, enc, callback) | Removes trailing newlines and converts all breaks to CRLF. | |
get | transformsReferenceConfigFiles |
|
Cleans up after the app ended with the specified code or signal.
Returns the {@link fs~Stats} for a path.
Checks it a given path holds a directory and returns it's {@link fs~Stats} if found.