diff --git a/.npmignore b/.npmignore index 50049d1..e0a4959 100644 --- a/.npmignore +++ b/.npmignore @@ -17,6 +17,7 @@ doc/ tests.untracked/ samples.untracked/ defects/ +issues/ redist/ archive/ redist.full/ @@ -29,3 +30,4 @@ samples/mykey.* ibmmq*tar.gz +t diff --git a/CHANGES.md b/CHANGES.md index ca051f8..8187168 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,10 +1,14 @@ # Changelog Newest updates are at the top of this file. -## xx xxx 2023: v2.0.2 +## 19 Oct 2023: v2.0.2 +* Update for MQ 9.3.4 + - Support for JWT Token authentication * Change the postinstall to use genmqpkg on Linux * Can configure postinstall to download client from local URL * Updated postinstall to support http proxy environment variables (#167) +* Fix calling the MQI within message delivery callback (#169) +* Update documentation links ## 05 Jul 2023: v2.0.1 * Added LinuxARM definitions diff --git a/README.md b/README.md index 6c7bb51..253d4a3 100755 --- a/README.md +++ b/README.md @@ -1,157 +1,165 @@ # mq-mqi-nodejs -This repository demonstrates a way to call IBM MQ from applications -running in a Node.js environment. +This repository demonstrates a way to call IBM MQ from applications running in a Node.js environment. ## N-API REWRITE for V2 (Jun 2023) -This version of the package has been heavily rewritten, to remove some of the -outdated/unmaintained dependencies. There are other potential benefits to the -rewrite, including improved performance and the opportunity to port to platforms +This version of the package has been heavily rewritten, to remove some of the outdated/unmaintained dependencies. There +are other potential benefits to the rewrite, including improved performance and the opportunity to port to platforms that the dependencies could not support. -See the [BREAKING_CHANGES](BREAKING_CHANGES_V2.md) file for changes you might -need to make to your application. +See the [BREAKING_CHANGES](BREAKING_CHANGES_V2.md) file for changes you might need to make to your application. ## MQI Description -The package exposes the IBM MQ programming interface via -a wrapper layer implemented in JavaScript. This should make it -easy for a Node.js developer to send and receive messages via MQ, and -interact with other MQ-enabled applications in the organisation. - -The package is based on the full MQI. It uses essentially the -same verbs and structures as the C or COBOL interface, but with a more -appropriate style for this environment. -It removes the need for a developer to worry about -how to map elements to the underlying C libraries and instead -enables a focus on the -business application code. For example, JavaScript strings are used -instead of fixed-length, spaced-padded fields. - -Most MQI verbs and parameters are implemented here. -Where there are missing details within the verbs, these are shown by TODO -markers in the source files. - -It is assumed that someone using this package does have a basic -understanding of the procedural MQI, as that is needed to decide which -options and fields may need to be set for each verb. - -The implemented verbs follow the JavaScript style, invoking -user-supplied callback functions on completion. In all cases, the callbacks -are presented with an MQError object as the first parameter when an error -or warning occurs (null otherwise), followed by other relevant -objects and data. If the callback is not provided by the application, -then either an exception is thrown, or the verb returns. +The package exposes the IBM MQ programming interface via a wrapper layer implemented in JavaScript. This should make it +easy for a Node.js developer to send and receive messages via MQ, and interact with other MQ-enabled applications in the +organisation. + +The package is based on the full MQI. It uses essentially the same verbs and structures as the C or COBOL interface, but +with a more appropriate style for this environment. It removes the need for a developer to worry about how to map +elements to the underlying C libraries and instead enables a focus on the business application code. For example, +JavaScript strings are used instead of fixed-length, spaced-padded fields. + +Most MQI verbs and parameters are implemented here. Where there are missing details within the verbs, these are shown by +TODO markers in the source files. + +It is assumed that someone using this package does have a basic understanding of the procedural MQI, as that is needed +to decide which options and fields may need to be set for each verb. + +The implemented verbs follow the JavaScript style, invoking user-supplied callback functions on completion. In all +cases, the callbacks are presented with an MQError object as the first parameter when an error or warning occurs (null +otherwise), followed by other relevant objects and data. If the callback is not provided by the application, then either +an exception is thrown, or the verb returns. ### Synchrony -The main verbs - `Conn(x)`, `Disc`, `Open`, `Close`, `Sub`, `Put`, `Put1` -and `Get` - have true synchronous and asynchronous variations. The default is that the verbs -are asynchronous, to be more natural in a Node.js environment. When given a `...Sync` -suffix (eg `OpenSync`) then the verb is synchronous. Callback functions are now required -for the OpenSync and SubSync verbs to obtain the object handles; these are not returned -explicitly from the function calls. - -The remaining verbs continue to internally make synchronous calls to the underlying -MQI services. Callback functions can still be used to indicate completion of the -operation, with function return values and exceptions being available if you want to -treat them more synchronously rather than pseudo-async. +The main verbs - `Conn(x)`, `Disc`, `Open`, `Close`, `Sub`, `Put`, `Put1` and `Get` - have true synchronous and +asynchronous variations. The default is that these verbs are asynchronous, to be more natural in a Node.js environment. +When given a `...Sync` suffix (eg `OpenSync`) then the verb is synchronous. Callback functions are required for the +OpenSync and SubSync verbs to obtain the object handles; these are not returned explicitly from the function calls. + +The remaining verbs (including `Cmit` and `Back`) internally make synchronous calls to the underlying MQI +services. Callback functions can still be used to indicate completion of the operation, with function return values and +exceptions being available if you want to treat them more synchronously rather than pseudo-async. For the asynchronous functions, a callback function is mandatory. -Note that MQ also has a concept of Asynchronous Put (an MQPMO option) usable from -client applications. That can be used in conjunction with a later call to the `Stat` -function to determine the success of the Put calls, but it is not related to -asynchronous notification of the operation completion in JavaScript terms. +Note that MQ also has a concept of Asynchronous Put (an MQPMO option) usable from client applications. That can be used +in conjunction with a later call to the `Stat` function to determine the success of the Put calls, but it is not related +to asynchronous notification of the operation completion in JavaScript terms. #### Synchronous compatibility option -The SyncMQICompat tuning parameter (among other tuning options) has been removed. +The SyncMQICompat tuning parameter (among other tuning options) has been removed with the V2 implementation. ### Promises -Most of the core MQI verbs (excluding the GET variants) have Promise-based alternatives -named with a `...Promise` suffix (eg `ConnxPromise`). This can help with removal of much -of the typical callback nesting. See the amqsputp.js sample for a demonstration -of how these can be used. There is no Get-based Promise because the async Get operation invokes +Most of the core MQI verbs (excluding the GET variants) have Promise-based alternatives named with a `...Promise` suffix +(eg `ConnxPromise`). This can help with removal of much of the typical callback nesting. See the amqsputp.js sample for +a demonstration of how these can be used. There is no Get-based Promise because the async Get operation invokes callbacks multiple times as messages appear. ### Message Retrieval -This implementation includes two mechanisms for retrieving messages from -a queue: -* *GetSync()* is the call that does an MQGET(wait) synchronously. In a Node -environment, it blocks the execution thread until it completes. That may -be OK for an immediate retrieval where the wait time is set to zero, -but it is not recommended for any times where -you want to wait a while for a message to arrive. Some of the samples use -this function for simplicity, where the Get() is not the interesting aspect -being demonstrated. -* *Get()* is the call that works asynchronously. The callback -given as a parameter to this function is invoked asynchronously. The function remains -active after delivering a message to permit receipt of multiple messages. To -stop the callback being called for further messages, use the *GetDone()* function. This -behaviour is similar to how the MQI *MQCB* callback invocation works. - -This package uses MQCB/MQCTL-managed callbacks for true asynchronous -processing. As such, some of the TuningParameter values that were available in -the 1.x versions of the code have been removed. You will get an exception if you try -to use those parameters. - -For more advanced handling of inbound messages, there is a *Ctl()* verb. This is -an analogue of `MQCTL` and requires you to explicitly start message consumption. You should -use this if you are going to open multiple queues simultaneously for reading. The `tuningParameter.useCtl` or (`MQIJS_NOUSECTL` environment variable) controls whether or not -to require use of the new verb. Older applications can use `useCtl=false` or the environment variable for -backwards compatibility; newer applications should use *Ctl()* going forward. - -Sample programs **amqsget**, **amqsgeta**, and **amqsgetac** demonstrate the different -techniques. +This implementation includes two mechanisms for retrieving messages from a queue: +* *GetSync()* is the call that does an MQGET(wait) synchronously. In a Node environment, it blocks the execution thread + until it completes. That may be OK for an immediate retrieval where the wait time is set to zero, but it is not + recommended for any times where you want to wait a while for a message to arrive. Some of the samples use this + function for simplicity, where the Get() is not the interesting aspect being demonstrated. +* *Get()* is the call that works asynchronously. The callback given as a parameter to this function is invoked + asynchronously. The function remains active after delivering a message to permit receipt of multiple messages. To stop + the callback being called for further messages, use the *GetDone()* function. This behaviour is similar to how the MQI + *MQCB* callback invocation works. + +This package uses MQCB/MQCTL-managed callbacks for true asynchronous processing. As such, some of the TuningParameter +values that were available in the 1.x versions of the code have been removed. You will get an exception if you try to +use those parameters. + +For more advanced handling of inbound messages, there is a *Ctl()* verb. This is an analogue of `MQCTL` and requires you +to explicitly start message consumption. It is the default behaviour. You should always use this if you are going to +open multiple queues simultaneously for reading. The `tuningParameter.useCtl` or `MQIJS_NOUSECTL` environment variable +control whether or not to require use of the new verb. Older applications can use `useCtl=false` or the environment +variable for backwards compatibility; newer applications should use *Ctl()* going forward. + +Sample programs **amqsget**, **amqsgeta**, and **amqsgetac** demonstrate the different techniques. + +### Calling the MQI from the message delivery callback + +The callback function invoked as part of *Get()* processing has to be scheduled to run on a different OS thread than the +MQI thinks it has called. The default strategy for how this is managed internally allows you to call the MQI from your +callback function. You can, for example, call *Cmit()* from the callback function, safely knowing which message +operations will be committed. + +#### Alternative callback strategy + +There is an alternative callback strategy that a tuning parameter option configures. +``` + mq.setTuningParameters({callbackStrategy: "READAHEAD"}); +``` + +Setting this option MIGHT make retrieval of large numbers of messages run faster. But it can also cause operations to +overlap. So you might not know which messages have actually been removed from the queue. It is therefore definitely not +recommended if you care about transactionality. And if you want to call the MQI from within your callback in this mode, +you will have to manually suspend callbacks temporarily. Otherwise you will probably get an `MQRC_HCONN_ASYNC_ACTIVE` +(2500) error returned. + +Instead, you can temporarily disable the asynchronous delivery, call the MQI, and then resume. For example, if you want +to *Inq()* on some aspect of the queue, then doing something like this works inside the Node.js callback. + +``` + mq.Ctl(connectionHandle, MQC.MQOP_SUSPEND, function (err) { + if (err) console.log(formatErr(err)); + }); + var selectors = [ new mq.MQAttr(MQC.MQIA_CURRENT_Q_DEPTH)]; + mq.Inq(queueHandle,selectors, function (err) { + if (err) console.log(formatErr(err)); + }); + mq.Ctl(connectionHandle, MQC.MQOP_RESUME, function (err) { + if (err) console.log(formatErr(err)); + }); +``` +The *Ctl()* and *Inq()* calls in this fragment are synchronous operations, so do not need to be nested inside callbacks. + +## Message body +When putting messages, JavaScript Buffers and strings can be used; string values automatically set the MQMD Format field +to "MQSTR". When getting messages, data is always returned in a Buffer. ## Alternative JavaScript routes into MQ There are already some other ways to access MQ from Node.js: -* Take a look at -the [MQ Light](https://developer.ibm.com/messaging/mq-light/getting-started-mq-light/) -client available from [NPM](https://www.npmjs.com/package/mqlight). MQ supports -connections from MQ Light clients via AMQP channels. -* The MQTT protocol has an implementation [here](https://www.npmjs.com/package/mqtt). MQ supports -connections from MQTT clients via the XR service and Telemetry channels. -* MQ V9.0.4 includes a simple REST API for messaging that is accessible from any environment. -See [here](https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.pro.doc/q130020_.htm#q130020___messagingapi) for more information. - -These interfaces may be suitable for many messaging applications, even though -they do not give access to the full services available from MQ such as transactions. +* MQ supports connections via AMQP channels. There are a number of AMQP 1.0 client implementations available for Node.js. +* The MQTT protocol has an implementation [here](https://www.npmjs.com/package/mqtt). MQ supports connections from MQTT + clients via the XR service and Telemetry channels. +* MQ has a simple REST API for messaging that is accessible from any environment. See + [here](https://www.ibm.com/docs/en/ibm-mq/latest?topic=api-getting-started-messaging-rest) for more information. + +These interfaces may be suitable for many messaging applications, even though they do not give access to the full +services available from MQ such as transactions. ## Unimplemented capabilities -All the application-level MQI verbs are implemented. +All the application-level MQI verbs are implemented. Structures and verbs that are only used in other environments - for +example in exits - are not provided as only C is a supported language for those operations. -There are no structure definitions for most MQ elements in message contents such -as the MQCIH structure. When putting messages, JavaScript Buffers and -strings can be used; when getting messages, data is always returned in a Buffer. +There are no structure definitions for most MQ header elements in message contents such as the MQCIH structure. -However there is now a definition and sample program to manipulate the Dead -Letter Header (MQDLH). This should be considered experimental for now - there -may be better ways to work with the structures. There is also a definition for -the MQRFH2 structure header, though not for the individual folders and properties -that may be added to that structure. +However there is a definition and sample program to manipulate the Dead Letter Header (MQDLH). There is also a +definition for the MQRFH2 structure header, though not for the individual folders and properties that may be added to +that structure. Instead of explicitly using an MQRFH2, it is recommended you use the message property APIs. -The amqsget sample shows ways to process the returned message, including -extracting details from the MQDLH and MQRFH2 structures if they are part of -the message. +The **amqsget** sample shows ways to process the returned message, including extracting details from the MQDLH and MQRFH2 +structures if they are part of the message. ## Local queue manager connectivity -The C MQ library is dynamically loaded at runtime. By default, this package will -try to load the library from the `node_modules` directory associated with the -application. +The C MQ library is dynamically loaded at runtime. By default, this package will try to load the library from the +`node_modules` directory associated with the application. -For platforms where the MQ Redistributable Client exists and has been installed, this means that -local bindings connections will not work to connect to a queue manager, even if there -is also a full MQ installation on the machine. Only client connections can be used by the Redistributable -Client libraries. Trying to connect to a local queue manager will likely result in -an **MQRC_Q_MGR_NAME_ERROR** (2058) error. +For platforms where the MQ Redistributable Client exists and has been installed, this means that local bindings +connections will not work to connect to a queue manager, even if there is also a full MQ installation on the machine. +Only client connections can be used by the Redistributable Client libraries. Trying to connect to a local queue manager +will likely result in an **MQRC_Q_MGR_NAME_ERROR** (2058) error. -To override this default behaviour and to permit use of local bindings connections, the -full MQ installation libraries must be used instead. There are two mechanisms to do this: -* Set the `MQIJS_NOREDIST` environment variable during `npm install` so that the Redist Client -package is not downloaded and installed in the `node_modules` directory. +To override this default behaviour and to permit use of local bindings connections, the full MQ installation libraries +must be used instead. There are two mechanisms to do this: +* Set the `MQIJS_NOREDIST` environment variable during `npm install` so that the Redist Client package is not downloaded + and installed in the `node_modules` directory. * Set the `MQIJS_PREFER_INSTALLED_LIBRARY` environment variable at runtime -The use of the Redist Client libraries is preferred wherever possible, so that new function -can be introduced regardless of the version of MQ that has been "properly" installed on a machine. +The use of the Redist Client libraries is preferred wherever possible, so that new function can be introduced regardless +of the version of MQ that has been "properly" installed on a machine. ## Client connectivity @@ -167,20 +175,18 @@ To force client connections, even when there is a full MQ server set of librarie The package includes a couple of verbs that are not standard in the MQI. * *GetDone()* is used to end asynchronous retrieval of messages. * *GetSync()* is equivalent of the traditional MQGET operation. -* *Lookup()* extracts strings corresponding to MQI numbers, similar to the -*MQConstants.lookup()* method in Java. +* *Lookup()* extracts strings corresponding to MQI numbers, similar to the *MQConstants.lookup()* method in Java. ## Requirements -* node version 16 or greater. -* On platforms other than Windows and Linux x64, you must also install -the MQ client package -* I have run it on Windows, where the NPM 'windows-build-tools' package -also needed to be installed first. See [this document](https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#environment-setup-and-configuration) for more information on Windows. +* node version 16 or greater. +* On platforms other than Windows and Linux x64, you must also install the MQ client package +* I have run it on Windows, where the NPM 'windows-build-tools' package also needed to be installed first. See + [this document](https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#environment-setup-and-configuration) + for more information on Windows. ## Installation: -To install this package, you can pull it straight from the -NPM repository. You can also refer to it in a package.json file for -automatic installation. +To install this package, you can pull it straight from the NPM repository. You can also refer to it in a package.json +file for automatic installation. ~~~ mkdir @@ -190,71 +196,65 @@ npm install ibmmq ### Prerequisite components -Installation of the package will automatically install any -prerequisite packages downloadable from the npm repository. By -default, it will pull in packages listed in both the `dependencies` and the `devDependencies` -sections. For environments where you only want to run a program, then -adding an option `npm install --only=prod` or setting the `NODE_ENV` environment -variable to `production` will cause downloads of only the runtime dependencies. +Installation of the package will automatically install any prerequisite packages downloadable from the npm repository. +By default, it will pull in packages listed in both the `dependencies` and the `devDependencies` sections. For +environments where you only want to run a program, then adding an option `npm install --only=prod` or setting the +`NODE_ENV` environment variable to `production` will cause downloads of only the runtime dependencies. ### The MQ C Client libraries The package requires the MQ C client libraries to be installed/available. -For Windows and Linux x64, the npm installation process tries to access -the Redistributable Client packages and unpack them automatically. +For Windows and Linux x64, the npm installation process tries to access the Redistributable Client packages and unpack +them automatically. -Note: IBM removes older levels of the Redistributable Client packages when -they become unsupported. If you want to continue to use older versions of -this package (which will reference those unsupported MQ versions) then you -will have to keep a local copy of the tar/zip files and unpack it as part -of your build process, using the MQIJS_* environment variables to control -installation and runtime. +Note: IBM removes older levels of the Redistributable Client packages when they become unsupported. If you want to +continue to use older versions of this package (which will reference those unsupported MQ versions) then you will have +to keep a local copy of the tar/zip files and unpack it as part of your build process, using the MQIJS_* environment +variables to control installation and runtime. #### Controlling the download location -The download of the Redistributable Client packages will, by default, try to -go to the `public.dhe.ibm.com` site. If that is not reachable - perhaps you are -installing into a machine that does not have access to the public internet - then you -can override the location that the install process tries to use. Set the environment -variable `MQIJS_LOCAL_URL=true` to something like `https://myserver.example.com:8080/MQClients`. +The download of the Redistributable Client packages will, by default, try to go to the `public.dhe.ibm.com` site. If +that is not reachable - perhaps you are installing into a machine that does not have access to the public internet - +then you can override the location that the install process tries to use. Set the environment variable +`MQIJS_LOCAL_URL` to something like `https://myserver.example.com:8080/MQClients`. + +You might also considering copying the Redistributable Client package to one of your own servers, and pointing at that, +as a way of handling any unavailability of the `dhe.ibm.com` site. -If you do not want the automatic installation of the MQ runtime at all, then set the -environment variable `MQIJS_NOREDIST` to any value before running npm install. -The MQ libraries are then be found at runtime using mechanisms such as -searching `LD_LIBRARY_PATH` (Linux) or `PATH` (Windows). +If you do not want the automatic installation of the MQ runtime at all, then set the environment variable +`MQIJS_NOREDIST` to any value before running npm install. The MQ libraries are then be found at runtime using mechanisms +such as searching `LD_LIBRARY_PATH` (Linux) or `PATH` (Windows). ## Controlling the downloaded version -The post-installation program will usually be pointing at the most recent Continuous Delivery -version of MQ (for example 9.1.4.0). These versions of MQ do not have fixpacks released, though -they may have updates available specifically aimed at security vulnerabilities (CSU packages). -You can override both the version (VRM) and fixpack to be installed, assuming that full VRMF -level is still available for download. Setting the environment variables `MQIJS_VRM` and -`MQIJS_FIXPACK` will select a specific Redistributable Client package to be installed. Note that -installing an older VRM than the default in the current version of this package may not work, if -newer options have been introduced to the MQI. At the time of writing this paragraph, the latest -version of MQ was 9.2.0 (with no later CD releases), but there was also a 9.2.0.1 fixpack. If -you want to pick that up instead of the base 9.2.0.0 referred to in postinstall.js, then -set `MQIJS_FIXPACK=1` before running `npm install`. Once newer CD levels are available, then the -postinstall script will point at those instead by default. If you want to select a CSU level (very similar -to a fixpack, but with a more limited scope) then the same environment variable can be used. +The post-installation program will usually be pointing at the most recent Continuous Delivery version of MQ (for example +9.1.4.0). These versions of MQ do not have fixpacks released, though they may have updates available specifically aimed +at security vulnerabilities (CSU packages). You can override both the version (VRM) and fixpack to be installed, +assuming that full VRMF level is still available for download. Setting the environment variables `MQIJS_VRM` and +`MQIJS_FIXPACK` will select a specific Redistributable Client package to be installed. Note that installing an older VRM +than the default in the current version of this package may not work, if newer options have been introduced to the MQI. +At the time of writing this paragraph, the latest version of MQ was 9.2.0 (with no later CD releases), but there was +also a 9.2.0.1 fixpack. If you want to pick that up instead of the base 9.2.0.0 referred to in postinstall.js, then set +`MQIJS_FIXPACK=1` before running `npm install`. Once newer CD levels are available, then the postinstall script will +point at those instead by default. If you want to select a CSU level (very similar to a fixpack, but with a more limited +scope) then the same environment variable can be used. ### Downloading behind a proxy -Downloading the Redistributable C Client libraries behind a proxy is supported. Use the environment -variables `https_proxy` and `no_proxy` to control proxy behaviour. +Downloading the Redistributable C Client libraries behind a proxy is supported. Use the environment variables +`https_proxy` and `no_proxy` to control proxy behaviour. -For example, the following command will use a proxy server at `http://localhost:8080` to download -the redistributable libraries: +For example, the following command will use a proxy server at `http://localhost:8080` to download the redistributable +libraries: ``` % HTTPS_PROXY=http://localhost:8080 npm install ``` -You can disable this behaviour by adding `public.dhe.ibm.com` to the `NO_PROXY` -environment variable. The following command will not use the proxy to download -the redistributable libraries: +You can disable this behaviour by adding `public.dhe.ibm.com` to the `NO_PROXY` environment variable. The following +command will not use the proxy to download the redistributable libraries: ``` % NO_PROXY="public.dhe.ibm.com" HTTPS_PROXY=http://localhost:8080 npm install @@ -264,95 +264,68 @@ Alternatively, you can simply `unset HTTPS_PROXY`. ### MacOS The MQ client package for MacOS can be found at -[this site](http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqdev/mactoolkit). -Download a suitable version and install it in a local directory. The package is signed, and is not a -simple tar/zip format. The environment variable `DYLD_LIBRARY_PATH` then should be set to the -lib64 directory within that tree before running the program. +[this site](https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqdev/mactoolkit). Download a +suitable version and install it in a local directory. The package is signed, and is not a simple tar/zip format. The +environment variable `DYLD_LIBRARY_PATH` then should be set to the lib64 directory within that tree before running the +program. For example `export DYLD_LIBRARY_PATH=/opt/mqm/lib64` #### Errors and warnings during build -If you get an error message such as "gyp: No Xcode or CLT version detected" while -running `npm install` you may need to install the developer tools. Usually -the command `xcode-select --install` will deal with this. +If you get an error message such as "gyp: No Xcode or CLT version detected" while running `npm install` you may need to +install the developer tools. Usually the command `xcode-select --install` will deal with this. ### Other platforms -For other MQ-supported platforms and environments, the C runtime can be -installed from your MQ installation media, or from the full Client downloads at -[this site](http://www-01.ibm.com/support/docview.wss?uid=swg24042176). +For other MQ-supported platforms and environments, the C runtime can be installed from your MQ installation media, or +from the full Client downloads at [this site](http://www-01.ibm.com/support/docview.wss?uid=swg24042176). -The Redistributable Client packages for Windows and Linux x64 are also available -directly from +The Redistributable Client packages for Windows and Linux x64 are also available directly from [this site](http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqdev/redist). -This package cannot currently run on z/OS as the prerequisite MQ libraries are not available there in -the same way as other platforms. However, it might be possible in future to add that platform as there -are no dependencies on 3rd party non-core components (eg lib-ffi) that would never be available on z/OS. - -### Downloading behind a proxy - -Downloading the Redistributable C Client libraries behind a proxy is supported. Use the environment -variables `https_proxy` and `no_proxy` to control proxy behaviour. - -For example, the following command will use a proxy server at `http://localhost:8080` to download -the redistributable libraries: - -``` -% HTTPS_PROXY=http://localhost:8080 npm install -``` - -You can disable this behaviour by adding `public.dhe.ibm.com` to the `NO_PROXY` -environment variable. The following command will not use the proxy to download -the redistributable libraries: - -``` -% NO_PROXY="public.dhe.ibm.com" HTTPS_PROXY=http://localhost:8080 npm install -``` - -Alternatively, you can simply `unset HTTPS_PROXY`. +This package cannot currently run on z/OS as the prerequisite MQ libraries are not available there in the same way as +other platforms. However, it might be possible in future to add that platform as there are no dependencies on 3rd party +non-core components (eg lib-ffi) that would never be available on z/OS. ## Sample applications See the samples [README](samples/README.md) file for more information about the sample programs. ## Containers -The samples directory includes a Dockerfile that can be used as the basis -of generating an independent container to run MQ programs. The **run.docker** -script builds and executes the container. Environment variables are used in -the Dockerfile and the script to control connection to the queue manager. +The samples directory includes a Dockerfile that can be used as the basis of generating an independent container to run +MQ programs. The **run.docker** script builds and executes the container. Environment variables are used in the +Dockerfile and the script to control connection to the queue manager. ## Documentation -The package contains JSDoc comments that can be formatted using the **makedoc** script in the root directory. The generated documentation is then accessible -via a web browser. +The package contains JSDoc comments that can be formatted using the **makedoc** script in the root directory. The +generated documentation is then accessible via a web browser. ## TypeScript The package includes a set of type definitions, suitable for use with TypeScript programs. Some of the sample programs -have also been converted to use types. See the `samples/typescript` directory. These definitions have been tested with the -`tsc` compiler, the `ts-node` front-end, and inside the VSCode IDE. +have also been converted to use types. See the `samples/typescript` directory. These definitions have been tested with +the `tsc` compiler, the `ts-node` front-end, and inside the VSCode IDE. -The initial release of the these definitions should be considered a beta level, to gain feedback on the structure and -naming. It is possible that elements of the types will change in future. ### Bitwise vs Array Options fields To help with syntax checking, many of the fields in the MQI that are normally set with bitwise operations (for example, -`pmo.Options = MQPMO_SYNCPOINT|MQPMO_NEW_CORREL_ID`) can now also be set using an array syntax such -as `pmo.Options = [MQPMO_SYNCPOINT, MQPMO_NEW_CORREL_ID]`. Once you make a choice in your application on which -style to use, you should stay consistent throughout the program. If input to an MQI function uses arrays, then the field -will still be an array on return from the function. It doesn't change shape within the MQI call. But sometimes you may still need -an explicit definition as the fields are defined as having either a number or an array type and the compiler may not know which it -is set to at some places when it needs to validate the code. +`pmo.Options = MQPMO_SYNCPOINT|MQPMO_NEW_CORREL_ID`) can also be set using an array syntax such as +`pmo.Options = [MQPMO_SYNCPOINT, MQPMO_NEW_CORREL_ID]`. Once you make a choice in your application on which style to +use, you should stay consistent throughout the program. If input to an MQI function uses arrays, then the field will +still be an array on return from the function. It doesn't change shape within the MQI call. But sometimes you may still +need an explicit definition as the fields are defined as having either a number or an array type and the compiler may +not know which it is set to at some places when it needs to validate the code. -If you are using the array format, then any elements with the real value 0 will -not show up in the array after an MQI call. For example, `MQPMO_NONE` would not be in the -array following an MQPUT call even if you had set it in the original array. +If you are using the array format, then any elements with the real value 0 will not show up in the array after an MQI +call. For example, `MQPMO_NONE` would not be in the array following an MQPUT call even if you had set it in the original +array. -Interrogating and modifying the options fields has to be done by being explicit about how the field is being used. For example, +Interrogating and modifying the options fields has to be done by being explicit about how the field is being used. For +example, ``` pmo.Options = [MQC.MQPMO_NO_SYNCPOINT, MQC.MQPMO_NEW_MSG_ID, MQC.MQPMO_NEW_CORREL_ID]; @@ -366,8 +339,7 @@ Interrogating and modifying the options fields has to be done by being explicit } ``` -and an example from the `amqsbra.ts`example where we use the bitwise operations to modify -a field: +and an example from the `amqsbra.ts`example where we use the bitwise operations to modify a field: ``` gmo!.Options = ((gmo!.Options as number) & ~MQC.MQGMO_BROWSE_FIRST); @@ -380,28 +352,25 @@ See [CHANGES](CHANGES.md). ## Health Warning -This package is provided as-is with no guarantees of support or updates. You cannot use -IBM formal support channels (Cases/PMRs) for assistance with material in this repository. +This package is provided as-is with no guarantees of support or updates. You cannot use IBM formal support channels +(Cases/PMRs) for assistance with material in this repository. -There are also no guarantees of compatibility with any future versions of the package; the API -is subject to change based on any feedback. Versioned releases are made in this repository -to assist with using stable APIs. Future versions will follow semver guidance so that breaking changes -will only be done with a new major version number. +based on any feedback. Versioned releases are made in this repository to assist with using stable APIs. Future versions +There are also no guarantees of compatibility with any future versions of the package; the API is subject to change +will follow semver guidance so that breaking changes will only be done with a new major version number. ## Issues and Contributions For feedback and issues relating specifically to this package, please use the [GitHub issue tracker](https://github.com/ibm-messaging/mq-mqi-nodejs/issues). -Contributions to this package can be accepted under the terms of the Developer's Certificate -of Origin, found in the [DCO file](DCO1.1.txt) of this repository. When -submitting a pull request, you must include a statement stating you accept the terms -in the DCO. +Contributions to this package can be accepted under the terms of the Developer's Certificate of Origin, found in the +[DCO file](DCO1.1.txt) of this repository. When submitting a pull request, you must include a statement stating you +accept the terms in the DCO. ## Acknowledgements -Thanks to the IBM App Connect team for the initial implementation of the -asynchronous MQI variations. Their work has been adopted and adapted into -this library. +Thanks to the IBM App Connect team for the initial implementation of the asynchronous MQI variations. Their work has +been adopted and adapted into this library. Thanks to Andre Asselin for the TypeScript definitions and sample program conversions. diff --git a/lib/mqcd.js b/lib/mqcd.js index 543b306..3b255f8 100644 --- a/lib/mqcd.js +++ b/lib/mqcd.js @@ -37,7 +37,7 @@ var MQC = require('./mqidefs.js'); * @classdesc * This is a class containing the fields needed for the MQCD * (MQ Channel Definition) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q108220_.htm|MQ Knowledge Center} + * {@link https://www.ibm.com/docs/en/ibm-mq/latest?topic=definition-fields|MQ Documentation} * for more details on the usage of each field. * Not all of the underlying fields may be exposed in this object. */ @@ -61,7 +61,7 @@ exports.MQCD = function() { /** @member {String} */ this.SSLPeerName = null; /** @member {number} */ - this.SSLClientAuth = MQC.MQSCA_REQUIRED; + this.SSLClientAuth = MQC.MQSCA_REQUIRED; // Not used by client, but leave in here for compatibility /** @member {number} */ this.KeepAliveInterval = -1; /** @member {number} */ diff --git a/lib/mqcno.js b/lib/mqcno.js index 5638c67..97c3eb9 100755 --- a/lib/mqcno.js +++ b/lib/mqcno.js @@ -39,7 +39,7 @@ var MQCSP = require('./mqcsp.js'); // Security Parms * @classdesc * This is a class containing the fields needed for the MQCNO * (MQ Connection Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q095410_.htm|MQ Knowledge Center} + * {@link https://www.ibm.com/docs/en/ibm-mq/latest?topic=mqi-mqcno-connect-options|MQ Documentation} * for more details on the usage of each field. * Not all of the underlying fields may be exposed in this object. */ diff --git a/lib/mqcsp.js b/lib/mqcsp.js index 50a6aec..52e1980 100755 --- a/lib/mqcsp.js +++ b/lib/mqcsp.js @@ -35,7 +35,7 @@ var MQC = require('./mqidefs.js'); * @classdesc * This is a class containing the fields needed for the MQCSP * (MQ Connection Security Parameters) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q095610_.htm|MQ Knowledge Center} + * {@link https://www.ibm.com/docs/en/ibm-mq/latest?topic=mqi-mqcsp-security-parameters|MQ Documentation} * for more details on the usage of each field. * Not all of the underlying fields may be exposed in this object. For example, * unlike the regular MQI, we don't bother exposing the authenticationType @@ -47,7 +47,7 @@ exports.MQCSP = function() { this.UserId = null; /** @member {String} */ this.Password = null; - this._authenticationType = MQC.MQCSP_NONE; + this._authenticationType = MQC.MQCSP_AUTH_NONE; /** @member {String} */ this.InitialKey = null; /** @member {String} */ diff --git a/lib/mqgmo.js b/lib/mqgmo.js index 95fa522..8dc78b9 100644 --- a/lib/mqgmo.js +++ b/lib/mqgmo.js @@ -38,7 +38,7 @@ const log = require('./mqilogger.js'); * @classdesc * This is a class containing the fields needed for the MQGMO * (MQ Get Message Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q096710_.htm|MQ Knowledge Center} + * {@link https://www.ibm.com/docs/en/ibm-mq/latest?topic=mqi-mqgmo-get-message-options|MQ Documentation} * for more details on the usage of each field. * Not all of the underlying fields may be exposed in this object. *

Note: This sets the FIQ flag by default, which is not standard in the MQI diff --git a/lib/mqi.js b/lib/mqi.js index e116a8a..e26e8e5 100644 --- a/lib/mqi.js +++ b/lib/mqi.js @@ -34,7 +34,7 @@ * same verbs and structures as the C or COBOL interface, but with a more * natural syntax, removing the need for a JavaScript developer to worry about * how to map to the native C libraries. - *

This contrasts with the MQ Light API and MQTT interface + *

This contrasts with the AMQP and MQTT interface * that are also available for Node.js, but are tied to a publish/subscribe * messaging model. MQ also incorporates a simple REST API for direct access to * the messaging service, but that too does not give the full flexibility of @@ -53,9 +53,7 @@ * field names are rejected. * *

Sample programs are included with the package to demonstrate how to use it. - * See {@link https://marketaylor.synology.me/?p=505|here} for - * more discussion of the interface. - * + * * @author Mark Taylor * @copyright Copyright (c) IBM Corporation 2017, 2023 */ @@ -452,7 +450,7 @@ function _connx(jsqMgrName, jscno, async, cb) { throw new TypeError('Parameter must be of type MQBNO'); } savedBnoOptions = jsbno.Options; - jsbno.Options = mqt.flagsToNumber('MQCNO', jscno.Options); + jsbno.Options = mqt.flagsToNumber('MQBNO', jsbno.Options); } if (async) { diff --git a/lib/mqidefs_aix.js b/lib/mqidefs_aix.js index 3f0b9c7..5cec093 100644 --- a/lib/mqidefs_aix.js +++ b/lib/mqidefs_aix.js @@ -31,8 +31,8 @@ * * * - * Generated on: 5/31/23 12:58 PM - * Build Level: p933-L230531 + * Generated on: 9/27/23 11:53 AM + * Build Level: p934-L230927 * Build Type: Production * */ @@ -1034,7 +1034,7 @@ module.exports = Object.freeze ({ , MQCMDI_SEC_SIGNOFF_ERROR :17 , MQCMDI_SEC_TIMER_ZERO :14 , MQCMDI_SEC_UPPERCASE :21 -, MQCMDL_CURRENT_LEVEL :933 +, MQCMDL_CURRENT_LEVEL :934 , MQCMDL_LEVEL_1 :100 , MQCMDL_LEVEL_101 :101 , MQCMDL_LEVEL_110 :110 @@ -1085,6 +1085,7 @@ module.exports = Object.freeze ({ , MQCMDL_LEVEL_931 :931 , MQCMDL_LEVEL_932 :932 , MQCMDL_LEVEL_933 :933 +, MQCMDL_LEVEL_934 :934 , MQCMD_ACCOUNTING_MQI :167 , MQCMD_ACCOUNTING_Q :168 , MQCMD_ACTIVITY_MSG :69 @@ -1372,14 +1373,17 @@ module.exports = Object.freeze ({ , MQCRC_PROGRAM_NOT_AVAILABLE :7 , MQCRC_SECURITY_ERROR :6 , MQCRC_TRANSID_NOT_AVAILABLE :9 +, MQCSP_AUTH_ID_TOKEN :2 , MQCSP_AUTH_NONE :0 , MQCSP_AUTH_USER_ID_AND_PWD :1 -, MQCSP_CURRENT_LENGTH :80 -, MQCSP_CURRENT_VERSION :2 +, MQCSP_CURRENT_LENGTH :104 +, MQCSP_CURRENT_VERSION :3 , MQCSP_LENGTH_1 :56 , MQCSP_LENGTH_2 :80 +, MQCSP_LENGTH_3 :104 , MQCSP_VERSION_1 :1 , MQCSP_VERSION_2 :2 +, MQCSP_VERSION_3 :3 , MQCSRV_CONVERT_NO :0 , MQCSRV_CONVERT_YES :1 , MQCSRV_DLQ_NO :0 @@ -4137,6 +4141,7 @@ module.exports = Object.freeze ({ , MQRC_TERMINATION_FAILED :2287 , MQRC_TMC_ERROR :2191 , MQRC_TM_ERROR :2265 +, MQRC_TOKEN_TIMESTAMP_NOT_VALID :2064 , MQRC_TOPIC_NOT_ALTERABLE :2510 , MQRC_TOPIC_STRING_ERROR :2425 , MQRC_TRIGGER_CONTROL_ERROR :2075 @@ -4993,6 +4998,7 @@ module.exports = Object.freeze ({ , MQ_CREATION_DATE_LENGTH :12 , MQ_CREATION_TIME_LENGTH :8 , MQ_CSP_PASSWORD_LENGTH :256 +, MQ_CSP_TOKEN_LENGTH :8192 , MQ_CUSTOM_LENGTH :128 , MQ_DATA_SET_NAME_LENGTH :44 , MQ_DATE_LENGTH :12 diff --git a/lib/mqidefs_darwin.js b/lib/mqidefs_darwin.js index b91d120..fdddc19 100644 --- a/lib/mqidefs_darwin.js +++ b/lib/mqidefs_darwin.js @@ -31,8 +31,8 @@ * * * - * Generated on: 5/31/23 12:58 PM - * Build Level: p933-L230531 + * Generated on: 9/27/23 11:53 AM + * Build Level: p934-L230927 * Build Type: Production * */ @@ -1034,7 +1034,7 @@ module.exports = Object.freeze ({ , MQCMDI_SEC_SIGNOFF_ERROR :17 , MQCMDI_SEC_TIMER_ZERO :14 , MQCMDI_SEC_UPPERCASE :21 -, MQCMDL_CURRENT_LEVEL :933 +, MQCMDL_CURRENT_LEVEL :934 , MQCMDL_LEVEL_1 :100 , MQCMDL_LEVEL_101 :101 , MQCMDL_LEVEL_110 :110 @@ -1085,6 +1085,7 @@ module.exports = Object.freeze ({ , MQCMDL_LEVEL_931 :931 , MQCMDL_LEVEL_932 :932 , MQCMDL_LEVEL_933 :933 +, MQCMDL_LEVEL_934 :934 , MQCMD_ACCOUNTING_MQI :167 , MQCMD_ACCOUNTING_Q :168 , MQCMD_ACTIVITY_MSG :69 @@ -1372,14 +1373,17 @@ module.exports = Object.freeze ({ , MQCRC_PROGRAM_NOT_AVAILABLE :7 , MQCRC_SECURITY_ERROR :6 , MQCRC_TRANSID_NOT_AVAILABLE :9 +, MQCSP_AUTH_ID_TOKEN :2 , MQCSP_AUTH_NONE :0 , MQCSP_AUTH_USER_ID_AND_PWD :1 -, MQCSP_CURRENT_LENGTH :80 -, MQCSP_CURRENT_VERSION :2 +, MQCSP_CURRENT_LENGTH :104 +, MQCSP_CURRENT_VERSION :3 , MQCSP_LENGTH_1 :56 , MQCSP_LENGTH_2 :80 +, MQCSP_LENGTH_3 :104 , MQCSP_VERSION_1 :1 , MQCSP_VERSION_2 :2 +, MQCSP_VERSION_3 :3 , MQCSRV_CONVERT_NO :0 , MQCSRV_CONVERT_YES :1 , MQCSRV_DLQ_NO :0 @@ -4137,6 +4141,7 @@ module.exports = Object.freeze ({ , MQRC_TERMINATION_FAILED :2287 , MQRC_TMC_ERROR :2191 , MQRC_TM_ERROR :2265 +, MQRC_TOKEN_TIMESTAMP_NOT_VALID :2064 , MQRC_TOPIC_NOT_ALTERABLE :2510 , MQRC_TOPIC_STRING_ERROR :2425 , MQRC_TRIGGER_CONTROL_ERROR :2075 @@ -4993,6 +4998,7 @@ module.exports = Object.freeze ({ , MQ_CREATION_DATE_LENGTH :12 , MQ_CREATION_TIME_LENGTH :8 , MQ_CSP_PASSWORD_LENGTH :256 +, MQ_CSP_TOKEN_LENGTH :8192 , MQ_CUSTOM_LENGTH :128 , MQ_DATA_SET_NAME_LENGTH :44 , MQ_DATE_LENGTH :12 diff --git a/lib/mqidefs_linuxARM.js b/lib/mqidefs_linuxARM.js index db5eec4..0adfd78 100644 --- a/lib/mqidefs_linuxARM.js +++ b/lib/mqidefs_linuxARM.js @@ -31,8 +31,8 @@ * * * - * Generated on: 5/31/23 12:58 PM - * Build Level: p933-L230531 + * Generated on: 9/27/23 11:53 AM + * Build Level: p934-L230927 * Build Type: Production * */ @@ -1034,7 +1034,7 @@ module.exports = Object.freeze ({ , MQCMDI_SEC_SIGNOFF_ERROR :17 , MQCMDI_SEC_TIMER_ZERO :14 , MQCMDI_SEC_UPPERCASE :21 -, MQCMDL_CURRENT_LEVEL :933 +, MQCMDL_CURRENT_LEVEL :934 , MQCMDL_LEVEL_1 :100 , MQCMDL_LEVEL_101 :101 , MQCMDL_LEVEL_110 :110 @@ -1085,6 +1085,7 @@ module.exports = Object.freeze ({ , MQCMDL_LEVEL_931 :931 , MQCMDL_LEVEL_932 :932 , MQCMDL_LEVEL_933 :933 +, MQCMDL_LEVEL_934 :934 , MQCMD_ACCOUNTING_MQI :167 , MQCMD_ACCOUNTING_Q :168 , MQCMD_ACTIVITY_MSG :69 @@ -1372,14 +1373,17 @@ module.exports = Object.freeze ({ , MQCRC_PROGRAM_NOT_AVAILABLE :7 , MQCRC_SECURITY_ERROR :6 , MQCRC_TRANSID_NOT_AVAILABLE :9 +, MQCSP_AUTH_ID_TOKEN :2 , MQCSP_AUTH_NONE :0 , MQCSP_AUTH_USER_ID_AND_PWD :1 -, MQCSP_CURRENT_LENGTH :80 -, MQCSP_CURRENT_VERSION :2 +, MQCSP_CURRENT_LENGTH :104 +, MQCSP_CURRENT_VERSION :3 , MQCSP_LENGTH_1 :56 , MQCSP_LENGTH_2 :80 +, MQCSP_LENGTH_3 :104 , MQCSP_VERSION_1 :1 , MQCSP_VERSION_2 :2 +, MQCSP_VERSION_3 :3 , MQCSRV_CONVERT_NO :0 , MQCSRV_CONVERT_YES :1 , MQCSRV_DLQ_NO :0 @@ -4137,6 +4141,7 @@ module.exports = Object.freeze ({ , MQRC_TERMINATION_FAILED :2287 , MQRC_TMC_ERROR :2191 , MQRC_TM_ERROR :2265 +, MQRC_TOKEN_TIMESTAMP_NOT_VALID :2064 , MQRC_TOPIC_NOT_ALTERABLE :2510 , MQRC_TOPIC_STRING_ERROR :2425 , MQRC_TRIGGER_CONTROL_ERROR :2075 @@ -4993,6 +4998,7 @@ module.exports = Object.freeze ({ , MQ_CREATION_DATE_LENGTH :12 , MQ_CREATION_TIME_LENGTH :8 , MQ_CSP_PASSWORD_LENGTH :256 +, MQ_CSP_TOKEN_LENGTH :8192 , MQ_CUSTOM_LENGTH :128 , MQ_DATA_SET_NAME_LENGTH :44 , MQ_DATE_LENGTH :12 diff --git a/lib/mqidefs_linuxIntel.js b/lib/mqidefs_linuxIntel.js index 3f8e682..2875797 100644 --- a/lib/mqidefs_linuxIntel.js +++ b/lib/mqidefs_linuxIntel.js @@ -31,8 +31,8 @@ * * * - * Generated on: 5/31/23 12:58 PM - * Build Level: p933-L230531 + * Generated on: 9/27/23 11:53 AM + * Build Level: p934-L230927 * Build Type: Production * */ @@ -1034,7 +1034,7 @@ module.exports = Object.freeze ({ , MQCMDI_SEC_SIGNOFF_ERROR :17 , MQCMDI_SEC_TIMER_ZERO :14 , MQCMDI_SEC_UPPERCASE :21 -, MQCMDL_CURRENT_LEVEL :933 +, MQCMDL_CURRENT_LEVEL :934 , MQCMDL_LEVEL_1 :100 , MQCMDL_LEVEL_101 :101 , MQCMDL_LEVEL_110 :110 @@ -1085,6 +1085,7 @@ module.exports = Object.freeze ({ , MQCMDL_LEVEL_931 :931 , MQCMDL_LEVEL_932 :932 , MQCMDL_LEVEL_933 :933 +, MQCMDL_LEVEL_934 :934 , MQCMD_ACCOUNTING_MQI :167 , MQCMD_ACCOUNTING_Q :168 , MQCMD_ACTIVITY_MSG :69 @@ -1372,14 +1373,17 @@ module.exports = Object.freeze ({ , MQCRC_PROGRAM_NOT_AVAILABLE :7 , MQCRC_SECURITY_ERROR :6 , MQCRC_TRANSID_NOT_AVAILABLE :9 +, MQCSP_AUTH_ID_TOKEN :2 , MQCSP_AUTH_NONE :0 , MQCSP_AUTH_USER_ID_AND_PWD :1 -, MQCSP_CURRENT_LENGTH :80 -, MQCSP_CURRENT_VERSION :2 +, MQCSP_CURRENT_LENGTH :104 +, MQCSP_CURRENT_VERSION :3 , MQCSP_LENGTH_1 :56 , MQCSP_LENGTH_2 :80 +, MQCSP_LENGTH_3 :104 , MQCSP_VERSION_1 :1 , MQCSP_VERSION_2 :2 +, MQCSP_VERSION_3 :3 , MQCSRV_CONVERT_NO :0 , MQCSRV_CONVERT_YES :1 , MQCSRV_DLQ_NO :0 @@ -4137,6 +4141,7 @@ module.exports = Object.freeze ({ , MQRC_TERMINATION_FAILED :2287 , MQRC_TMC_ERROR :2191 , MQRC_TM_ERROR :2265 +, MQRC_TOKEN_TIMESTAMP_NOT_VALID :2064 , MQRC_TOPIC_NOT_ALTERABLE :2510 , MQRC_TOPIC_STRING_ERROR :2425 , MQRC_TRIGGER_CONTROL_ERROR :2075 @@ -4993,6 +4998,7 @@ module.exports = Object.freeze ({ , MQ_CREATION_DATE_LENGTH :12 , MQ_CREATION_TIME_LENGTH :8 , MQ_CSP_PASSWORD_LENGTH :256 +, MQ_CSP_TOKEN_LENGTH :8192 , MQ_CUSTOM_LENGTH :128 , MQ_DATA_SET_NAME_LENGTH :44 , MQ_DATE_LENGTH :12 diff --git a/lib/mqidefs_linuxPowerLE.js b/lib/mqidefs_linuxPowerLE.js index ab59d3c..5ad08cf 100644 --- a/lib/mqidefs_linuxPowerLE.js +++ b/lib/mqidefs_linuxPowerLE.js @@ -31,8 +31,8 @@ * * * - * Generated on: 5/31/23 12:58 PM - * Build Level: p933-L230531 + * Generated on: 9/27/23 11:53 AM + * Build Level: p934-L230927 * Build Type: Production * */ @@ -1034,7 +1034,7 @@ module.exports = Object.freeze ({ , MQCMDI_SEC_SIGNOFF_ERROR :17 , MQCMDI_SEC_TIMER_ZERO :14 , MQCMDI_SEC_UPPERCASE :21 -, MQCMDL_CURRENT_LEVEL :933 +, MQCMDL_CURRENT_LEVEL :934 , MQCMDL_LEVEL_1 :100 , MQCMDL_LEVEL_101 :101 , MQCMDL_LEVEL_110 :110 @@ -1085,6 +1085,7 @@ module.exports = Object.freeze ({ , MQCMDL_LEVEL_931 :931 , MQCMDL_LEVEL_932 :932 , MQCMDL_LEVEL_933 :933 +, MQCMDL_LEVEL_934 :934 , MQCMD_ACCOUNTING_MQI :167 , MQCMD_ACCOUNTING_Q :168 , MQCMD_ACTIVITY_MSG :69 @@ -1372,14 +1373,17 @@ module.exports = Object.freeze ({ , MQCRC_PROGRAM_NOT_AVAILABLE :7 , MQCRC_SECURITY_ERROR :6 , MQCRC_TRANSID_NOT_AVAILABLE :9 +, MQCSP_AUTH_ID_TOKEN :2 , MQCSP_AUTH_NONE :0 , MQCSP_AUTH_USER_ID_AND_PWD :1 -, MQCSP_CURRENT_LENGTH :80 -, MQCSP_CURRENT_VERSION :2 +, MQCSP_CURRENT_LENGTH :104 +, MQCSP_CURRENT_VERSION :3 , MQCSP_LENGTH_1 :56 , MQCSP_LENGTH_2 :80 +, MQCSP_LENGTH_3 :104 , MQCSP_VERSION_1 :1 , MQCSP_VERSION_2 :2 +, MQCSP_VERSION_3 :3 , MQCSRV_CONVERT_NO :0 , MQCSRV_CONVERT_YES :1 , MQCSRV_DLQ_NO :0 @@ -4137,6 +4141,7 @@ module.exports = Object.freeze ({ , MQRC_TERMINATION_FAILED :2287 , MQRC_TMC_ERROR :2191 , MQRC_TM_ERROR :2265 +, MQRC_TOKEN_TIMESTAMP_NOT_VALID :2064 , MQRC_TOPIC_NOT_ALTERABLE :2510 , MQRC_TOPIC_STRING_ERROR :2425 , MQRC_TRIGGER_CONTROL_ERROR :2075 @@ -4993,6 +4998,7 @@ module.exports = Object.freeze ({ , MQ_CREATION_DATE_LENGTH :12 , MQ_CREATION_TIME_LENGTH :8 , MQ_CSP_PASSWORD_LENGTH :256 +, MQ_CSP_TOKEN_LENGTH :8192 , MQ_CUSTOM_LENGTH :128 , MQ_DATA_SET_NAME_LENGTH :44 , MQ_DATE_LENGTH :12 diff --git a/lib/mqidefs_linuxS390.js b/lib/mqidefs_linuxS390.js index cec513e..32b043a 100644 --- a/lib/mqidefs_linuxS390.js +++ b/lib/mqidefs_linuxS390.js @@ -31,8 +31,8 @@ * * * - * Generated on: 5/31/23 12:58 PM - * Build Level: p933-L230531 + * Generated on: 9/27/23 11:53 AM + * Build Level: p934-L230927 * Build Type: Production * */ @@ -1034,7 +1034,7 @@ module.exports = Object.freeze ({ , MQCMDI_SEC_SIGNOFF_ERROR :17 , MQCMDI_SEC_TIMER_ZERO :14 , MQCMDI_SEC_UPPERCASE :21 -, MQCMDL_CURRENT_LEVEL :933 +, MQCMDL_CURRENT_LEVEL :934 , MQCMDL_LEVEL_1 :100 , MQCMDL_LEVEL_101 :101 , MQCMDL_LEVEL_110 :110 @@ -1085,6 +1085,7 @@ module.exports = Object.freeze ({ , MQCMDL_LEVEL_931 :931 , MQCMDL_LEVEL_932 :932 , MQCMDL_LEVEL_933 :933 +, MQCMDL_LEVEL_934 :934 , MQCMD_ACCOUNTING_MQI :167 , MQCMD_ACCOUNTING_Q :168 , MQCMD_ACTIVITY_MSG :69 @@ -1372,14 +1373,17 @@ module.exports = Object.freeze ({ , MQCRC_PROGRAM_NOT_AVAILABLE :7 , MQCRC_SECURITY_ERROR :6 , MQCRC_TRANSID_NOT_AVAILABLE :9 +, MQCSP_AUTH_ID_TOKEN :2 , MQCSP_AUTH_NONE :0 , MQCSP_AUTH_USER_ID_AND_PWD :1 -, MQCSP_CURRENT_LENGTH :80 -, MQCSP_CURRENT_VERSION :2 +, MQCSP_CURRENT_LENGTH :104 +, MQCSP_CURRENT_VERSION :3 , MQCSP_LENGTH_1 :56 , MQCSP_LENGTH_2 :80 +, MQCSP_LENGTH_3 :104 , MQCSP_VERSION_1 :1 , MQCSP_VERSION_2 :2 +, MQCSP_VERSION_3 :3 , MQCSRV_CONVERT_NO :0 , MQCSRV_CONVERT_YES :1 , MQCSRV_DLQ_NO :0 @@ -4137,6 +4141,7 @@ module.exports = Object.freeze ({ , MQRC_TERMINATION_FAILED :2287 , MQRC_TMC_ERROR :2191 , MQRC_TM_ERROR :2265 +, MQRC_TOKEN_TIMESTAMP_NOT_VALID :2064 , MQRC_TOPIC_NOT_ALTERABLE :2510 , MQRC_TOPIC_STRING_ERROR :2425 , MQRC_TRIGGER_CONTROL_ERROR :2075 @@ -4993,6 +4998,7 @@ module.exports = Object.freeze ({ , MQ_CREATION_DATE_LENGTH :12 , MQ_CREATION_TIME_LENGTH :8 , MQ_CSP_PASSWORD_LENGTH :256 +, MQ_CSP_TOKEN_LENGTH :8192 , MQ_CUSTOM_LENGTH :128 , MQ_DATA_SET_NAME_LENGTH :44 , MQ_DATE_LENGTH :12 diff --git a/lib/mqidefs_windows.js b/lib/mqidefs_windows.js index dcdca42..c1c98bf 100644 --- a/lib/mqidefs_windows.js +++ b/lib/mqidefs_windows.js @@ -31,8 +31,8 @@ * * * - * Generated on: 5/31/23 12:58 PM - * Build Level: p933-L230531 + * Generated on: 9/27/23 11:53 AM + * Build Level: p934-L230927 * Build Type: Production * */ @@ -1034,7 +1034,7 @@ module.exports = Object.freeze ({ , MQCMDI_SEC_SIGNOFF_ERROR :17 , MQCMDI_SEC_TIMER_ZERO :14 , MQCMDI_SEC_UPPERCASE :21 -, MQCMDL_CURRENT_LEVEL :933 +, MQCMDL_CURRENT_LEVEL :934 , MQCMDL_LEVEL_1 :100 , MQCMDL_LEVEL_101 :101 , MQCMDL_LEVEL_110 :110 @@ -1085,6 +1085,7 @@ module.exports = Object.freeze ({ , MQCMDL_LEVEL_931 :931 , MQCMDL_LEVEL_932 :932 , MQCMDL_LEVEL_933 :933 +, MQCMDL_LEVEL_934 :934 , MQCMD_ACCOUNTING_MQI :167 , MQCMD_ACCOUNTING_Q :168 , MQCMD_ACTIVITY_MSG :69 @@ -1372,14 +1373,17 @@ module.exports = Object.freeze ({ , MQCRC_PROGRAM_NOT_AVAILABLE :7 , MQCRC_SECURITY_ERROR :6 , MQCRC_TRANSID_NOT_AVAILABLE :9 +, MQCSP_AUTH_ID_TOKEN :2 , MQCSP_AUTH_NONE :0 , MQCSP_AUTH_USER_ID_AND_PWD :1 -, MQCSP_CURRENT_LENGTH :80 -, MQCSP_CURRENT_VERSION :2 +, MQCSP_CURRENT_LENGTH :104 +, MQCSP_CURRENT_VERSION :3 , MQCSP_LENGTH_1 :56 , MQCSP_LENGTH_2 :80 +, MQCSP_LENGTH_3 :104 , MQCSP_VERSION_1 :1 , MQCSP_VERSION_2 :2 +, MQCSP_VERSION_3 :3 , MQCSRV_CONVERT_NO :0 , MQCSRV_CONVERT_YES :1 , MQCSRV_DLQ_NO :0 @@ -4137,6 +4141,7 @@ module.exports = Object.freeze ({ , MQRC_TERMINATION_FAILED :2287 , MQRC_TMC_ERROR :2191 , MQRC_TM_ERROR :2265 +, MQRC_TOKEN_TIMESTAMP_NOT_VALID :2064 , MQRC_TOPIC_NOT_ALTERABLE :2510 , MQRC_TOPIC_STRING_ERROR :2425 , MQRC_TRIGGER_CONTROL_ERROR :2075 @@ -4993,6 +4998,7 @@ module.exports = Object.freeze ({ , MQ_CREATION_DATE_LENGTH :12 , MQ_CREATION_TIME_LENGTH :8 , MQ_CSP_PASSWORD_LENGTH :256 +, MQ_CSP_TOKEN_LENGTH :8192 , MQ_CUSTOM_LENGTH :128 , MQ_DATA_SET_NAME_LENGTH :44 , MQ_DATE_LENGTH :12 diff --git a/lib/mqistrings.js b/lib/mqistrings.js index df58b92..24df673 100644 --- a/lib/mqistrings.js +++ b/lib/mqistrings.js @@ -1748,6 +1748,7 @@ case 931: c = "MQCMDL_LEVEL_931"; break; case 932: c = "MQCMDL_LEVEL_932"; break; case 933: c = "MQCMDL_LEVEL_933"; break; + case 934: c = "MQCMDL_LEVEL_934"; break; default: c = ""; break; } return c; @@ -2110,6 +2111,7 @@ { case 0: c = "MQCSP_AUTH_NONE"; break; case 1: c = "MQCSP_AUTH_USER_ID_AND_PWD"; break; + case 2: c = "MQCSP_AUTH_ID_TOKEN"; break; default: c = ""; break; } return c; @@ -5756,6 +5758,7 @@ case 2061: c = "MQRC_REPORT_OPTIONS_ERROR"; break; case 2062: c = "MQRC_SECOND_MARK_NOT_ALLOWED"; break; case 2063: c = "MQRC_SECURITY_ERROR"; break; + case 2064: c = "MQRC_TOKEN_TIMESTAMP_NOT_VALID"; break; case 2065: c = "MQRC_SELECTOR_COUNT_ERROR"; break; case 2066: c = "MQRC_SELECTOR_LIMIT_EXCEEDED"; break; case 2067: c = "MQRC_SELECTOR_ERROR"; break; diff --git a/lib/mqmd.js b/lib/mqmd.js index 90be85f..3e36350 100644 --- a/lib/mqmd.js +++ b/lib/mqmd.js @@ -36,7 +36,7 @@ const log = require('./mqilogger.js'); * @classdesc * This is a class containing the fields needed for the MQMD * (MQ Message Descriptor) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097390_.htm|MQ Knowledge Center} + * {@link https://www.ibm.com/docs/en/ibm-mq/latest?topic=mqi-mqmd-message-descriptor|MQ Documentation} * for more details on the usage of each field. * Not all of the underlying fields may be exposed in this object. */ diff --git a/lib/mqmho.js b/lib/mqmho.js index b4343f0..2896007 100644 --- a/lib/mqmho.js +++ b/lib/mqmho.js @@ -32,7 +32,7 @@ var MQC = require('./mqidefs.js'); * @classdesc * This is a class containing the fields needed for the MQCMHO * (MQ Create Message Handle Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q095320_.htm|MQ Knowledge Center} + * {@link https://www.ibm.com/docs/en/ibm-mq/latest?topic=mqi-mqcmho-create-message-handle-options|MQ Documentation} * for more details on the usage of each field. */ exports.MQCMHO = function() { @@ -47,7 +47,7 @@ exports.MQCMHO = function() { * @classdesc * This is a class containing the fields needed for the MQDMHO * (MQ Delete Message Handle Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q096320_.htm|MQ Knowledge Center} + * {@link https://www.ibm.com/docs/en/ibm-mq/latest?topic=mqi-mqdmho-delete-message-handle-options|MQ Documentation} * for more details on the usage of each field. */ exports.MQDMHO = function() { diff --git a/lib/mqmpo.js b/lib/mqmpo.js index 0a11a91..6dd13df 100644 --- a/lib/mqmpo.js +++ b/lib/mqmpo.js @@ -32,7 +32,7 @@ var MQC = require('./mqidefs.js'); * @classdesc * This is a class containing the fields needed for the MQIMPO * (MQ Inquire Message Property Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097210_.htm|MQ Knowledge Center} + * {@link https://www.ibm.com/docs/en/ibm-mq/latest?topic=mqi-mqimpo-inquire-message-property-options|MQ Documentation} * for more details on the usage of each field. */ exports.MQIMPO = function() { @@ -55,7 +55,7 @@ exports.MQIMPO = function() { * @classdesc * This is a class containing the fields needed for the MQSMPO * (MQ Set Message Property Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q100270_.htm|MQ Knowledge Center} + * {@link https://www.ibm.com/docs/en/ibm-mq/latest?topic=mqi-mqsmpo-set-message-property-options|MQ Documentation} * for more details on the usage of each field. */ exports.MQSMPO = function() { @@ -70,7 +70,7 @@ exports.MQSMPO = function() { * @classdesc * This is a class containing the fields needed for the MQDMPO * (MQ Delete Message Property Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q096430_.htm|MQ Knowledge Center} + * {@link https://www.ibm.com/docs/en/ibm-mq/latest?topic=mqi-mqdmpo-delete-message-property-options|MQ Documentation} * for more details on the usage of each field. */ exports.MQDMPO = function() { @@ -85,7 +85,7 @@ exports.MQDMPO = function() { * @classdesc * This is a class containing the fields needed for the MQPD * (MQ Property Descriptor) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q098510_.htm|MQ Knowledge Center} + * {@link https://www.ibm.com/docs/en/ibm-mq/latest?topic=mqi-mqpd-property-descriptor|MQ Documentation} * for more details on the usage of each field. */ exports.MQPD = function() { diff --git a/lib/mqod.js b/lib/mqod.js index 9a8934b..004abfa 100755 --- a/lib/mqod.js +++ b/lib/mqod.js @@ -28,7 +28,7 @@ var MQC = require('./mqidefs.js'); * @classdesc * This is a class containing the fields needed for the MQOD * (MQ Object Descriptor) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q098100_.htm|MQ Knowledge Center} + * {@link https://www.ibm.com/docs/en/ibm-mq/latest?topic=mqi-mqod-object-descriptor|MQ Documentation} * for more details on the usage of each field. * Not all of the underlying fields may be exposed in this object. */ diff --git a/lib/mqpmo.js b/lib/mqpmo.js index d0b9b07..cadb224 100644 --- a/lib/mqpmo.js +++ b/lib/mqpmo.js @@ -38,7 +38,7 @@ const log = require('./mqilogger.js'); * @classdesc * This is a class containing the fields needed for the MQPMO * (MQ Put Message Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q098650_.htm|MQ Knowledge Center} + * {@link https://www.ibm.com/docs/en/ibm-mq/latest?topic=mqi-mqpmo-put-message-options|MQ Documentation} * for more details on the usage of each field. * Not all of the underlying fields may be exposed in this object. *

Note: This sets the FIQ flag by default, which is not standard in the MQI diff --git a/lib/mqsco.js b/lib/mqsco.js index 6b64194..d802288 100644 --- a/lib/mqsco.js +++ b/lib/mqsco.js @@ -37,12 +37,8 @@ var MQC = require('./mqidefs.js'); * @classdesc * This is a class containing the fields needed for the MQSCO * (MQ SSL/TLS Configuration Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q099820_.htm|MQ Knowledge Center} + * {@link https://www.ibm.com/docs/en/ibm-mq/latest?topic=mqi-mqsco-ssltls-configuration-options|MQ Documentation} * for more details on the usage of each field. - * Note the warnings in the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q095520_.htm|MQ Knowledge Center} - * about the process-wide, once-only definition of this structure and - * the MQRC_SSL_ALREADY_INITIALIZED warning reason code. */ exports.MQSCO = function() { /** @member {String} */ diff --git a/lib/mqsd.js b/lib/mqsd.js index 603b5b9..e219811 100755 --- a/lib/mqsd.js +++ b/lib/mqsd.js @@ -34,7 +34,7 @@ var MQC = require('./mqidefs.js'); * @classdesc * This is a class containing the fields needed for the MQSD * (MQ Subscription Descriptor) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q100010_.htm|MQ Knowledge Center} + * {@link https://www.ibm.com/docs/en/ibm-mq/latest?topic=mqi-mqsd-subscription-descriptor|MQ Documentation} * for more details on the usage of each field. * Not all of the underlying fields may be exposed in this object. */ diff --git a/lib/mqsro.js b/lib/mqsro.js index 699fca9..142cd27 100644 --- a/lib/mqsro.js +++ b/lib/mqsro.js @@ -33,7 +33,7 @@ * @classdesc * This is a class containing the fields needed for the MQSRO * (MQ Subscription Request Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q101940_.htm|MQ Knowledge Center} + * {@link https://www.ibm.com/docs/en/ibm-mq/latest?topic=mqi-mqsro-subscription-request-options|MQ Documentation} * for more details on the usage of each field. */ exports.MQSRO = function() { diff --git a/lib/mqstruc.js b/lib/mqstruc.js index 412742f..131f336 100644 --- a/lib/mqstruc.js +++ b/lib/mqstruc.js @@ -35,7 +35,7 @@ const decoder = new StringDecoder('utf8'); * @classdesc * This is a class containing the fields needed for the * MQ RFH2 Header structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q096110_.htm|MQ Knowledge Center} + * {@link https://www.ibm.com/docs/en/ibm-mq/latest?topic=mqi-mqrfh2-rules-formatting-header-2|MQ Documentation} * for more details on the usage of each field. * Not all of the underlying fields may be exposed in this object. */ @@ -78,7 +78,7 @@ exports.MQRFH2 = function (mqmd) { * @classdesc * This is a class containing the fields needed for the mqdlh * (MQ Dead Letter Header) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q096110_.htm|MQ Knowledge Center} + * {@link https://www.ibm.com/docs/en/ibm-mq/latest?topic=mqi-mqdlh-dead-letter-header|MQ Documentation} * for more details on the usage of each field. * Not all of the underlying fields may be exposed in this object. */ diff --git a/lib/mqsts.js b/lib/mqsts.js index 6b189a2..f50df25 100644 --- a/lib/mqsts.js +++ b/lib/mqsts.js @@ -36,7 +36,7 @@ var MQC = require('./mqidefs.js'); * @classdesc * This is a class containing the fields needed for the MQSTS * (MQ Status reporting) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q100540_.htm|MQ Knowledge Center} + * {@link https://www.ibm.com/docs/en/ibm-mq/latest?topic=mqi-mqsts-status-reporting-structure|MQ Documentation} * for more details on the usage of each field. */ exports.MQSTS = function() { diff --git a/package.json b/package.json index 6069a37..d4101ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ibmmq", - "version": "2.0.1", + "version": "2.0.2", "description": "Bindings to call IBM MQ API", "main": "./lib/mqi.js", "scripts": { @@ -19,22 +19,22 @@ }, "typings": "./types/index.d.ts", "devDependencies": { - "@tsconfig/recommended": "^1.0.2", - "@types/node": "^20.3.1", - "@typescript-eslint/eslint-plugin": "^5.60.0", - "@typescript-eslint/parser": "^5.60.0", - "eslint": "^8.43.0", + "@tsconfig/recommended": "^1.0.3", + "@types/node": "^20.8.7", + "@typescript-eslint/eslint-plugin": "^6.8.0", + "@typescript-eslint/parser": "^6.8.0", + "eslint": "^8.51.0", "eslint-plugin-import": "^2.27.5", - "eslint-plugin-jsdoc": "^46.2.6", + "eslint-plugin-jsdoc": "^46.8.2", "eslint-plugin-prefer-arrow": "^1.2.3", - "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-prettier": "^5.0.1", "node-gyp": "^9.4.0" }, "gypfile": true, "dependencies": { "node-addon-api": "^7.0.0", - "node-gyp-build": "^4.6.0", - "proxy-agent": "^6.3.0" + "node-gyp-build": "^4.6.1", + "proxy-agent": "^6.3.1" }, "engines": { "node": ">=16.0" diff --git a/postinstall.js b/postinstall.js index a5da29b..ac05717 100755 --- a/postinstall.js +++ b/postinstall.js @@ -17,7 +17,7 @@ const redistDir=baseDir+"/redist"; const macDir=baseDir+"/mactoolkit"; // This is the version (VRM) of MQ associated with this level of package -let vrm="9.3.3"; +let vrm="9.3.4"; // This is the default fixpack or CSU level that we might want to apply const defaultFp="0"; @@ -161,6 +161,7 @@ function removeUnneededWithGenMQPkg(fullNewBaseDir) { process.env.genmqpkg_incnls=1; process.env.genmqpkg_incsdk=1; process.env.genmqpkg_inctls=1; + process.env.genmqpkg_incras=1; process.env.genmqpkg_incadm=1; // For runmqsc, even though it leaves more files than we really need let debugGenObj = {}; diff --git a/samples/README.md b/samples/README.md index c933b34..7754c0c 100644 --- a/samples/README.md +++ b/samples/README.md @@ -1,16 +1,14 @@ # Sample program information Files in this directory are samples to demonstrate use of the Node.js interface to IBM MQ. -You can run them individually using `node .js` with any additional -required or optional parameters on the command line. Look at the source code to see -which configuration values can be changed. +You can run them individually using `node .js` with any additional required or optional parameters on the +command line. Look at the source code to see which configuration values can be changed. -Make sure you first read the README in the root of this repository to set up an environment -where Node.js programs can be executed, and how the packages refer to the MQ interfaces. +Make sure you first read the README in the root of this repository to set up an environment where Node.js programs can +be executed, and how the packages refer to the MQ interfaces. -Samples are provided to demonstrate most MQI uses, including ways put and get -messages, and to subscribe to topics. The source code of these samples should be reviewed for -an fuller idea of how this package can be used. +Samples are provided to demonstrate most MQI uses, including ways put and get messages, and to subscribe to topics. The +source code of these samples should be reviewed for an fuller idea of how this package can be used. ## Default values Where needed for the sample programs: @@ -41,13 +39,11 @@ Allow use of a userid/password for authentication. There are no default values f ## Running the programs -Apart from the `amqsconn` and `amqsconntls` programs, the other samples are designed to either connect -to a local queue manager (on the same machine) or for the client configuration to be -provided externally such as by the MQSERVER environment variable or the -MQ Client Channel Definition Table (CCDT) file. The MQ_CONNECT_TYPE environment -variable can be used to force client connections to be made, even if you have -installed the full server product; that variable is not needed if you have -only installed the MQ client libraries. +Apart from the `amqsconn` and `amqsconntls` programs, the other samples are designed to either connect to a local queue +manager (on the same machine) or for the client configuration to be provided externally such as by the MQSERVER +environment variable or the MQ Client Channel Definition Table (CCDT) file. The MQ_CONNECT_TYPE environment variable can +be used to force client connections to be made, even if you have installed the full server product; that variable is not +needed if you have only installed the MQ client libraries. Run like: @@ -59,30 +55,28 @@ node amqsput.js node amqsget.js ~~~ -There are various forms of the setmqenv command parameters, depending on your -environment and platform. This is just one example; read the KnowledgeCenter for -more options if you need them. +There are various forms of the setmqenv command parameters, depending on your environment and platform. This is just one +example; read the KnowledgeCenter for more options if you need them. ### Working with NPM -You may need to run `npm link` or `npm link ibmmq` from the samples directory or -the root of the repository if the program cannot find the ibmmq module. See -the [npm documentation](https://docs.npmjs.com/cli/link.html) for more information. +You may need to run `npm link` or `npm link ibmmq` from the samples directory or the root of the repository if the +program cannot find the ibmmq module. See the [npm documentation](https://docs.npmjs.com/cli/link.html) for more +information. ## Running in a container -The `run.docker` script builds and runs a container with the `amqsput` program. Two -Dockerfiles are provided. The default uses images based around debian/ubuntu containers. -If you set the `FROM` environment variable to "UBI" then images from the Red Hat Universal -Base Images repository are used instead. +The `run.docker` script builds and runs a container with the `amqsput` program. Two Dockerfiles are provided. The +default uses images based around debian/ubuntu containers. If you set the `FROM` environment variable to "UBI" then +images from the Red Hat Universal Base Images repository are used instead. -The automatic installation of the MQ client code only works for platforms where the Redistributable Client package is available. For other platforms, you have -to modify the Dockerfile to incorporate the MQ client from your own existing +The automatic installation of the MQ client code only works for platforms where the Redistributable Client package is +available. For other platforms, you have to modify the Dockerfile to incorporate the MQ client from your own existing images. ## More information -Comments in the programs explain what they are doing. For more detailed information about the -MQ API, the functions, structures, and constants, see the -[MQ Knowledge Center](https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q089590_.htm). +Comments in the programs explain what they are doing. For more detailed information about the MQ API, the functions, +structures, and constants, see the [MQ Documentation](https://www.ibm.com/docs/en/ibm-mq/latest). -You can also find general MQ application development advice [here](https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.dev.doc/q022830_.htm). -Information about development for procedural programming languages such as C in that -documentation is most relevant for the interface exported by this Go package. +You can also find general MQ application development advice +[here](https://www.ibm.com/docs/en/ibm-mq/latest?topic=mq-developing-applications). Information about development for +procedural programming languages such as C in that documentation is most relevant for the interface exported by this +package. diff --git a/samples/amqsconn.js b/samples/amqsconn.js index b7bd117..cb749db 100755 --- a/samples/amqsconn.js +++ b/samples/amqsconn.js @@ -62,7 +62,7 @@ var cno = new mq.MQCNO(); // Add authentication via the MQCSP structure var csp = new mq.MQCSP(); csp.UserId = "mqguest"; -csp.Password = "passw0rd"; +csp.Password = "passw0rd!Passw0rd"; // Make the MQCNO refer to the MQCSP // This line allows use of the userid/password cno.SecurityParms = csp; diff --git a/samples/amqsconntls.js b/samples/amqsconntls.js index 1086d33..6f39f61 100755 --- a/samples/amqsconntls.js +++ b/samples/amqsconntls.js @@ -98,15 +98,7 @@ cd.ChannelName = "SYSTEM.SSL.SVRCONN"; // The TLS parameters are the minimal set needed here. You might // want more control such as SSLPEER values. -// This SSLClientAuth setting means that this program does not need to -// present a certificate to the server - but it must match how the -// SVRCONN is defined on the queue manager. -// If you have to present a client certificate too then the -// SSLClientAuth is set to MQC.MQSCA_REQUIRED. You may -// also want to set the sco.CertificateLabel to choose -// which certificate is to be sent. cd.SSLCipherSpec = "ANY_TLS12_OR_HIGHER"; -cd.SSLClientAuth = MQC.MQSCA_OPTIONAL; // Make the MQCNO refer to the MQCD cno.ClientConn = cd; diff --git a/samples/amqsgetac.js b/samples/amqsgetac.js index fb30994..c3163c4 100755 --- a/samples/amqsgetac.js +++ b/samples/amqsgetac.js @@ -75,7 +75,7 @@ function getMessages() { var md = new mq.MQMD(); var gmo = new mq.MQGMO(); - gmo.Options = MQC.MQGMO_NO_SYNCPOINT | + gmo.Options = MQC.MQGMO_SYNCPOINT | MQC.MQGMO_WAIT | MQC.MQGMO_CONVERT | MQC.MQGMO_FAIL_IF_QUIESCING; @@ -123,6 +123,15 @@ function getCB(err, hObj, gmo,md,buf, hConn ) { } else { console.log("binary message: " + buf); } + // If we were using Syncpoint, then we may want to commit the updates. + if ((gmo.Options & MQC.MQGMO_SYNCPOINT) != 0) { + + mq.Cmit(connectionHandle, function (err) { + if (err) console.log(formatErr(err)); + else console.log("Commit OK"); + }); + + } } } diff --git a/samples/package.docker b/samples/package.docker index ab85803..04e24b3 100755 --- a/samples/package.docker +++ b/samples/package.docker @@ -6,6 +6,6 @@ "author": "Mark Taylor", "license": "Apache-2.0", "dependencies": { - "ibmmq": ">=2.0.1" + "ibmmq": ">=2.0.2" } } diff --git a/samples/typescript/package.json.sample b/samples/typescript/package.json.sample index aac1fc8..b2db0c4 100755 --- a/samples/typescript/package.json.sample +++ b/samples/typescript/package.json.sample @@ -5,10 +5,10 @@ "main": "amqsput.ts", "license": "Apache-2.0", "dependencies": { - "ibmmq": ">=2.0.1" + "ibmmq": ">=2.0.2" }, "devDependencies": { - "@types/node": "^20.3.1", - "typescript": "^5.1.3" + "@types/node": "^20.8.7", + "typescript": "^5.2.2" } } diff --git a/src/cmqxc.h b/src/cmqxc.h index 5e01429..bacff11 100644 --- a/src/cmqxc.h +++ b/src/cmqxc.h @@ -38,12 +38,12 @@ /****************************************************************/ /* */ - /* Generated on: 5/31/23 12:58 PM */ - /* Build Level: p933-L230531 */ + /* Generated on: 9/27/23 11:53 AM */ + /* Build Level: p934-L230927 */ /* Build Type: Production */ /* Pointer Size: 32 Bit, 64 Bit */ /* Source File: */ - /* @(#) MQMBID sn=p933-L230531 su=_flv3gf-gEe2SL8KfsXRgqA */ + /* @(#) MQMBID sn=p934-L230927 su=_4-aYmF0ZEe6zC4r8n5F4rg */ /* pn=com.ibm.mq.famfiles.data/xml/approved/cmqxc.xml */ /* */ /****************************************************************/ diff --git a/src/linux/cmqc.h b/src/linux/cmqc.h index 55b69ca..8793301 100644 --- a/src/linux/cmqc.h +++ b/src/linux/cmqc.h @@ -38,8 +38,8 @@ /****************************************************************/ /* */ - /* Generated on: 5/31/23 12:58 PM */ - /* Build Level: p933-L230531 */ + /* Generated on: 9/27/23 11:53 AM */ + /* Build Level: p934-L230927 */ /* Build Type: Production */ /* Pointer Size: 32 Bit, 64 Bit */ /* Source File: */ @@ -527,7 +527,8 @@ /* Structure Version Number */ #define MQCSP_VERSION_1 1 #define MQCSP_VERSION_2 2 - #define MQCSP_CURRENT_VERSION 2 + #define MQCSP_VERSION_3 3 + #define MQCSP_CURRENT_VERSION 3 /* Structure Length */ #if defined(MQ_64_BIT) @@ -541,14 +542,20 @@ #define MQCSP_LENGTH_2 68 #endif #if defined(MQ_64_BIT) - #define MQCSP_CURRENT_LENGTH 80 + #define MQCSP_LENGTH_3 104 #else - #define MQCSP_CURRENT_LENGTH 68 + #define MQCSP_LENGTH_3 88 +#endif +#if defined(MQ_64_BIT) + #define MQCSP_CURRENT_LENGTH 104 +#else + #define MQCSP_CURRENT_LENGTH 88 #endif /* Authentication Types */ #define MQCSP_AUTH_NONE 0 #define MQCSP_AUTH_USER_ID_AND_PWD 1 + #define MQCSP_AUTH_ID_TOKEN 2 /****************************************************************/ /* Values Related to MQCNO Structure */ @@ -1925,6 +1932,7 @@ #define MQ_CREATION_DATE_LENGTH 12 #define MQ_CREATION_TIME_LENGTH 8 #define MQ_CSP_PASSWORD_LENGTH 256 + #define MQ_CSP_TOKEN_LENGTH 8192 #define MQ_DATE_LENGTH 12 #define MQ_DISTINGUISHED_NAME_LENGTH 1024 #define MQ_DNS_GROUP_NAME_LENGTH 18 @@ -2112,6 +2120,7 @@ #define MQRC_REPORT_OPTIONS_ERROR 2061 #define MQRC_SECOND_MARK_NOT_ALLOWED 2062 #define MQRC_SECURITY_ERROR 2063 + #define MQRC_TOKEN_TIMESTAMP_NOT_VALID 2064 #define MQRC_SELECTOR_COUNT_ERROR 2065 #define MQRC_SELECTOR_LIMIT_EXCEEDED 2066 #define MQRC_SELECTOR_ERROR 2067 @@ -2865,7 +2874,8 @@ #define MQCMDL_LEVEL_931 931 #define MQCMDL_LEVEL_932 932 #define MQCMDL_LEVEL_933 933 - #define MQCMDL_CURRENT_LEVEL 933 + #define MQCMDL_LEVEL_934 934 + #define MQCMDL_CURRENT_LEVEL 934 /* Command Server Options */ #define MQCSRV_CONVERT_NO 0 @@ -4276,6 +4286,11 @@ MQLONG InitialKeyOffset; /* Offset of initial key */ MQLONG InitialKeyLength; /* Length of initial key */ /* Ver:2 */ + MQBYTE8 Reserved4; /* Reserved */ + MQPTR TokenPtr; /* Address of Token */ + MQLONG TokenOffset; /* Offset of Token */ + MQLONG TokenLength; /* Length of Token */ + /* Ver:3 */ }; #define MQCSP_DEFAULT {MQCSP_STRUC_ID_ARRAY},\ @@ -4292,6 +4307,10 @@ {'\0','\0','\0','\0','\0','\0','\0','\0'},\ NULL,\ 0,\ + 0,\ + {'\0','\0','\0','\0','\0','\0','\0','\0'},\ + NULL,\ + 0,\ 0 /****************************************************************/ diff --git a/src/mqcd.cc b/src/mqcd.cc index 3ef4e08..cf3b239 100644 --- a/src/mqcd.cc +++ b/src/mqcd.cc @@ -40,7 +40,8 @@ void copyCDtoC(Env env, Object jscd, PMQCD pmqcd) { pmqcd->SSLPeerNamePtr = mqnStrdup(env,v.As().Utf8Value().c_str()); pmqcd->SSLPeerNameLength = strlen((char *)pmqcd->SSLPeerNamePtr); } - pmqcd->SSLClientAuth = getMQLong(jscd,"SSLClientAuth"); + // This is not used by the client. Field is only relevant on the server end of a connection. + // pmqcd->SSLClientAuth = getMQLong(jscd,"SSLClientAuth"); pmqcd->KeepAliveInterval = getMQLong(jscd,"KeepAliveInterval"); pmqcd->SharingConversations = getMQLong(jscd,"SharingConversations"); pmqcd->PropertyControl = getMQLong(jscd,"PropertyControl"); diff --git a/src/mqgeta.cc b/src/mqgeta.cc index c08f88b..0b5f59c 100644 --- a/src/mqgeta.cc +++ b/src/mqgeta.cc @@ -234,7 +234,8 @@ void PreJsCB(Env env, Function callback, Context *context, ReturnedData *data) { // May have many of these invoked before preJsCB gets executed // There may also be invocations on various different threads. Each hConn has -// to have its own callback thread, and they might be invoked simultaneously. +// to have its own callback thread, and they might be invoked simultaneously. But for a given +// hConn, the callbacks will always be made from the MQI to the same thread. // In any case, there is no critical use of global data here (either read or write) // so shouldn't need any locking. void mqnCB(MQHCONN hConn, MQMD *pmqmd, MQGMO *pmqgmo, MQBYTE *buf, MQCBC *pContext) { @@ -269,6 +270,10 @@ void mqnCB(MQHCONN hConn, MQMD *pmqmd, MQGMO *pmqgmo, MQBYTE *buf, MQCBC *pConte // for all the stuff we pass. totalAlloc = MQGMO_LENGTH_4 + MQMD_LENGTH_2 + len; retData->buf = (unsigned char *)malloc(totalAlloc); + if (retData->buf == NULL) { + // A malloc problem is going to be fairly fatal + Error::Fatal("mqmCB", "Out of memory error. Call to malloc returned NULL."); + } memcpy(retData->buf, pmqgmo, MQGMO_LENGTH_4); p = retData->buf + MQGMO_LENGTH_4; memcpy(p, pmqmd, MQMD_LENGTH_2); @@ -282,12 +287,25 @@ void mqnCB(MQHCONN hConn, MQMD *pmqmd, MQGMO *pmqgmo, MQBYTE *buf, MQCBC *pConte debugf(LOG_DEBUG, "mqnCB - Message delivery returned error %d for calltype %d ", pContext->Reason, pContext->CallType); } break; + case MQCBCT_EVENT_CALL: - if ((pContext->Reason == MQRC_OBJECT_CHANGED) || (pContext->Reason == MQRC_CONNECTION_BROKEN) || (pContext->Reason == MQRC_Q_MGR_STOPPING) || - (pContext->Reason == MQRC_Q_MGR_QUIESCING) || (pContext->Reason == MQRC_CONNECTION_QUIESCING) || (pContext->Reason == MQRC_CONNECTION_STOPPING) || - (pContext->Reason == MQRC_NO_MSG_AVAILABLE)) { + // Some errors are "interesting". The app should probably quit/reconnect with these errors. So we trace them + // to help debug. + switch (pContext->Reason) { + case MQRC_OBJECT_CHANGED: + case MQRC_CONNECTION_BROKEN: + case MQRC_Q_MGR_STOPPING: + case MQRC_Q_MGR_QUIESCING: + case MQRC_CONNECTION_QUIESCING: + case MQRC_CONNECTION_STOPPING: + case MQRC_NO_MSG_AVAILABLE: debugf(LOG_DEBUG, "mqnCB - Error %d for hConn/hObj %d/%d", pContext->Reason, hConn, pContext->Hobj); + break; + default: + // Pass it through + break; } + break; default: @@ -295,12 +313,28 @@ void mqnCB(MQHCONN hConn, MQMD *pmqmd, MQGMO *pmqgmo, MQBYTE *buf, MQCBC *pConte break; } - // C++ automatically creates an object if you simply use x=myMap[unknown_key].So check the key exists - // in the map first. - // - // This is one strategy for delaying the callbacks a little while to allow the - // PreJsCB functions a chance to catch up. - if (callbackStrategy != CB_SYNCED) { + switch (callbackStrategy) { + + case CB_SYNCED: + // For the strategy of not having any backlog of queued work, we stop any further delivery of + // messages for this hConn until the application callback has completed. Do the suspension BEFORE + // scheduling the callback. + { + MQLONG CC, RC; + MQCTLO mqctlo = {MQCTLO_DEFAULT}; + + _MQCTL(hConn, MQOP_SUSPEND, &mqctlo, &CC, &RC); + debugf(LOG_DEBUG, "mqnCB - MQCTL SUSPEND hConn=%d CC=%d RC=%d", hConn, CC, RC); + } + break; + + case CB_READAHEAD: + // This is an alternative strategy for getting the messages off the queeu as fast as possbile, but at the cost + // of potential unreliabilty and overlapping work. Lots of callbacks can be scheduled to run "simultaneously" with + // their own message contents.We may decide here to delay callbacks a little while to allow the + // PreJsCB functions a chance to catch up if we think there might be too many in a queue. + // C++ automatically creates an object if you simply use x=myMap[unknown_key].So check the key exists + // in the map first. if (connContextMap.count(hConn) == 1) { ConnContext *connContext = connContextMap[hConn]; if (connContext != NULL && connContext->queuedCount++ > config.maxConsecutiveGets) { @@ -321,12 +355,23 @@ void mqnCB(MQHCONN hConn, MQMD *pmqmd, MQGMO *pmqgmo, MQBYTE *buf, MQCBC *pConte connContext->mtx.unlock(); } } + break; + + default: + debugf(LOG_DEBUG,"mqnCB - unknown callback strategy!"); + break; } bool queued = false; int retries = 0; // processMtx.lock(); // Block all callbacks temporarily while we give the worker queue a chance to drain. + + // Now add the user's callback (actually our NodeJS proxy function) to the queue to be executed + // + // Try it a few times - when using CB_SYNCED, this should always work. But the readahead strategy might + // give us a long queue - while again it should always work as the queue is defined as unlimited, we may still + // want to careful. while (!queued && retries < 10) { napi_status status = tsfn.NonBlockingCall(retData); if (status == napi_ok) { @@ -337,21 +382,14 @@ void mqnCB(MQHCONN hConn, MQMD *pmqmd, MQGMO *pmqgmo, MQBYTE *buf, MQCBC *pConte this_thread::sleep_for(chrono::milliseconds(config.getLoopDelayTimeMs)); retries++; } else { - Error::Fatal("ThreadEntry", "TypedThreadSafeNapi::Function.NonBlockingCall() failed"); + // Something else has gone wrong - consider it fatal + std::string errmsg = "TypedThreadSafeNapi::Function.NonBlockingCall() failed with status "; + std::string s = std::to_string(status); + Error::Fatal("mqmCB", (errmsg + s).c_str()); } } - // processMtx.unlock(); - // For the strategy of not having any backlog of queued work, we stop any further delivery of - // messages for this hConn until the application callback has completed. - if (callbackStrategy == CB_SYNCED) { - MQLONG CC, RC; - MQCTLO mqctlo = {MQCTLO_DEFAULT}; - - _MQCTL(hConn, MQOP_SUSPEND, &mqctlo, &CC, &RC); - debugf(LOG_DEBUG, "mqnCB - MQCTL SUSPEND hConn=%d CC=%d RC=%d", hConn, CC, RC); - - } + // processMtx.unlock(); return; } diff --git a/src/windows/cmqc.h b/src/windows/cmqc.h index 11ca098..f529213 100644 --- a/src/windows/cmqc.h +++ b/src/windows/cmqc.h @@ -38,8 +38,8 @@ /****************************************************************/ /* */ - /* Generated on: 5/31/23 12:58 PM */ - /* Build Level: p933-L230531 */ + /* Generated on: 9/27/23 11:53 AM */ + /* Build Level: p934-L230927 */ /* Build Type: Production */ /* Pointer Size: 32 Bit, 64 Bit */ /* Source File: */ @@ -527,7 +527,8 @@ /* Structure Version Number */ #define MQCSP_VERSION_1 1 #define MQCSP_VERSION_2 2 - #define MQCSP_CURRENT_VERSION 2 + #define MQCSP_VERSION_3 3 + #define MQCSP_CURRENT_VERSION 3 /* Structure Length */ #if defined(MQ_64_BIT) @@ -541,14 +542,20 @@ #define MQCSP_LENGTH_2 68 #endif #if defined(MQ_64_BIT) - #define MQCSP_CURRENT_LENGTH 80 + #define MQCSP_LENGTH_3 104 #else - #define MQCSP_CURRENT_LENGTH 68 + #define MQCSP_LENGTH_3 88 +#endif +#if defined(MQ_64_BIT) + #define MQCSP_CURRENT_LENGTH 104 +#else + #define MQCSP_CURRENT_LENGTH 88 #endif /* Authentication Types */ #define MQCSP_AUTH_NONE 0 #define MQCSP_AUTH_USER_ID_AND_PWD 1 + #define MQCSP_AUTH_ID_TOKEN 2 /****************************************************************/ /* Values Related to MQCNO Structure */ @@ -1929,6 +1936,7 @@ #define MQ_CREATION_DATE_LENGTH 12 #define MQ_CREATION_TIME_LENGTH 8 #define MQ_CSP_PASSWORD_LENGTH 256 + #define MQ_CSP_TOKEN_LENGTH 8192 #define MQ_DATE_LENGTH 12 #define MQ_DISTINGUISHED_NAME_LENGTH 1024 #define MQ_DNS_GROUP_NAME_LENGTH 18 @@ -2116,6 +2124,7 @@ #define MQRC_REPORT_OPTIONS_ERROR 2061 #define MQRC_SECOND_MARK_NOT_ALLOWED 2062 #define MQRC_SECURITY_ERROR 2063 + #define MQRC_TOKEN_TIMESTAMP_NOT_VALID 2064 #define MQRC_SELECTOR_COUNT_ERROR 2065 #define MQRC_SELECTOR_LIMIT_EXCEEDED 2066 #define MQRC_SELECTOR_ERROR 2067 @@ -2869,7 +2878,8 @@ #define MQCMDL_LEVEL_931 931 #define MQCMDL_LEVEL_932 932 #define MQCMDL_LEVEL_933 933 - #define MQCMDL_CURRENT_LEVEL 933 + #define MQCMDL_LEVEL_934 934 + #define MQCMDL_CURRENT_LEVEL 934 /* Command Server Options */ #define MQCSRV_CONVERT_NO 0 @@ -4278,6 +4288,11 @@ MQLONG InitialKeyOffset; /* Offset of initial key */ MQLONG InitialKeyLength; /* Length of initial key */ /* Ver:2 */ + MQBYTE8 Reserved4; /* Reserved */ + MQPTR TokenPtr; /* Address of Token */ + MQLONG TokenOffset; /* Offset of Token */ + MQLONG TokenLength; /* Length of Token */ + /* Ver:3 */ }; #define MQCSP_DEFAULT {MQCSP_STRUC_ID_ARRAY},\ @@ -4294,6 +4309,10 @@ {'\0','\0','\0','\0','\0','\0','\0','\0'},\ NULL,\ 0,\ + 0,\ + {'\0','\0','\0','\0','\0','\0','\0','\0'},\ + NULL,\ + 0,\ 0 /****************************************************************/ diff --git a/types/mqc.d.ts b/types/mqc.d.ts index 13487c0..ba9f137 100644 --- a/types/mqc.d.ts +++ b/types/mqc.d.ts @@ -1290,6 +1290,7 @@ declare module "ibmmq" { MQCMDL_LEVEL_931: MQC_MQCMDL; MQCMDL_LEVEL_932: MQC_MQCMDL; MQCMDL_LEVEL_933: MQC_MQCMDL; + MQCMDL_LEVEL_934: MQC_MQCMDL; MQCMD_NONE: MQC_MQCMD; MQCMD_CHANGE_Q_MGR: MQC_MQCMD; MQCMD_INQUIRE_Q_MGR: MQC_MQCMD; @@ -1552,6 +1553,7 @@ declare module "ibmmq" { MQCRC_TRANSID_NOT_AVAILABLE: MQC_MQCRC; MQCSP_AUTH_NONE: MQC_MQCSP; MQCSP_AUTH_USER_ID_AND_PWD: MQC_MQCSP; + MQCSP_AUTH_ID_TOKEN: MQC_MQCSP; MQCSRV_CONVERT_NO: MQC_MQCSRV_CONVERT; MQCSRV_CONVERT_YES: MQC_MQCSRV_CONVERT; MQCSRV_DLQ_NO: MQC_MQCSRV_DLQ; @@ -3601,6 +3603,7 @@ declare module "ibmmq" { MQRC_REPORT_OPTIONS_ERROR: MQC_MQRC; MQRC_SECOND_MARK_NOT_ALLOWED: MQC_MQRC; MQRC_SECURITY_ERROR: MQC_MQRC; + MQRC_TOKEN_TIMESTAMP_NOT_VALID: MQC_MQRC; MQRC_SELECTOR_COUNT_ERROR: MQC_MQRC; MQRC_SELECTOR_LIMIT_EXCEEDED: MQC_MQRC; MQRC_SELECTOR_ERROR: MQC_MQRC; @@ -4962,8 +4965,10 @@ declare module "ibmmq" { MQCSP_CURRENT_VERSION: number; MQCSP_LENGTH_1: number; MQCSP_LENGTH_2: number; + MQCSP_LENGTH_3: number; MQCSP_VERSION_1: number; MQCSP_VERSION_2: number; + MQCSP_VERSION_3: number; MQCTLO_CURRENT_LENGTH: number; MQCTLO_CURRENT_VERSION: number; MQCTLO_LENGTH_1: number; @@ -5396,6 +5401,7 @@ declare module "ibmmq" { MQ_CREATION_DATE_LENGTH: number; MQ_CREATION_TIME_LENGTH: number; MQ_CSP_PASSWORD_LENGTH: number; + MQ_CSP_TOKEN_LENGTH: number; MQ_CUSTOM_LENGTH: number; MQ_DATA_SET_NAME_LENGTH: number; MQ_DATE_LENGTH: number; diff --git a/types/mqcbc.d.ts b/types/mqcbc.d.ts index 8b73ac5..04583d6 100755 --- a/types/mqcbc.d.ts +++ b/types/mqcbc.d.ts @@ -1,9 +1,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the MQCBC - * (MQ CallBack Context) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q094330_.htm |MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ CallBack Context) structure. . * Not all of the underlying fields may be exposed in this object. */ class MQCBC { diff --git a/types/mqcbd.d.ts b/types/mqcbd.d.ts index 9d13d78..9fda3eb 100755 --- a/types/mqcbd.d.ts +++ b/types/mqcbd.d.ts @@ -1,9 +1,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the MQCBD - * (MQ CallBack Descriptor) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q094540_.htm |MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ CallBack Descriptor) structure. * Not all of the underlying fields may be exposed in this object. */ class MQCBD { diff --git a/types/mqcd.d.ts b/types/mqcd.d.ts index f21fa3b..f680878 100644 --- a/types/mqcd.d.ts +++ b/types/mqcd.d.ts @@ -1,9 +1,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the MQCD - * (MQ Channel Definition) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q108220_.htm |MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ Channel Definition) structure. * Not all of the underlying fields may be exposed in this object. */ class MQCD { @@ -16,7 +14,7 @@ declare module "ibmmq" { HeartbeatInterval: number; SSLCipherSpec: string; SSLPeerName: string; - SSLClientAuth: MQC_MQSCA; + SSLClientAuth: MQC_MQSCA; /* Not used, but leave here for compatibility */ KeepAliveInterval: MQC_MQKAI; SharingConversations: number; PropertyControl: MQC_MQPROP; diff --git a/types/mqcno.d.ts b/types/mqcno.d.ts index 9e2cf6a..e736651 100644 --- a/types/mqcno.d.ts +++ b/types/mqcno.d.ts @@ -1,9 +1,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the MQCNO - * (MQ Connection Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q095410_.htm|MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ Connection Options) structure. * Not all of the underlying fields may be exposed in this object. */ class MQCNO { diff --git a/types/mqcsp.d.ts b/types/mqcsp.d.ts index c9e33f4..ad155fa 100644 --- a/types/mqcsp.d.ts +++ b/types/mqcsp.d.ts @@ -1,9 +1,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the MQCSP - * (MQ Connection Security Parameters) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q095610_.htm |MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ Connection Security Parameters) structure. * Not all of the underlying fields may be exposed in this object. For example, * unlike the regular MQI, we don't bother exposing the authenticationType * attribute, as there's currently only one value other than none - and setting @@ -13,5 +11,6 @@ declare module "ibmmq" { UserId: string; Password: string; InitialKey: string; + Token: string; } } diff --git a/types/mqctlo.d.ts b/types/mqctlo.d.ts index 195bd2f..f614d93 100755 --- a/types/mqctlo.d.ts +++ b/types/mqctlo.d.ts @@ -1,9 +1,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the MQCTLO - * (MQ Control Callback Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q095800_.htm|MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ Control Callback Options) structure. * Not all of the underlying fields may be exposed in this object. */ class MQCTLO { diff --git a/types/mqdlh.d.ts b/types/mqdlh.d.ts index 3bf0011..6c93223 100644 --- a/types/mqdlh.d.ts +++ b/types/mqdlh.d.ts @@ -1,9 +1,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the mqdlh - * (MQ Dead Letter Header) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q096110_.htm |MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ Dead Letter Header) structure. * Not all of the underlying fields may be exposed in this object. */ class MQDLH { diff --git a/types/mqgmo.d.ts b/types/mqgmo.d.ts index 0627783..59fa60b 100644 --- a/types/mqgmo.d.ts +++ b/types/mqgmo.d.ts @@ -1,15 +1,8 @@ declare module "ibmmq" { - /* - * MQGMO is a JavaScript object containing the fields we need for the MQGMO - * in a more idiomatic style than the C definition - in particular for - * fixed length character buffers. - */ - + /** * This is a class containing the fields needed for the MQGMO - * (MQ Get Message Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q096710_.htm|MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ Get Message Options) structure. * Not all of the underlying fields may be exposed in this object. *

Note: This sets the FIQ flag by default, which is not standard in the MQI * but probably should have been. It's also forced to be set elsewhere. diff --git a/types/mqmd.d.ts b/types/mqmd.d.ts index 3df0438..4e00b65 100644 --- a/types/mqmd.d.ts +++ b/types/mqmd.d.ts @@ -1,9 +1,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the MQMD - * (MQ Message Descriptor) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097390_.htm |MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ Message Descriptor) structure. * Not all of the underlying fields may be exposed in this object. */ class MQMD { diff --git a/types/mqmho.d.ts b/types/mqmho.d.ts index e26c114..7673170 100644 --- a/types/mqmho.d.ts +++ b/types/mqmho.d.ts @@ -1,9 +1,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the MQCMHO - * (MQ Create Message Handle Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q095320_.htm |MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ Create Message Handle Options) structure. */ class MQCMHO { Options: number |MQC_MQCMHO[]; @@ -11,9 +9,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the MQDMHO - * (MQ Delete Message Handle Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q096320_.htm |MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ Delete Message Handle Options) structure. */ class MQDMHO { Options: number|MQC_MQDMHO[]; diff --git a/types/mqmpo.d.ts b/types/mqmpo.d.ts index 20775dd..90af5c3 100644 --- a/types/mqmpo.d.ts +++ b/types/mqmpo.d.ts @@ -1,9 +1,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the MQIMPO - * (MQ Inquire Message Property Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097210_.htm |MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ Inquire Message Property Options) structure. */ class MQIMPO { Options: number | MQC_MQIMPO[]; @@ -15,9 +13,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the MQSMPO - * (MQ Set Message Property Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q100270_.htm |MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ Set Message Property Options) structure. */ class MQSMPO { Options: number | MQC_MQSMPO[]; @@ -25,9 +21,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the MQDMPO - * (MQ Delete Message Property Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q096430_.htm |MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ Delete Message Property Options) structure. */ class MQDMPO { Options: number | MQC_MQDMPO[]; @@ -35,9 +29,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the MQPD - * (MQ Property Descriptor) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q098510_.htm |MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ Property Descriptor) structure. */ class MQPD { Options: number | MQC_MQPD_OPTIONS[]; diff --git a/types/mqod.d.ts b/types/mqod.d.ts index 2cfd315..4847e7b 100644 --- a/types/mqod.d.ts +++ b/types/mqod.d.ts @@ -1,9 +1,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the MQOD - * (MQ Object Descriptor) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q098100_.htm |MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ Object Descriptor) structure. * Not all of the underlying fields may be exposed in this object. */ class MQOD { diff --git a/types/mqpmo.d.ts b/types/mqpmo.d.ts index 3888c12..cdcf6ae 100644 --- a/types/mqpmo.d.ts +++ b/types/mqpmo.d.ts @@ -1,9 +1,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the MQPMO - * (MQ Put Message Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q098650_.htm|MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ Put Message Options) structure. * Not all of the underlying fields may be exposed in this object. *

Note: This sets the FIQ flag by default, which is not standard in the MQI * but probably should have been. It's also forced to be set elsewhere. diff --git a/types/mqrfh2.d.ts b/types/mqrfh2.d.ts index d0a3575..034c9f1 100644 --- a/types/mqrfh2.d.ts +++ b/types/mqrfh2.d.ts @@ -10,9 +10,7 @@ declare module "ibmmq" { * @class * @classdesc * This is a class containing the fields needed for the - * MQ RFH2 Header structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q096110_.htm|MQ Knowledge Center} - * for more details on the usage of each field. + * MQ RFH2 Header structure. * Not all of the underlying fields may be exposed in this object. */ class MQRFH2 { diff --git a/types/mqsco.d.ts b/types/mqsco.d.ts index 85d07d3..c5c3584 100644 --- a/types/mqsco.d.ts +++ b/types/mqsco.d.ts @@ -1,13 +1,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the MQSCO - * (MQ SSL/TLS Configuration Options) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q099820_.htm |MQ Knowledge Center} - * for more details on the usage of each field. - * Note the warnings in the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q095520_.htm |MQ Knowledge Center} - * about the process-wide, once-only definition of this structure and - * the MQRC_SSL_ALREADY_INITIALIZED warning reason code. From MQ 9.2.5 that can be avoided with the EnvironmentScope option + * (MQ SSL/TLS Configuration Options) structure. */ class MQSCO { KeyRepository: string; diff --git a/types/mqsd.d.ts b/types/mqsd.d.ts index 4939a0e..4d71675 100755 --- a/types/mqsd.d.ts +++ b/types/mqsd.d.ts @@ -1,9 +1,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the MQSD - * (MQ Subscription Descriptor) structure. See the - * {@link https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q100010_.htm |MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ Subscription Descriptor) structure. * Not all of the underlying fields may be exposed in this object. */ class MQSD { diff --git a/types/mqsro.d.ts b/types/mqsro.d.ts index 7ec6929..3a59c15 100644 --- a/types/mqsro.d.ts +++ b/types/mqsro.d.ts @@ -1,9 +1,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the MQSRO - * (MQ Subscription Request Options) structure. See the - * {@link https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqi-mqsro-subscription-request-options |MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ Subscription Request Options) structure. */ class MQSRO { Options: number | MQC_MQSRO[]; diff --git a/types/mqsts.d.ts b/types/mqsts.d.ts index 006e2c1..343fb3f 100644 --- a/types/mqsts.d.ts +++ b/types/mqsts.d.ts @@ -1,9 +1,7 @@ declare module "ibmmq" { /** * This is a class containing the fields needed for the MQSTS - * (MQ Status reporting) structure. See the - * {@link https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqi-mqsts-status-reporting-structure |MQ Knowledge Center} - * for more details on the usage of each field. + * (MQ Status reporting) structure. */ class MQSTS { CompCode: MQC_MQCC;