const { irissdk } = require('./import_irissdk.js')
const { createConnection } = require('./iris_native.js')
const { Callback } = require('./callback.js')
const Decimal = require('decimal.js').Decimal
// register the node callback
irissdk.registerCallback(Callback.execute)
irissdk.addDecimalSupport(Decimal)
// classes
module.exports.Iris = require('./iris.js').Iris
module.exports.Iterator = require('./iris_iterator.js').IRISIterator
module.exports.IRISGlobalNode = require('./iris_global_node.js').IRISGlobalNode
module.exports.IRISList = irissdk.IRISList
module.exports.IRISReference = irissdk.IRISReference
module.exports.Connection = irissdk.Connection
module.exports.IRISObject = irissdk.IRISObject
// This can be moved to gtw.js
module.exports.GatewayUtility = require('./gateway_utility.js').GatewayUtility
// functions
module.exports.createConnection = createConnection
module.exports.connect = createConnection
/**************************************************************************************************
* *
* Node.js IRIS native API DOCUMENTATION *
* *
**************************************************************************************************/
/**
* The InterSystems IRIS Native API Module.
* @module "intersystems-iris"
* @tutorial quick_start
*/
// >>>>>>>>>>>>>>>> Functions <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
/**
* An IRIS Native function to establish a connection to an InterSystems IRIS Server instance.
* This method returns an instance of [Connection]{@link module:"intersystems-iris".Connection}
* class.
* @function module:"intersystems-iris".createConnection
* @param {connectionInfo} connectionInfo - Object containing connection arguments host, port,
* namespace, user, password, logfile and sharedmemory
* @param {onConnectionCallback} [callback] - A callback to call when the connection is established.
* When provided, the createConnection becomes asynchronous.
* @returns {module:"intersystems-iris".Connection}
* @throws If invalid hostname (length 0 or above 255)
* @throws If invalid port number (port < 0 || port > 65536)
* @throws If invalid namespace (length 0 or above 255)
* @throws If timeout < 0
* @throws If logfile length > 255
* @throws If sslconfig file length > 255
* @throws If it failed to connect to server
* @throws If it failed to send a message to the server
* @throws If server protocol is below 61 (min version)
* @throws If unsupported server locale
* @thorws If invalid message was received (passphrase errors)
* @throws If access is denied
*/
/**
* Function alias for [createConnection]{@link module:"intersystems-iris".createConnection} class.
* @function module:"intersystems-iris".connect
* @param {connectionInfo} connectionInfo - Object containing connection arguments host, port,
* namespace, user, password, logfile and sharedmemory
* @param {onConnectionCallback} [callback] - A callback to call when the connection is established.
* When provided, the createConnection becomes asynchronous.
* @returns {module:"intersystems-iris".Connection}
* @throws If invalid hostname (length 0 or above 255)
* @throws If invalid port number (port < 0 || port > 65536)
* @throws If invalid namespace (length 0 or above 255)
* @throws If timeout < 0
* @throws If logfile length > 255
* @throws If sslconfig file length > 255
* @throws If it failed to connect to server
* @throws If it failed to send a message to the server
* @throws If server protocol is below 61 (min version)
* @throws If unsupported server locale
* @thorws If invalid message was received (passphrase errors)
* @throws If access is denied
*/
// >>>>>>>>>>>>>>>> Typedefs <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
/**
* Callback called when a connection to the IRIS instance is established.
* @callback onConnectionCallback
* @param {Error} error
* @param {module:"intersystems-iris".Connection} connection
*/
/**
* The object that describes a connection and is passed as an argument to
* [createConnection]{@link module:"intersystems-iris".createConnection} function.
* @typedef {Object} connectionInfo
* @property {string} host - the host address of the IRIS instance
* @property {integer} port - the port number of the IRIS instance
* @property {string} ns - the IRIS Namespace
* @property {string} user - user name
* @property {string} pwd - password
* @property {string} logfile - the logging file of the communication with the IRIS instance
* @property {integer} timeout - connection timeout (seconds)
* @property {boolean} sharedmemory - use shared memory if available, default is true
* @property {boolean|string} sslconfig - whether or not to establish this connection
* with an ssl context, default is false. If a string provided then this is the name of the ssl
* configuration to use for the secure connection from the ones defined in SSLDefs.ini (Unix only)
*/
// >>>>>>>>>>>>>>>> Connection <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
/**
* @classdesc A connection to an IRIS instance.
* Create one by calling the [createConnection]{@link module:"intersystems-iris".createConnection}.
* The host, port, namespace, timeout and logfile from the last successfull connection attempt are
* saved as readonly properties of the connection object.
* @class Connection
* @memberof module:"intersystems-iris"
* @hideconstructor
*/
/**
* Checks whether the connection is closed.
* @function isClosed
* @memberof module:"intersystems-iris".Connection
* @returns {boolean} true if connection is closed, false otherwise
* @instance
*/
/**
* Checks whether the connection is open and is using shared memory.
* @function isUsingSharedMemory
* @memberof module:"intersystems-iris".Connection
* @returns {boolean} true if the connection has an open shared memory connection, false otherwise.
* @instance
*/
/**
* Closes the connection to the IRIS instance, if open.
* @function close
* @memberof module:"intersystems-iris".Connection
* @instance
*/
/**
* Returns a string representation of the connection.
* @function toString
* @returns {string} the string representation of the connection
* or "Not connected yet" if a connection has not been established
* @memberof module:"intersystems-iris".Connection
* @instance
*/
/**
* Creates an instance of the [Iris]{@link module:"intersystems-iris".Iris} class.
* @function createIris
* @returns {module:"intersystems-iris".Iris} An instance of
* [Iris]{@link module:"intersystems-iris".Iris}.
* @memberof module:"intersystems-iris".Connection
* @instance
* @tutorial intro
* @throws If connection if closed (No Iris on closed connection)
*/
/**
* The hostname of the IRIS instance the connection is connected to.
* @member {string} hostname
* @memberof module:"intersystems-iris".Connection
* @readonly
* @instance
*/
/**
* The port of the IRIS instance the connection is connected to.
* @member {number} port
* @memberof module:"intersystems-iris".Connection
* @readonly
* @instance
*/
/**
* The IRIS instance namespace the connection is connected to.
* @member {string} namespace
* @memberof module:"intersystems-iris".Connection
* @readonly
* @instance
*/
/**
* The timeout in milliseconds of the connection.
* @member {number} timeout
* @memberof module:"intersystems-iris".Connection
* @default 10000
* @readonly
* @instance
*/
/**
* A boolean that indicates whether the connection is connected to the IRIS instance using shared
* memory.
* This value should be equal to the return value of
* [isUsingSharedMemory]{@link module:"intersystems-iris".Connection#isUsingSharedMemory}
* @member {boolean} sharedmemory
* @memberof module:"intersystems-iris".Connection
* @default false
* @readonly
* @instance
*/
/**
* The logging file of the communication with the IRIS instance.
* If it starts with "+" any existing file with the same name gets truncated.
* If it starts with "-" the logging is skipped.
* @member {string} logfile
* @memberof module:"intersystems-iris".Connection
* @default "-"
* @readonly
* @instance
*/
// >>>>>>>>>>>>>>>> Iris <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
/**
* @classdesc A way to execute basic ObjectScript commands on an IRIS server instance.
* This class has methods to work with globals and to call class methods and routines.
* Any errors on the server generate Node.js Errors.
* @class Iris
* @memberof module:"intersystems-iris"
* @hideconstructor
*/
/**
* @constructs Iris
* @memberof module:"intersystems-iris".Iris
* @param {module:"intersystems-iris".Connection} connection
*/
/**
* Get the IRIS Server's version string.
* @function getServerVersion
* @memberof module:"intersystems-iris".Iris
* @returns {string}
* @throws exception
* @instance
*/
/**
* Get the API version string as major.minor.patch
* @function getAPIVersion
* @memberof module:"intersystems-iris".Iris
* @returns {string}
* @instance
*/
/**
* Gets the value of a global array node, returns null if the node is not defined.
* @function get
* @memberof module:"intersystems-iris".Iris
* @param {string} globalName - the name of the global array
* @param {...any} subscript - variable number of subscript values
* @returns {null|Buffer|external:"decimal.js".Decimal|number|string} - null if node not defined,
* else any of the Buffer, string, number and Decimal.
* @instance
* @tutorial intro
* @throws If wrong number of arguments (at least 1)
*/
/**
* Gets the value of a global array node, returns null if the node is not defined.
* @function getObject
* @memberof module:"intersystems-iris".Iris
* @param {string} globalName - the name of the global array
* @param {...any} subscript - variable number of subscript values
* @returns {null|Buffer|external:"decimal.js".Decimal|number|string} - null if node not defined,
* else any of the Buffer, string, number and Decimal.
* @instance
* @tutorial intro
* @throws If wrong number of arguments (at least 1)
*/
/**
* Gets the boolean value of a global array node, returns null if the node is not defined.
* @function getBoolean
* @memberof module:"intersystems-iris".Iris
* @param {string} globalName - the name of the global array
* @param {...any} subscript - variable number of subscript values
* @returns {null|boolean} - null if the node is not defined, else boolean.
* @throws exception
* @instance
* @tutorial intro
* @throws If wrong number of arguments (at least 1)
*/
/**
* Gets the value of a global array node as a Buffer, returns null if the node is not defined.
* @function getBytes
* @memberof module:"intersystems-iris".Iris
* @param {string} globalName - the name of the global array
* @param {...any} subscript - variable number of subscript values
* @returns {null|Buffer} - null if the node is not defined, else Buffer.
* @throws exception
* @instance
* @tutorial intro
* @throws If wrong number of arguments (at least 1)
*/
/**
* Gets the value of a global array node as a Decimal, returns null if the node is not defined.
* @function getDecimal
* @memberof module:"intersystems-iris".Iris
* @param {string} globalName - the name of the global array
* @param {...any} subscript - variable number of subscript values
* @returns {null|external:"decimal.js".Decimal} - null ifthe node is not defined, else Decimal.
* @throws exception
* @instance
* @tutorial intro
* @throws If wrong number of arguments (at least 1)
*/
/**
* Gets the value of a global array node as a floating point number, returns null if the node is
* not defined.
* @function getFloat
* @memberof module:"intersystems-iris".Iris
* @param {string} globalName - the name of the global array
* @param {...any} subscript - variable number of subscript values
* @returns {null|number} - null if the node is not defined, else number.
* @throws exception
* @instance
* @tutorial intro
* @throws If wrong number of arguments (at least 1)
*/
/**
* Gets the value of a global array node as an integer number,
* returns null if the node is not defined.
* @function getInteger
* @memberof module:"intersystems-iris".Iris
* @param {string} globalName - the name of the global array
* @param {...any} subscript - variable number of subscript values
* @returns {null|number} - null if the node is not defined, else number.
* @throws exception
* @instance
* @tutorial intro
* @throws If wrong number of arguments (at least 1)
*/
/**
* Gets the numeric value of a global array node, returns null if the node is not defined.
* @function getNumber
* @memberof module:"intersystems-iris".Iris
* @param {string} globalName - the name of the global array
* @param {...any} subscript - variable number of subscript values
* @returns {null|number} - null if the node is not defined, else number.
* @throws exception
* @instance
* @tutorial intro
* @throws If wrong number of arguments (at least 1)
*/
/**
* Gets the value of a global array node as a string, returns null if the node is not defined.
* @function getString
* @memberof module:"intersystems-iris".Iris
* @param {string} globalName - the name of the global array
* @param {...any} subscript - variable number of subscript values
* @returns {null|string} - null if the node is undefined, else string.
* @throws exception
* @instance
* @tutorial intro
* @throws If wrong number of arguments (at least 1)
*/
/**
* Gets the value of a global array node as an [IRISList]{@link module:"intersystems-iris".IRISList},
* returns null if the node is not defined.
* @function getList
* @memberof module:"intersystems-iris".Iris
* @param {string} globalName - the name of the global array
* @param {...any} subscript - variable number of subscript values
* @returns {null|module:"intersystems-iris".IRISList} - null if the node is not defined,
* else [IRISList]{@link module:"intersystems-iris".IRISList}.
* @throws exception
* @instance
* @tutorial intro
* @throws If wrong number of arguments (at least 1)
*/
/**
* Gets the value of a global array node as an [IRISList]{@link module:"intersystems-iris".IRISList}
* , returns null if the node is not defined.
* Alias of getList
* @function getIRISList
* @memberof module:"intersystems-iris".Iris
* @param {string} globalName - the name of the global array
* @param {...any} subscript - variable number of subscript values
* @returns {null|module:"intersystems-iris".IRISList} - null if the node is not defined,
* else [IRISList]{@link module:"intersystems-iris".IRISList}.
* @throws exception
* @instance
* @tutorial intro
* @throws If wrong number of arguments (at least 1)
*/
/**
* Sets the value of a global array node.
* @function set
* @memberof module:"intersystems-iris".Iris
* @param {string|number|boolean|null|external:"decimal.js".Decima|
* module:"intersystems-iris".IRISList} value - the value to assign to the global array
* @param {string} globalName - the name of the global array
* @param {...any} subscript - variable number of subscript values
* @throws exception
* @instance
* @tutorial global_arrays
* @throws If wrong number of arguments (at least 2)
*/
/**
* Kills a global array node, including any descendants.
* @function kill
* @param {string} globalName - the name of the global array
* @param {...any} subscript - variable number of subscript values
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial global_arrays
* @throws If wrong number of arguments (at least 1)
*/
/**
* Increments the value of a global array node.
* @function increment
* @param {number|external:"decimal.js".Decimal} incrementBy - the amount to increment
* the global array node by
* @param {string} globalName - the name of the global array
* @param {...any} subscript - variable number of subscript values
* @returns {number|external:"decimal.js".Decimal} the new value of the global node.
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial global_arrays
* @throws If wrong number of arguments (at least 2)
*/
/**
* Returns whether a global node contains data and whether it has children.
* This method is similar to $DATA in IRIS.
* @function isDefined
* @param {string} globalName - the name of the global array
* @param {...any} subscript - variable number of subscript values
* @returns {number} - 0 if the global array node is not defined,
* 1 if it is defined and has no subordinate nodes,
* 10 if not defined but has subordinate nodes,
* 11 if defined and has subordinate nodes.
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial global_arrays
* @throws If wrong number of arguments (at least 1)
*/
/**
* Gets the next $order subscript value of a global array node as a string,
* returns null if at the end. This method is similar to $ORDER in IRIS.
* @function nextSubscript
* @memberof module:"intersystems-iris".Iris
* @param {boolean} reversed - if true, reverse $order
* @param {string} globalName - the name of the global array
* @param {...any} subscript - variable number of subscript values
* @returns {null|string} null if the end,
* else the next subscript that is the sibling of the last subscript
* @throws exception
* @instance
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a function in a routine.
* @function function
* @param {string} functionName - the name of the function to invoke
* @param {string} routineName - the name of the routine in which the function is implemented
* @param {...any} argument - zero, one or more arguments to pass to the function
* @returns {any} - the function's return value (null|Buffer|string|number|Decimal)
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a function in a routine.
* @function functionObject
* @param {string} functionName - the name of the function to invoke
* @param {string} routineName - the name of the routine in which the function is implemented
* @param {...any} argument - zero, one or more arguments to pass to the function
* @returns {any} - the function's return value (null|Buffer|string|number|Decimal)
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a function in a routine.
* @function functionBoolean
* @param {string} functionName - the name of the function to invoke
* @param {string} routineName - the name of the routine in which the function is implemented
* @param {...any} argument - zero, one or more arguments to pass to the function
* @returns {boolean} the return value as a boolean
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a function in a routine.
* @function functionBytes
* @param {string} functionName - the name of the function to invoke
* @param {string} routineName - the name of the routine in which the function is implemented
* @param {...any} argument - zero, one or more arguments to pass to the function
* @returns {Buffer} - the return value as Buffer
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a function in a routine.
* @function functionDecimal
* @param {string} functionName - the name of the function to invoke
* @param {string} routineName - the name of the routine in which the function is implemented
* @param {...any} argument - zero, one or more arguments to pass to the function
* @returns {external:"decimal.js".Decimal} the return value as Decimal
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a function in a routine.
* @function functionFloat
* @param {string} functionName - the name of the function to invoke
* @param {string} routineName - the name of the routine in which the function is implemented
* @param {...any} argument - zero, one or more arguments to pass to the function
* @returns {number} the return value as a floating point number
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a function in a routine.
* @function functionInteger
* @param {string} functionName - the name of the function to invoke
* @param {string} routineName - the name of the routine in which the function is implemented
* @param {...any} argument - zero, one or more arguments to pass to the function
* @returns {number} the return value as an integer number
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a function in a routine that returns an
* [IRISList]{@link module:"intersystems-iris".IRISList}.
* @function functionIRISList
* @param {string} functionName - the name of the function to invoke
* @param {string} routineName - the name of the routine in which the function is implemented
* @param {...any} argument - zero, one or more arguments to pass to the function
* @returns {module:"intersystems-iris".IRISList} the return value as an
* [IRISList]{@link module:"intersystems-iris".IRISList}
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a function in a routine.
* @function functionString
* @param {string} functionName - the name of the function to invoke
* @param {string} routineName - the name of the routine in which the function is implemented
* @param {...any} argument - zero, one or more arguments to pass to the function
* @returns {string} the return value as a string
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a procedure (no value is returned) in a routine.
* @function procedure
* @param {string} procedureName - the name of the procedure to invoke
* @param {string} routineName - the name of the routine in which the procedure is implemented
* @param {...any} argument - zero, one or more arguments to pass to the procedure
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a class method that returns a value.
* @function classMethodValue
* @memberof module:"intersystems-iris".Iris
* @param {string} className - the name of the class in which the method is implemented
* @param {string} methodName - the name of the method to call
* @param {...any} argument - arguments to pass to the method, zero one or more.
* @returns {any} - the class method's return value
* @throws exception
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a class method that returns a value.
* @function classMethodObject
* @memberof module:"intersystems-iris".Iris
* @param {string} className - the name of the class in which the method is implemented
* @param {string} methodName - the name of the method to call
* @param {...any} argument - arguments to pass to the method, zero one or more.
* @returns {any} - the class method's return value
* @throws exception
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a class method that returns a value.
* @function classMethodBytes
* @memberof module:"intersystems-iris".Iris
* @param {string} className - the name of the class in which the method is implemented
* @param {string} methodName - the name of the method to call
* @param {...any} argument - arguments to pass to the method, zero one or more.
* @returns {Buffer} the class method's return value as a Buffer
* @throws exception
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a class method that returns a value.
* @function classMethodDecimal
* @memberof module:"intersystems-iris".Iris
* @param {string} className - the name of the class in which the method is implemented
* @param {string} methodName - the name of the method to call
* @param {...any} argument - arguments to pass to the method, zero one or more.
* @returns {external:"decimal.js".Decimal} the class method's return value as a Decimal
* @throws exception
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a class method that returns a value.
* @function classMethodBoolean
* @memberof module:"intersystems-iris".Iris
* @param {string} className - the name of the class in which the method is implemented
* @param {string} methodName - the name of the method to call
* @param {...any} argument - arguments to pass to the method, zero one or more.
* @returns {boolean} the class method's return value as a boolean
* @throws exception
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a class method that returns a value.
* @function classMethodFloat
* @memberof module:"intersystems-iris".Iris
* @param {string} className - the name of the class in which the method is implemented
* @param {string} methodName - the name of the method to call
* @param {...any} argument - arguments to pass to the method, zero one or more.
* @returns {number} the class method's return value as a floating point number
* @throws exception
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a class method that returns a value.
* @function classMethodInteger
* @memberof module:"intersystems-iris".Iris
* @param {string} className - the name of the class in which the method is implemented
* @param {string} methodName - the name of the method to call
* @param {...any} argument - arguments to pass to the method, zero one or more.
* @returns {number} the class method's return value as an integer number
* @throws exception
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a class method that returns a value.
* @function classMethodNumber
* @memberof module:"intersystems-iris".Iris
* @param {string} className - the name of the class in which the method is implemented
* @param {string} methodName - the name of the method to call
* @param {...any} argument - arguments to pass to the method, zero one or more.
* @returns {number} the class method's return value as a number
* @throws exception
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a class method that returns a value.
* @function classMethodIRISList
* @memberof module:"intersystems-iris".Iris
* @param {string} className - the name of the class in which the method is implemented
* @param {string} methodName - the name of the method to call
* @param {...any} argument - arguments to pass to the method, zero one or more.
* @returns {module:"intersystems-iris".IRISList} the class method's return value as an
* [IRISList]{@link module:"intersystems-iris".IRISList}
* @throws exception
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a class method that returns a value.
* @function classMethodString
* @memberof module:"intersystems-iris".Iris
* @param {string} className - the name of the class in which the method is implemented
* @param {string} methodName - the name of the method to call
* @param {...any} argument - arguments to pass to the method, zero one or more.
* @returns {string} the class method's return value as a string
* @throws exception
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Invokes a class method that does not return a value
* @function classMethodVoid
* @param {string} className - the name of the class in which the method is implemented
* @param {string} methodName - the name of the method to call
* @param {...any} argument - zero, one or more arguments to pass to the method.
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial methods_and_functions
* @throws If wrong number of arguments (at least 2)
*/
/**
* Locks a global array node. The lockMode argument specifies whether any previously held locks
* should be released. This method will time out after a predefined interval if the lock cannot
* be acquired.
* NOTE: The lockReference value must begin with '^' to acquire a lock on a global node.
* @function lock
* @param {string} lockType - 'S' for shared lock and 'E' for an escalating lock
* @param {integer} timeout - the number of seconds before the attempt to acquire
* the lock will timeout
* @param {string} lockReference - a leading '^' is required for global array references.
* Note that lock() and unlock() are different from all other functions
* where only a globalName - without the '^' prefix - is required.
* @param {...any} subscript
* @returns {boolean}
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial global_arrays
* @throws If wrong number of arguments (at least 2)
*/
/**
* Releases a previously acquired lock on *lockReference.
* @function unlock
* @param {string} lockMode - a string containing lock type ('S' or 'E') and
* 'I' for an immediate unlock or 'D' for deferred
* @param {string} lockReference - a leading '^' is required for global array references.
* Note that lock() and unlock() are different from all other functions.
* where only a globalName - without the '^' prefix - is required.
* @param {...any} subscript
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial global_arrays
* @throws If wrong number of arguments (at least 2)
*/
/**
* Releases all global array locks held by the connection.
* @function releaseAllLocks
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial global_arrays
*/
/**
* Starts an IRIS transaction.
* @function tStart
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial global_arrays
*/
/**
* Commits one level of the IRIS transaction.
* @function tCommit
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial global_arrays
*/
/**
* Rollbacks all open levels of the IRIS transaction.
* @function tRollback
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial global_arrays
*/
/**
* Rollbacks one level of the transaction.
* @function tRollbackOne
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial global_arrays
*/
/**
* Gets the nesting level of the current IRIS transaction.
* This is equivalent to fetching the value of the $TLEVEL special variable in IRIS.
* @function getTLevel
* @returns {number} - the nesting level of the current IRIS transaction,
* 0 if no transaction is active
* @memberof module:"intersystems-iris".Iris
* @instance
* @tutorial global_arrays
*/
// >>>>>>>>>>>>>>>> IRISObject <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
/**
* @classdesc Class for proxy objects created on behalf of IRIS objects.
* Objects of this class are automatically created when the IRIS instance returns
* the object reference of a created object on the server.
* @class IRISObject
* @memberof module:"intersystems-iris"
* @hideconstructor
*/
/**
* The connection object the IRIS object is using to connect to the IRIS instance.
* @member {module:"intersystems-iris".Connection} connection
* @memberof module:"intersystems-iris".IRISObject
* @instance
*/
/**
* The IRIS object reference (OREF) in the IRIS instance.
* @member {string} oref
* @memberof module:"intersystems-iris".IRISObject
* @instance
*/
/**
* Indicates whether the object is closed.
* @member {boolean} closed
* @readonly
* @memberof module:"intersystems-iris".IRISObject
* @instance
*/
/**
* Retrieves the value of a property of the IRISObject object.
* @function get
* @param {string} propertyName name of a property
* @returns {null|any} null if the property does not exist, else the value of the property
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Retrieves the value of a property of the IRISObject object.
* @function getObject
* @param {string} propertyName name of a property
* @returns {null|any} null if the property does not exist, else the value of the property
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Retrieves the value of a property of the IRISObject object as a boolean
* @function getBoolean
* @param {string} propertyName name of a property
* @returns {boolean} the property value as a boolean
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Retrieves the value of a property of the IRISObject object as a Buffer
* @function getBytes
* @param {string} propertyName name of a property
* @returns {Buffer} the property value as a Buffer
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Retrieves the value of a property of the IRISObject object as a Decimal
* @function getDecimal
* @param {string} propertyName name of a property
* @returns {external:"decimal.js".Decimal} the property value as a Decimal
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Retrieves the value of a property of the IRISObject object as a floating point number.
* @function getFloat
* @param {string} propertyName name of a property
* @returns {number} the property value as a floating point number
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Retrieves the value of a property of the IRISObject object as an integer number.
* @function getInteger
* @param {string} propertyName name of a property
* @returns {number} the property value as an integer number.
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Retrieves the value of a property of the IRISObject object as a number
* @function getNumber
* @param {string} propertyName name of a property
* @returns {number} the property value as a number
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Retrieves the value of a property of the IRISObject object as an
* [IRISList]{@link module:"intersystems-iris".IRISList}.
* @function getIRISList
* @param {string} propertyName name of a property
* @returns {module:"intersystems-iris".IRISList} the property value as an
* [IRISList]{@link module:"intersystems-iris".IRISList}
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Retrieves the value of a property of the IRISObject object as a string
* @function getString
* @param {string} propertyName name of a property
* @returns {string} the property value as a string
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Sets the value of a property of the IRISObject object.
* @function set
* @param {string} propertyName name of a property
* @param {any} propertyValue new value of the property
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 2)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Invokes a method of the IRISObject object that returns a value.
* @function invoke
* @param {string} methodName name of a method.
* @param {...any} argument zero or more arguments to be passed to the method.
* @returns {any} the return value of the method invocation.
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Invokes a method of the IRISObject object that returns a value.
* @function invokeObject
* @param {string} methodName name of a method.
* @param {...any} argument zero or more arguments to be passed to the method.
* @returns {any} the return value of the method invocation.
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Invokes a method of the IRISObject object and returns the returned value as a boolean.
* @function invokeBoolean
* @param {string} methodName name of a method.
* @param {...any} argument zero or more arguments to be passed to the method.
* @returns {boolean} the return value of the method invocation as a boolean
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Invokes a method of the IRISObject object and returns the returned value as a Buffer.
* @function invokeBytes
* @param {string} methodName name of a method.
* @param {...any} argument zero or more arguments to be passed to the method.
* @returns {Buffer} the return value of the method invocation as a Buffer
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Invokes a method of the IRISObject object and returns the returned value as a Decimal.
* @function invokeDecimal
* @param {string} methodName name of a method.
* @param {...any} argument zero or more arguments to be passed to the method.
* @returns {external:"decimal.js".Decimal} the return value of the method invocation as a Decimal.
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Invokes a method of the IRISObject object and returns the returned value as a floating point
* number.
* @function invokeFloat
* @param {string} methodName name of a method.
* @param {...any} argument zero or more arguments to be passed to the method.
* @returns {number} the return value of the method invocation as a floating point number.
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Invokes a method of the IRISObject object and returns the returned value as an integer number.
* @function invokeInteger
* @param {string} methodName name of a method.
* @param {...any} argument zero or more arguments to be passed to the method.
* @returns {number} the return value of the method invocation as an integer number
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Invokes a method of the IRISObject object and returns the returned value as a number.
* @function invokeNumber
* @param {string} methodName name of a method.
* @param {...any} argument zero or more arguments to be passed to the method.
* @returns {number} the return value of the method invocation as a number
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Invokes a method of the IRISObject object and returns the returned value as an
* [IRISList]{@link module:"intersystems-iris".IRISList}.
* @function invokeIRISList
* @param {string} methodName name of a method.
* @param {...any} argument zero or more arguments to be passed to the method.
* @returns {module:"intersystems-iris".IRISList} the return value of the method invocation as an
* [IRISList]{@link module:"intersystems-iris".IRISList}
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Invokes a method of the IRISObject object and returns the returned value as a string.
* @function invokeString
* @param {string} methodName name of a method.
* @param {...any} argument zero or more arguments to be passed to the method.
* @returns {string} the return value of the method invocation as a string
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Invokes a method of the IRISObject object that does not return a value.
* @function invokeVoid
* @param {string} methodName name of a method.
* @param {...any} argument zero or more arguments to be passed to the method.
* @memberof module:"intersystems-iris".IRISObject
* @instance
* @throws If wrong number of arguments (at least 1)
* @throws If IRISObject closed
* @throws If no connection or iris present for this object
*/
/**
* Closes the IRIS object proxy.
* @function close
* @memberof module:"intersystems-iris".IRISObject
* @instance
*/
// >>>>>>>>>>>>>>>> Iterator <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
/**
* Instantiates the [Iterator]{@link module:"intersystems-iris".Iterator} class.
* Another way to instantiate an Iterator is by iterating an
* [IRISGlobalNode]{@link module:"intersystems-iris".IRISGlobalNode} object.
* @function iterator
* @memberof module:"intersystems-iris".Iris
* @param {string} globalName - the name of the global array
* @param {...any} subscript - variable number of subscript values
* @returns {module:"intersystems-iris".Iterator}
* @throws exception
* @instance
* @tutorial global_arrays
*/
/**
* @classdesc This class implements the Node.js iterator protocol on an IRIS global array node
* It can be used to iterate over the contents of
* [IRISGlobalNode]{@link module:"intersystems-iris".IRISGlobalNode}, which behaves like a virtual
* dictionary representing the immediate children of a global array node.
* @class Iterator
* @memberof module:"intersystems-iris"
* @hideconstructor
*/
/**
* Returns the class name (Iterator) for proper string representation of Iterator objects
* @function [Symbol.toStringTag]
* @returns {string}
* @memberof module:"intersystems-iris".Iterator
* @instance
*/
/**
* Returns the current iterator. This makes any Iterator object an iterable. An Iterator object
* can be iterated only once.
* @function [Symbol.iterator]
* @returns {module:"intersystems-iris".Iterator} the current iterator
* @memberof module:"intersystems-iris".Iterator
* @instance
*/
/**
* Positions the iterator at the next sibling node in collation order and return an object
* containing done and value properties. If the iterator is at end then done is true, otherwise it
* is false. The value property returned when done is false is either the subscript, the node
* value, or an array whose first element is the subscript and the second is the global node value.
* The return value type defaults to the array containing the subscript and value. The return type
* can be changed by invoking the entries(), keys(), or values() methods.
* @function next
* @returns {any}
* @memberof module:"intersystems-iris".Iterator
* @instance
* @tutorial global_arrays
*/
/**
* Positions the iterator to start from subscript, returns this() for chaining.
* After calling this method, use next() to advance the iterator to the next defined
* sub-node in alphabetic collating sequence. For example, for the following global and iterator:
* ^gbl("a")=11
* ^gbl("b")=22
* ^gbl("e")=55
* itr = iris.iterator("^gbl")
*
* The starting position may be a valid sub-node, in which case the next sub-node will be
* the next valid one.
*
* itr.startFrom("a")
* for (let pair of itr) {
* let [sub, val] = pair
* console.log(sub, '->', val) // prints: b -> 22\n e -> 55
* }
*
* The starting position may also be an invalid sub-node, in which case the next sub-node
* will be the first valid one in alphabetic collating sequence after the given subscript.
*
* itr.startFrom("c")
* for (let pair of itr) {
* let [sub, val] = pair
* console.log(sub, '->', val) // prints: e -> 55
* }
*
* Calling this method with undefined as an argument is the same as using the default
* starting position, which is just before the first node, or just after the last node,
* depending on the iterator direction.
*
* @function startFrom
* @param {any} subscript - the value of the subscript where the iterator is to be positioned
* @returns {module:"intersystems-iris".Iterator}
* @memberof module:"intersystems-iris".Iterator
* @instance
* @tutorial global_arrays
*/
/**
* Reverses the iterator, returns this() for chaining.
* @function reversed
* @returns {module:"intersystems-iris".Iterator}
* @memberof module:"intersystems-iris".Iterator
* @instance
* @tutorial global_arrays
*/
/**
* Sets the iterator return type to return entries where each value is an array containing the
* subscript and node value, returns this() for chaining.
* @function entries
* @returns {module:"intersystems-iris".Iterator}
* @memberof module:"intersystems-iris".Iterator
* @instance
* @tutorial global_arrays
*/
/**
* Sets the iterator return type to return keys only (subscripts), returns this() for chaining.
* @function keys
* @returns {module:"intersystems-iris".Iterator}
* @memberof module:"intersystems-iris".Iterator
* @instance
* @tutorial global_arrays
*/
/**
* Alias for the [keys()]{@link module:"intersystems-iris".Iterator.keys()} function.
* Sets the iterator return type to return keys only (subscripts), returns this() for chaining.
* @function subscripts
* @returns {module:"intersystems-iris".Iterator}
* @memberof module:"intersystems-iris".Iterator
* @instance
* @tutorial global_arrays
*/
/**
* Sets the iterator return type to return only values, returns this() for chaining.
* @function values
* @returns {module:"intersystems-iris".Iterator}
* @memberof module:"intersystems-iris".Iterator
* @instance
* @tutorial global_arrays
*/
/**
* Sets the iterator return type to return only sub-nodes
* ([IRISGlobalNode]{@link module:"intersystems-iris".IRISGlobalNode}),
* returns this() for chaining.
* @function nodes
* @returns {module:"intersystems-iris".Iterator}
* @memberof module:"intersystems-iris".Iterator
* @instance
* @tutorial global_arrays
*/
/**
* Sets the iterator return type to return nodeEntries where each value is an array containing the
* subscript and sub-node ([IRISGlobalNode]{@link module:"intersystems-iris".IRISGlobalNode}),
* returns this() for chaining.
* @function nodeEntries
* @returns {module:"intersystems-iris".Iterator}
* @memberof module:"intersystems-iris".Iterator
* @instance
* @tutorial global_arrays
*/
// >>>>>>>>>>>>>>>> IRISGlobalNode <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
/**
* Instantiates the [IRISGlobalNode]{@link module:"intersystems-iris".IRISGlobalNode} class.
* @function node
* @memberof module:"intersystems-iris".Iris
* @param {string} globalName - the name of the global array
* @param {...any} subscript - variable number of subscript values
* @returns {module:"intersystems-iris".IRISGlobalNode}
* @throws exception
* @instance
* @tutorial global_arrays
*/
// Notes python has both iterator and node within IRIS class. However iterator returns the legacy
// iterator, while I am planning to return the Iterator I have in my disposal, which is NOT deprecated.
// I need to check for backward compatibility
/**
* @classdesc This class provides an iterable interface that behaves like a virtual dictionary
* representing the immediate children of a global node.
* [IRISGlobalNode]{@link module:"intersystems-iris".IRISGlobalNode}, which behaves like a virtual
* dictionary representing the immediate children of a global array node.<br><br>
*
* IRISGlobalNode is iterable: IRISGlobalNode supports iterable interface using for-of loop.<br><br>
* <pre class="prettyprint source"><code>
* for (let x of node) console.log(x)
* </code></pre>
*
* IRISGlobalNode can be iterated in many different ways:
* Methods keys(), subscripts(), values(), entries(), nodes(), and nodeEntries() return iterators
* over different views of the IRISGlobalNode subscript-value pairs.
* For example, the items() method returns an iterator over the sub-nodes of the IRISGlobalNode.
* <pre class="prettyprint source"><code>
* for (let x of node.nodes()) console.log(x)
* </code></pre>
* IRISGlobalNode can be sliced to be iterated over a more restricted ranges of subscripts with
* the following syntax:
* <pre class="prettyprint source"><code>
* node.slice(start, end)
* </code></pre>
* This results in a new IRISGlobalNode object with the subsript range limited to
* from start (inclusive) to end (exclusive), where start < end and start or end might be negative
* indicating elements from the end of the subscript list, in a similar way with Array slicing.
* <br><br>
* IRISGlobalNode is reversable:
* If the function reverse() gets called the iteration of the IRISGlobalNode will go backwards
* - reversed from the standard order.<br><br>
* For example:
* <pre class="prettyprint source"><code>
* for (let x of node.reverse().entries()) console.log(x)
* </code></pre>
* will traverse the subscripts from last (inclusive) to first (exclusive).
* <br><br>
* Finally, IRISGlobalNode supports membership tests (has), and allows setting or getting
* subscript-value pairs
* @class IRISGlobalNode
* @memberof module:"intersystems-iris"
*/
/**
* Constructs an [IRISGlobalNode]{@link module:"intersystems-iris".IRISGlobalNode}
* @param {module:"intersystems-iris".Iris} iris the iris instance to use to
* communicate with the IRIS server
* @param {string} globalName the name of the global node
* @param {...any} subscripts
*/
/**
* Returns the iterator property of the class which is the same as the one provided by
* the entries method. Every time this is invoked a new
* [Iterator]{@link module:"intersystems-iris".Iterator} is returned.
* @function [Symbol.iterator]
* @returns {module:"intersystems-iris".Iterator} a new Iterator over the global node, which will
* be returning entries by default. Same as the Iterator returned by the
* [entries()]{@link module:"intersystems-iris".IRISGlobalNode.entries()} function
* @memberof module:"intersystems-iris".IRISGlobalNode
* @instance
* @tutorial global_arrays
*/
/**
* Completely deletes the IRISGlobalNode from the IRIS server
* @function clear
* @returns undefined
* @memberof module:"intersystems-iris".IRISGlobalNode
* @instance
*/
/**
* Removes the specified value from the IRISGlobalNode object by subscript
* @function delete
* @param {*} subscript the subscript to be removed
* @returns true if the subscript existed and has been removed, or false if the subscript does
* not exist
* @memberof module:"intersystems-iris".IRISGlobalNode
* @instance
*/
/**
* Returns an [Iterator]{@link module:"intersystems-iris".Iterator} object of the current
* IRISGlobalNode which can be iterated over to yield subscript-value pairs. Iterator is an
* iterable so the for-of loop can be used. When the protocol [Symbol.iterator] is used, it
* returns a function that, when invoked, returns this iterator itself
* @function entries
* @returns a new [Iterator]{@link module:"intersystems-iris".Iterator} object of
* the current IRISGlobalNode
* @memberof module:"intersystems-iris".IRISGlobalNode
* @instance
* @tutorial global_arrays
*/
/**
* Executes a provided function once per each subscript/value pair in the IRISGlobalNode
* @function forEach
* @param {callback} callback
* Function to execute for each subscript/value pair in the IRISGlobalNode
* @param {any} thisArg value to use as this when executing the callback
* @memberof module:"intersystems-iris".IRISGlobalNode
* @instance
*/
//function (?value: any, ?subscript: any, ?thisGlobalNode: IRISGlobalNode)
/**
* Returns a specified value from an IRISGlobalNode object.
* @function get
* @param {*} subscript the subscript to return from the IRISGlobalNode
* @param {any} default_value a value to return if the subscript does not exist
* @returns the value associated with the specified subscript or undefined (or default_value)
* if the node is UNDEFINED
* @memberof module:"intersystems-iris".IRISGlobalNode
* @instance
*/
/**
* Returns a boolean indicating whether a value with the specified subscript exists or not
* @function has
* @param {*} subscript
* @returns true if a value for the specified subscript exist in the IRISGlobalNode;
* otherwise false
* @memberof module:"intersystems-iris".IRISGlobalNode
* @instance
*/
/**
* Returns an [Iterator]{@link module:"intersystems-iris".Iterator} object of the current
* IRISGlobalNode which can be iterated over to yield only subscripts. Iterator is an
* iterable so the for-of loop can be used. When the protocol [Symbol.iterator] is used, it
* returns a function that, when invoked, returns this iterator itself
* @function keys
* @returns a new [Iterator]{@link module:"intersystems-iris".Iterator} object of
* the current IRISGlobalNode
* @memberof module:"intersystems-iris".IRISGlobalNode
* @instance
* @tutorial global_arrays
*/
/**
* Alias for [keys()]{@link module:"intersystems-iris".IRISGlobalNode.keys()}
* @function subscripts
* @returns a new [Iterator]{@link module:"intersystems-iris".Iterator} object of
* the current IRISGlobalNode
* @memberof module:"intersystems-iris".IRISGlobalNode
* @instance
* @tutorial global_arrays
*/
/**
* Adds or updates the value of a specified subscript in the IRISGlobalNode
* @function set
* @param {*} subscript the subscript of the value to add in the IRISGlobalNode
* @param {any} value the value to add in the IRISGlobalNode
* @returns the IRISGlobalNode object
* @memberof module:"intersystems-iris".IRISGlobalNode
* @instance
*/
/**
* Returns an [Iterator]{@link module:"intersystems-iris".Iterator} object of the current
* IRISGlobalNode which can be iterated over to yield only values. Iterator is an
* iterable so the for-of loop can be used. When the protocol [Symbol.iterator] is used, it
* returns a function that, when invoked, returns this iterator itself
* @function values
* @returns a new [Iterator]{@link module:"intersystems-iris".Iterator} object of
* the current IRISGlobalNode
* @memberof module:"intersystems-iris".IRISGlobalNode
* @
* @tutorial global_arrays
*/
/**
* Returns an [Iterator]{@link module:"intersystems-iris".Iterator} object of the current
* IRISGlobalNode which can be iterated over to yield subscript-subnode pairs. Iterator is an
* iterable so the for-of loop can be used. When the protocol [Symbol.iterator] is used, it
* returns a function that, when invoked, returns this iterator itself
* @function nodeEntries
* @returns a new [Iterator]{@link module:"intersystems-iris".Iterator} object of
* the current IRISGlobalNode
* @memberof module:"intersystems-iris".IRISGlobalNode
* @instance
* @tutorial global_arrays
*/
/**
* Returns an [Iterator]{@link module:"intersystems-iris".Iterator} object of the current
* IRISGlobalNode which can be iterated over to yield only subnodes. Iterator is an
* iterable so the for-of loop can be used. When the protocol [Symbol.iterator] is used, it
* returns a function that, when invoked, returns this iterator itself
* @function nodes
* @returns a new [Iterator]{@link module:"intersystems-iris".Iterator} object of
* the current IRISGlobalNode
* @memberof module:"intersystems-iris".IRISGlobalNode
* @instance
* @tutorial global_arrays
*/
/**
* Returns a reverse [Iterator]{@link module:"intersystems-iris".Iterator} object of the current
* IRISGlobalNode which can be iterated over to yield subscript-value pairs. Iterator is an
* iterable so the for-of loop can be used. When the protocol [Symbol.iterator] is used, it
* returns a function that, when invoked, returns this iterator itself
* @function reversed
* @returns a new [Iterator]{@link module:"intersystems-iris".Iterator} object of
* the current IRISGlobalNode
* @memberof module:"intersystems-iris".IRISGlobalNode
* @instance
* @tutorial global_arrays
*/
/**
* Returns an IRISGlobalNode object that represents the subnode at a given subscript
* @function node
* @param {*} subscript the subscript of the requested subnode
* @returns a new IRISGlobalNode object
* @memberof module:"intersystems-iris".IRISGlobalNode
* @instance
*/
/**
* The number of subscript-value pairs in the IRISGlobalNode
* @property size
* @memberof module:"intersystems-iris".IRISGlobalNode
* @instance
*/
/**
* Returns the name of the objects of this class. When printed, an object of this class should
* print "[object IRISGlobalNode]"
* @symbol toStringTag
* @memberof module:"intersystems-iris".IRISGlobalNode
* @instance
*/
/**
* Slices the current node and returns a new node with subscripts that start at the
* startSubscript and end at the endSubscript (exclusive). Slicing can happen only in the forward
* direction. If numbers provided then the slice is based on the 0 indexed subscripts array and
* numbers are not converted to string subscripts (for example slice(0) is not necessarily
* equivalent to slice('0') unless '0' is the first subscript)
* @function slice
* @param {number} [startSubscript=0]
* @param {number} [endSubscript]
* @returns a new IRISGlobalNode object
* @memberof module:"intersystems-iris".IRISGlobalNode
* @instance
* @throws If endSubscript < startSubscript
* @throws If subscript is out of bounds (if numeric, it exceeds the size)
* @throws If the end or start subscript does not exist
*/
// >>>>>>>>>>>>>>>> IRISList <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
/**
* @classdesc A class that provides an interface to interact with IRIS $LIST data.
* @class IRISList
* @memberof module:"intersystems-iris"
*/
/**
* Adds a data element at the end of the list.
* @function add
* @param {any} value - the value of the list element to be added
* @memberof module:"intersystems-iris".IRISList
* @instance
* @throws If insufficient number of arguments (at least 1)
* @throws If argument is a list with compact double enabled but the current list does not allow
* compact double
*/
/**
* Changes the data element at the specified index to a new value.
* If the index is beyond the length of the IRISList,
* IRISList will be first expanded to that many elements, padded with null elements.
* @function set
* @param {number} index - the element position to set. Should be >= 1.
* @param {any} value - the element value
* @memberof module:"intersystems-iris".IRISList
* @instance
* @throws If index is invalid
* @throws If insufficient number of arguments (at least 2)
*/
/**
* Gets the list element at the specified index. If the element value is expected to
* be a list then use [getList]{@link module:"intersystems-iris".IRISList#getList} instead.
* @function get
* @param {number} index - the position of the element to retrieve. Should be >= 1.
* @returns {any} the element of position <index> (number|string|Buffer|Decimal|null)
* @memberof module:"intersystems-iris".IRISList
* @instance
* @throws If index out of bounds
* @throws If index is invalid
* @throws If insufficient number of arguments (at least 1)
*/
/**
* Gets the list element at the specified index as a boolean.
* @function getBoolean
* @param {number} index - the position of the element to retrieve. Should be >= 1.
* @returns {boolean} the element of the position <index> as a boolean.
* @memberof module:"intersystems-iris".IRISList
* @instance
* @throws If index out of bounds
* @throws If index is invalid
* @throws If insufficient number of arguments (at least 1)
*/
/**
* Gets the list element at the specified index as a Buffer.
* @function getBytes
* @param {number} index - the position of the element to retrieve. Should be >= 1.
* @returns {Buffer} the element of the position <index> as a Buffer.
* @memberof module:"intersystems-iris".IRISList
* @instance
* @throws If index out of bounds
* @throws If index is invalid
* @throws If insufficient number of arguments (at least 1)
*/
/**
* Gets the list element at the specified index as a Decimal.
* @function getDecimal
* @param {number} index - the position of the element to retrieve. Should be >= 1.
* @returns {external:"decimal.js".Decimal} the element of the position <index> as a Decimal.
* @memberof module:"intersystems-iris".IRISList
* @instance
* @throws If index out of bounds
* @throws If index is invalid
* @throws If insufficient number of arguments (at least 1)
*/
/**
* Gets the list element at the specified index as a floating point number.
* @function getFloat
* @param {number} index - the position of the element to retrieve. Should be >= 1.
* @returns {number} the element of the position <index> as a floating point number.
* @memberof module:"intersystems-iris".IRISList
* @instance
* @throws If index out of bounds
* @throws If index is invalid
* @throws If insufficient number of arguments (at least 1)
*/
/**
* Gets the list element at the specified index as an integer number.
* @function getInteger
* @param {number} index - the position of the element to retrieve. Should be >= 1.
* @returns {number} the element of the position <index> as an integer number.
* @memberof module:"intersystems-iris".IRISList
* @instance
* @throws If index out of bounds
* @throws If index is invalid
* @throws If insufficient number of arguments (at least 1)
*/
/**
* Gets the list element at the specified index as a number.
* @function getNumber
* @param {number} index - the position of the element to retrieve. Should be >= 1.
* @returns {number} the element of the position <index> as a number.
* @memberof module:"intersystems-iris".IRISList
* @instance
* @throws If index out of bounds
* @throws If index is invalid
* @throws If insufficient number of arguments (at least 1)
*/
/**
* Gets the list element at the specified index as an
* [IRISList]{@link module:"intersystems-iris".IRISList}.
* @function getList
* @param {number} index - the position of the element to retrieve. Should be >= 1.
* @returns {module:"intersystems-iris".IRISList} the element of the position <index> as an
* [IRISList]{@link module:"intersystems-iris".IRISList}
* @memberof module:"intersystems-iris".IRISList
* @instance
* @throws If index out of bounds
* @throws If index is invalid
* @throws If insufficient number of arguments (at least 1)
*/
/**
* Gets the list element at the specified index as an
* [IRISList]{@link module:"intersystems-iris".IRISList}. Alias of [getList]{@link module:"intersystems-iris".IRISList.getList}
* @function getIRISList
* @param {number} index - the position of the element to retrieve. Should be >= 1.
* @returns {module:"intersystems-iris".IRISList} the element of the position <index> as an
* [IRISList]{@link module:"intersystems-iris".IRISList}
* @memberof module:"intersystems-iris".IRISList
* @instance
* @throws If index out of bounds
* @throws If index is invalid
* @throws If insufficient number of arguments (at least 1)
*/
/**
* Gets the list element at the specified index as a string.
* @function getString
* @param {number} index - the position of the element to retrieve. Should be >= 1.
* @returns {string} the element of the position <index> as a string.
* @memberof module:"intersystems-iris".IRISList
* @instance
* @throws If index out of bounds
* @throws If index is invalid
* @throws If insufficient number of arguments (at least 1)
*/
/**
* Removes the list element at the specified index from the list.
* @function remove
* @param {number} index - the element position to retrieve. Should be >= 1.
* @returns {boolean} true if operation successful, false otherwise.
* @memberof module:"intersystems-iris".IRISList
* @instance
* @throws If insufficient number of arguments (at least 1)
*/
/**
* Clears all data elements from the list.
* @function clear
* @returns {module:"intersystems-iris".IRISList} the current IRISList object
* @memberof module:"intersystems-iris".IRISList
* @instance
*/
/**
* Returns the total size (number of bytes) of the list.
* @function size
* @returns {number} the size of the list in bytes
* @memberof module:"intersystems-iris".IRISList
* @instance
*/
/**
* Returns the number of data elements in the list.
* @function count
* @returns {number} the number of elements
* @memberof module:"intersystems-iris".IRISList
* @instance
*/
/**
* Compares a list to the current list, return true if they are equal.
* @function equals
* @param {module:"intersystems-iris".IRISList} otherList - the list to compare the current list to
* @returns {boolean} true if equal
* @memberof module:"intersystems-iris".IRISList
* @instance
*/
/**
* Returns a Buffer that contains the $LIST format of all the data elements in the list.
* @function getBuffer
* @returns {Buffer} the entire contents of the current list.
* @memberof module:"intersystems-iris".IRISList
* @instance
*/
/**
* Returns a string containing the formatted list value
* @function toString
* @returns {string} the string representation of the list
* @memberof module:"intersystems-iris".IRISList
* @instance
*/
// >>>>>>>>>>>>>>>> IRISReference <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
/**
* @classdesc Used to call method/routine for pass-by-reference arguments
* @class IRISReference
* Constructs the IRISReference object
* @constructor IRISReference
* @param {any} value - the value we want to pass by reference
* @param {module:"intersystems-iris".IRISReference.Type} [type=NONE] - the type used as a type hint
* for unmarshaling the modified value of the argument. If NONE specified then the actual IRIS type
* of the data will be used
* @memberof module:"intersystems-iris"
* @throws Fails if insufficient number of arguments (at least 1)
* @throws Fails if type is not valid type.
*/
/**
* Sets the value the IRISReference object referes to
* @function setValue
* @param {any} value - the value we want to pass by reference
* @memberof module:"intersystems-iris".IRISReference
* @instance
*/
/**
* Gets the value of this IRISReference object
* @function getValue
* @returns {any} the value the reference object holds
* @memberof module:"intersystems-iris".IRISReference
* @instance
*/
/**
* Changes the (suggested) type of the value the IRISReference object referes to
* @function setType
* @param {module:"intersystems-iris".IRISReference.Type} type - the (suggested) type of the value
* we want to pass by reference
* @memberof module:"intersystems-iris".IRISReference
* @instance
*/
/**
* Gets the (suggested) type of this IRISReference object
* @function getType
* @returns {module:"intersystems-iris".IRISReference.Type} the type of the referenced object
* @memberof module:"intersystems-iris".IRISReference
* @instance
*/
/**
* Gets the value of this IRISReference object
* @function getObject
* @returns {any} the value the reference object holds
* @memberof module:"intersystems-iris".IRISReference
* @instance
*/
/**
* Gets the value of this IRISReference object as a boolean
* @function getBoolean
* @returns {boolean} the value the reference object holds as a boolean
* @memberof module:"intersystems-iris".IRISReference
* @instance
*/
/**
* Gets the value of this IRISReference object as a Buffer
* @function getBuffer
* @returns {Buffer} the value the reference object holds as a Buffer
* @memberof module:"intersystems-iris".IRISReference
* @instance
*/
/**
* Gets the value of this IRISReference object as a Decimal
* @function getDecimal
* @returns {external:"decimal.js".Decimal} the value the reference object holds as a Decimal
* @memberof module:"intersystems-iris".IRISReference
* @instance
*/
/**
* Gets the value of this IRISReference object as a floating point number
* @function getFloat
* @returns {number} the value the reference object holds as a floating point number
* @memberof module:"intersystems-iris".IRISReference
* @instance
*/
/**
* Gets the value of this IRISReference object as an integer number
* @function getInteger
* @returns {number} the value the reference object holds as an integer number
* @memberof module:"intersystems-iris".IRISReference
* @instance
*/
/**
* Gets the value of this IRISReference object as number
* @function getNumber
* @returns {number} the value the reference object holds as number
* @memberof module:"intersystems-iris".IRISReference
* @instance
*/
/**
* Gets the value of this IRISReference object as a string
* @function getString
* @returns {string} the value the reference object holds as string
* @memberof module:"intersystems-iris".IRISReference
* @instance
*/
/**
* Gets the value of this IRISReference object as an [IRISList]{@link module:"intersystems-iris".IRISList}
* @function getIRISList
* @returns {module:"intersystems-iris".IRISList} the value the reference object holds as
* [IRISList]{@link module:"intersystems-iris".IRISList}
* @memberof module:"intersystems-iris".IRISReference
* @instance
*/
/**
* @typedef Type
* @property {number} NONE 0
* @property {number} BOOLEAN 1
* @property {number} BYTES 2
* @property {number} DECIMAL 3
* @property {number} FLOAT 4
* @property {number} INTEGER 5
* @property {number} NUMBER 6
* @property {number} IRISLIST 7
* @property {number} STRING 8
* @memberof module:"intersystems-iris".IRISReference
*/