@zowe/db2-for-zowe-cli 6.1.17 → 6.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -10
- package/lib/Db2PluginLifeCycle.d.ts +11 -9
- package/lib/Db2PluginLifeCycle.js +18 -13
- package/lib/Db2PluginLifeCycle.js.map +1 -1
- package/node_modules/axios/CHANGELOG.md +62 -0
- package/node_modules/axios/README.md +233 -5
- package/node_modules/axios/dist/axios.js +387 -89
- package/node_modules/axios/dist/axios.min.js +3 -3
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +458 -98
- package/node_modules/axios/dist/esm/axios.js +458 -98
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +568 -116
- package/node_modules/axios/index.d.cts +4 -0
- package/node_modules/axios/index.d.ts +4 -0
- package/node_modules/axios/lib/adapters/fetch.js +64 -11
- package/node_modules/axios/lib/adapters/http.js +134 -50
- package/node_modules/axios/lib/adapters/xhr.js +52 -3
- package/node_modules/axios/lib/core/Axios.js +19 -14
- package/node_modules/axios/lib/core/InterceptorManager.js +107 -8
- package/node_modules/axios/lib/core/buildFullPath.js +1 -13
- package/node_modules/axios/lib/core/dispatchRequest.js +8 -2
- package/node_modules/axios/lib/core/mergeConfig.js +1 -1
- package/node_modules/axios/lib/core/methodList.js +17 -0
- package/node_modules/axios/lib/defaults/index.js +2 -1
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/Http2Sessions.js +2 -0
- package/node_modules/axios/lib/helpers/HttpStatusCode.js +11 -1
- package/node_modules/axios/lib/helpers/fromDataURI.js +5 -4
- package/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
- package/node_modules/axios/lib/helpers/progressEventReducer.js +1 -1
- package/node_modules/axios/lib/helpers/resolveConfig.js +4 -2
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +182 -6
- package/node_modules/axios/lib/helpers/throttle.js +3 -2
- package/node_modules/axios/lib/helpers/toFormData.js +14 -21
- package/node_modules/axios/lib/utils.js +134 -13
- package/node_modules/axios/package.json +1 -1
- package/node_modules/ibm_db/APIDocumentation.md +2883 -2024
- package/node_modules/ibm_db/LICENSE +23 -23
- package/node_modules/ibm_db/README.md +735 -735
- package/node_modules/ibm_db/binding.gyp +99 -98
- package/node_modules/ibm_db/installer/driverInstall.js +984 -958
- package/node_modules/ibm_db/installer/ifx.sh +38 -38
- package/node_modules/ibm_db/installer/setenv.sh +23 -23
- package/node_modules/ibm_db/installer/testODBCConnection.bat +51 -51
- package/node_modules/ibm_db/installer/testODBCConnection.sh +61 -61
- package/node_modules/ibm_db/lib/climacros.js +431 -431
- package/node_modules/ibm_db/lib/odbc.js +4293 -3487
- package/node_modules/ibm_db/lib/simple-queue.js +41 -41
- package/node_modules/ibm_db/package.json +70 -70
- package/node_modules/ibm_db/src/odbc.cpp +1495 -1396
- package/node_modules/ibm_db/src/odbc.h +477 -473
- package/node_modules/ibm_db/src/odbc_connection.cpp +1762 -1612
- package/node_modules/ibm_db/src/odbc_connection.h +228 -215
- package/node_modules/ibm_db/src/odbc_result.cpp +1547 -1547
- package/node_modules/ibm_db/src/odbc_result.h +152 -152
- package/node_modules/ibm_db/src/odbc_statement.cpp +2047 -861
- package/node_modules/ibm_db/src/odbc_statement.h +257 -135
- package/node_modules/ibm_db/src/strptime.c +389 -389
- package/node_modules/ibm_db/src/strptime.h +46 -46
- package/node_modules/ibm_db/test/README +23 -23
- package/node_modules/ibm_db/test/bench-insert.js +62 -62
- package/node_modules/ibm_db/test/bench-insertBatch10.js +74 -74
- package/node_modules/ibm_db/test/bench-insertBatch100.js +75 -75
- package/node_modules/ibm_db/test/bench-insertBatch1000.js +75 -75
- package/node_modules/ibm_db/test/bench-insertBatch10000.js +75 -75
- package/node_modules/ibm_db/test/bench-prepare-bind-execute-closeSync.js +60 -60
- package/node_modules/ibm_db/test/bench-prepare-bind-executeNonQuery.js +53 -53
- package/node_modules/ibm_db/test/bench-prepare-bindSync-execute-closeSync.js +50 -50
- package/node_modules/ibm_db/test/bench-prepare-bindSync-executeNonQuery.js +48 -48
- package/node_modules/ibm_db/test/bench-prepare-execute-closeSync.js +51 -51
- package/node_modules/ibm_db/test/bench-prepare-executeNonQuery.js +47 -47
- package/node_modules/ibm_db/test/bench-prepare-not.js +43 -43
- package/node_modules/ibm_db/test/bench-query-fetch.js +59 -59
- package/node_modules/ibm_db/test/bench-query-fetchAll.js +49 -49
- package/node_modules/ibm_db/test/bench-query-fetchAllSync.js +43 -43
- package/node_modules/ibm_db/test/bench-query.js +40 -40
- package/node_modules/ibm_db/test/bench-querySync-fetchArray.js +28 -28
- package/node_modules/ibm_db/test/bench-querySync.js +29 -29
- package/node_modules/ibm_db/test/common.d.ts +10 -10
- package/node_modules/ibm_db/test/common.js +127 -127
- package/node_modules/ibm_db/test/config.json +7 -7
- package/node_modules/ibm_db/test/config.zos.json +4 -4
- package/node_modules/ibm_db/test/data/sample1.txt +9 -9
- package/node_modules/ibm_db/test/data/trc.fmt +30114 -30114
- package/node_modules/ibm_db/test/nodeEE-leak-huge-query.js +152 -152
- package/node_modules/ibm_db/test/nodeEE-leak-multiple-query-multiple-connections.js +148 -148
- package/node_modules/ibm_db/test/nodeEE-leak-multiple-query-pool-connections.js +154 -154
- package/node_modules/ibm_db/test/nodeEE-leak-multiple-query.js +133 -133
- package/node_modules/ibm_db/test/nodeEE-stress-async-waterfall-multiple-connections.js +174 -174
- package/node_modules/ibm_db/test/nodeEE-stress-async-waterfall.js +169 -169
- package/node_modules/ibm_db/test/nodeEE-stress-mixed-query-multiple-connections.js +159 -159
- package/node_modules/ibm_db/test/nodeEE-stress-mixed-query.js +148 -148
- package/node_modules/ibm_db/test/odbc-bench.c +123 -123
- package/node_modules/ibm_db/test/perfTest.js +53 -53
- package/node_modules/ibm_db/test/quick-example.sh +30 -30
- package/node_modules/ibm_db/test/quick-example.ts +80 -80
- package/node_modules/ibm_db/test/run-bench.js +96 -96
- package/node_modules/ibm_db/test/run-nodeEE.js +132 -132
- package/node_modules/ibm_db/test/run-tests.js +132 -138
- package/node_modules/ibm_db/test/sql-cli.js +28 -28
- package/node_modules/ibm_db/test/test-all-data-types.js +109 -109
- package/node_modules/ibm_db/test/test-array-insert.js +178 -178
- package/node_modules/ibm_db/test/test-async-await.js +105 -105
- package/node_modules/ibm_db/test/test-attributes.js +34 -34
- package/node_modules/ibm_db/test/test-bad-pool-connection-prepare-execute.js +57 -57
- package/node_modules/ibm_db/test/test-basic-test.js +138 -138
- package/node_modules/ibm_db/test/test-binary-array-insert.js +73 -73
- package/node_modules/ibm_db/test/test-blob-from-file.js +90 -90
- package/node_modules/ibm_db/test/test-blob-insert.js +144 -144
- package/node_modules/ibm_db/test/test-blob-stream-insert.js +321 -299
- package/node_modules/ibm_db/test/test-blob-to-file.js +370 -370
- package/node_modules/ibm_db/test/test-block-fetch.js +364 -364
- package/node_modules/ibm_db/test/test-blocking-issue210.js +123 -123
- package/node_modules/ibm_db/test/test-call-async.js +64 -64
- package/node_modules/ibm_db/test/test-call-stmt.js +53 -53
- package/node_modules/ibm_db/test/test-cancel.js +703 -0
- package/node_modules/ibm_db/test/test-chinese-char.js +59 -59
- package/node_modules/ibm_db/test/test-connection.js +306 -0
- package/node_modules/ibm_db/test/test-date.js +32 -32
- package/node_modules/ibm_db/test/test-dbclob.js +93 -93
- package/node_modules/ibm_db/test/test-decimals.js +135 -135
- package/node_modules/ibm_db/test/test-describe-metadata.js +148 -0
- package/node_modules/ibm_db/test/test-executeFile.js +167 -167
- package/node_modules/ibm_db/test/test-executeFileSync.js +85 -85
- package/node_modules/ibm_db/test/test-fetch-apis.js +146 -146
- package/node_modules/ibm_db/test/test-fetchN.js +130 -130
- package/node_modules/ibm_db/test/test-getinfo.js +197 -197
- package/node_modules/ibm_db/test/test-ibm-db-issue14.js +58 -58
- package/node_modules/ibm_db/test/test-ibm-db-issue17.js +54 -54
- package/node_modules/ibm_db/test/test-ibm-db-issue18.js +54 -54
- package/node_modules/ibm_db/test/test-issue-1059-fetchAll-undefined.js +67 -67
- package/node_modules/ibm_db/test/test-issue-1080-array-blob-insert.js +40 -0
- package/node_modules/ibm_db/test/test-issue-54.js +39 -39
- package/node_modules/ibm_db/test/test-issue-get-column-value-2.js +44 -44
- package/node_modules/ibm_db/test/test-issue211.js +80 -80
- package/node_modules/ibm_db/test/test-issue253.js +39 -39
- package/node_modules/ibm_db/test/test-max-pool-size.js +96 -96
- package/node_modules/ibm_db/test/test-memory-leaks-new-objects.js +32 -32
- package/node_modules/ibm_db/test/test-multi-open-query-close.js +75 -75
- package/node_modules/ibm_db/test/test-param-put-data.js +713 -0
- package/node_modules/ibm_db/test/test-pool-idle-connection.js +72 -72
- package/node_modules/ibm_db/test/test-pool-operations.js +325 -0
- package/node_modules/ibm_db/test/test-pool-stale-connections.js +111 -111
- package/node_modules/ibm_db/test/test-pool-uncommited.js +33 -33
- package/node_modules/ibm_db/test/test-prepare-execute.js +339 -0
- package/node_modules/ibm_db/test/test-prepareSync-multiple-execution.js +93 -93
- package/node_modules/ibm_db/test/test-primary-foreign-keys.js +246 -0
- package/node_modules/ibm_db/test/test-procedures.js +243 -0
- package/node_modules/ibm_db/test/test-promise-all-data-types.js +42 -42
- package/node_modules/ibm_db/test/test-query-operations.js +405 -0
- package/node_modules/ibm_db/test/test-quick-example.js +25 -25
- package/node_modules/ibm_db/test/test-row-array-insert.js +167 -167
- package/node_modules/ibm_db/test/test-sp-array.js +54 -54
- package/node_modules/ibm_db/test/test-sp-dbc-6000.js +88 -88
- package/node_modules/ibm_db/test/test-sp-memleak.js +136 -136
- package/node_modules/ibm_db/test/test-sp-resultset-execute.js +269 -269
- package/node_modules/ibm_db/test/test-sp-resultset.js +228 -228
- package/node_modules/ibm_db/test/test-transactions.js +261 -0
- package/node_modules/ibm_db/test/test-typescript.js +48 -48
- package/node_modules/ibm_db/test/test-xml-datatype.js +70 -70
- package/node_modules/ibm_db/test/testWebApp.js +56 -56
- package/node_modules/ibm_db/test/trace +51 -51
- package/node_modules/ibm_db/test/typescript-apis-test.js +978 -978
- package/node_modules/ibm_db/test/webapp.html +17 -17
- package/node_modules/ibm_db/test/webapp.js +79 -79
- package/node_modules/ibm_db/typescript/README.md +28 -28
- package/node_modules/ibm_db/typescript/dist/Database.d.ts +26 -0
- package/node_modules/ibm_db/typescript/dist/ODBCStatement.d.ts +93 -0
- package/package.json +10 -6
- package/node_modules/ibm_db/test/disabled/test-binding-statement-rebinding.js +0 -59
- package/node_modules/ibm_db/test/disabled/test-open-dont-close.js +0 -12
- package/node_modules/ibm_db/test/disabled/test-param-select-with-booleans-only.js +0 -21
- package/node_modules/ibm_db/test/disabled/test-param-select-with-decimals-only.js +0 -20
- package/node_modules/ibm_db/test/disabled/test-param-select-with-null.js +0 -21
- package/node_modules/ibm_db/test/disabled/test-param-select-with-nulls-mixed.js +0 -23
- package/node_modules/ibm_db/test/disabled/test-param-select-with-numbers-mixed.js +0 -22
- package/node_modules/ibm_db/test/disabled/test-param-select-with-numbers-only.js +0 -24
- package/node_modules/ibm_db/test/disabled/test-param-select-with-strings-only.js +0 -23
- package/node_modules/ibm_db/test/disabled/test-param-select-with-unicode.js +0 -15
- package/node_modules/ibm_db/test/disabled/test-prepare-bind-execute-closeSync.js +0 -62
- package/node_modules/ibm_db/test/disabled/test-prepare-bind-execute-error.js +0 -49
- package/node_modules/ibm_db/test/disabled/test-prepare-bind-execute-long-string.js +0 -63
- package/node_modules/ibm_db/test/disabled/test-prepare-bind-executeNonQuery.js +0 -63
- package/node_modules/ibm_db/test/disabled/test-prepare-bindSync-execute-closeSync.js +0 -46
- package/node_modules/ibm_db/test/disabled/test-prepare-bindSync-executeNonQuery.js +0 -50
- package/node_modules/ibm_db/test/disabled/test-prepare.js +0 -34
- package/node_modules/ibm_db/test/disabled/test-prepareSync.js +0 -29
- package/node_modules/ibm_db/test/disabled/test-query-select-fetchAll.js +0 -23
- package/node_modules/ibm_db/test/disabled/test-query-select-fetchAllSync.js +0 -23
- package/node_modules/ibm_db/test/disabled/test-query-select-unicode.js +0 -15
- package/node_modules/ibm_db/test/disabled/test-querySync-select-unicode.js +0 -20
- package/node_modules/ibm_db/test/test-affected-rows.js +0 -55
- package/node_modules/ibm_db/test/test-bad-connection-string.js +0 -30
- package/node_modules/ibm_db/test/test-binding-connection-timeOut.js +0 -31
- package/node_modules/ibm_db/test/test-binding-statement-executeSync.js +0 -84
- package/node_modules/ibm_db/test/test-binding-transaction-commit.js +0 -79
- package/node_modules/ibm_db/test/test-binding-transaction-commitSync.js +0 -53
- package/node_modules/ibm_db/test/test-closed.js +0 -14
- package/node_modules/ibm_db/test/test-connection-object.js +0 -16
- package/node_modules/ibm_db/test/test-describe-column.js +0 -92
- package/node_modules/ibm_db/test/test-describe-database.js +0 -18
- package/node_modules/ibm_db/test/test-describe-table.js +0 -31
- package/node_modules/ibm_db/test/test-domains-open.js +0 -19
- package/node_modules/ibm_db/test/test-global-open-close.js +0 -11
- package/node_modules/ibm_db/test/test-instantiate-one-and-end.js +0 -9
- package/node_modules/ibm_db/test/test-multi-open-close.js +0 -45
- package/node_modules/ibm_db/test/test-multi-openSync-closeSync.js +0 -52
- package/node_modules/ibm_db/test/test-open-close.js +0 -29
- package/node_modules/ibm_db/test/test-open-connectTimeout.js +0 -33
- package/node_modules/ibm_db/test/test-openSync.js +0 -31
- package/node_modules/ibm_db/test/test-pool-close.js +0 -120
- package/node_modules/ibm_db/test/test-pool-connect.js +0 -36
- package/node_modules/ibm_db/test/test-pool-rollbackTransaction.js +0 -35
- package/node_modules/ibm_db/test/test-prepareSync-bad-sql.js +0 -34
- package/node_modules/ibm_db/test/test-promise-open-close.js +0 -33
- package/node_modules/ibm_db/test/test-query-create-table-fetchSync.js +0 -23
- package/node_modules/ibm_db/test/test-query-create-table.js +0 -12
- package/node_modules/ibm_db/test/test-query-drop-table.js +0 -13
- package/node_modules/ibm_db/test/test-query-insert.js +0 -38
- package/node_modules/ibm_db/test/test-query-select-fetch.js +0 -21
- package/node_modules/ibm_db/test/test-query-select-fetchMode-array.js +0 -17
- package/node_modules/ibm_db/test/test-query-select.js +0 -64
- package/node_modules/ibm_db/test/test-queryResult.js +0 -35
- package/node_modules/ibm_db/test/test-queryStream.js +0 -43
- package/node_modules/ibm_db/test/test-querySync-select-with-exception.js +0 -25
- package/node_modules/ibm_db/test/test-querySync-select.js +0 -28
- package/node_modules/ibm_db/test/test-require-and-end.js +0 -8
- package/node_modules/ibm_db/test/test-statement-close.js +0 -118
- package/node_modules/ibm_db/test/test-transaction-commit-sync.js +0 -54
- package/node_modules/ibm_db/test/test-transaction-commit.js +0 -79
package/README.md
CHANGED
|
@@ -25,19 +25,21 @@ Before you install and use the plug-in:
|
|
|
25
25
|
|
|
26
26
|
- [Install Zowe CLI](https://docs.zowe.org/stable/user-guide/cli-installcli.html) on your computer.
|
|
27
27
|
|
|
28
|
+
- Use Node.js 22 or newer. CI covers Node.js 22, 24, and 26.
|
|
29
|
+
|
|
28
30
|
- Have a license file for IBM Db2 Database for z/OS.
|
|
29
31
|
|
|
30
32
|
For connectivity to Db2 for z/OS, the Db2 region should be `db2connectactivated` or a `db2connect` license file should be provided. Copy the `db2connect` license file to the `[db2 plugin folder]/node_modules/ibm_db/installer/clidriver/license/` folder. For more information, see [Addressing the license requirement](https://docs.zowe.org/stable/user-guide/cli-db2plugin.html#addressing-the-license-requirement) on the Zowe Docs site.
|
|
31
33
|
|
|
32
|
-
- **(Linux and MacOS only)** Download and install [node-gyp](https://www.npmjs.com/package/node-gyp) globally by running `npm install -g node-gyp`
|
|
34
|
+
- **(Linux and MacOS source builds only)** Download and install [node-gyp](https://www.npmjs.com/package/node-gyp) globally by running `npm install -g node-gyp`
|
|
33
35
|
|
|
34
|
-
- **(MacOS only)** Download and Install [Xcode](https://developer.apple.com/xcode/resources/) and [Python 3](https://www.python.org/downloads/mac-osx/).
|
|
36
|
+
- **(MacOS source builds only)** Download and Install [Xcode](https://developer.apple.com/xcode/resources/) and [Python 3](https://www.python.org/downloads/mac-osx/).
|
|
35
37
|
|
|
36
|
-
- **(Linux only - Debian, Ubuntu)** Download and Install the following via apt: `python3 make g++`
|
|
38
|
+
- **(Linux source builds only - Debian, Ubuntu)** Download and Install the following via apt: `python3 make g++`
|
|
37
39
|
|
|
38
|
-
- **(Linux only - CentOS, RHEL)** Download and Install the following via yum: `python3 make gcc-c++`
|
|
40
|
+
- **(Linux source builds only - CentOS, RHEL)** Download and Install the following via yum: `python3 make gcc-c++`
|
|
39
41
|
|
|
40
|
-
-
|
|
42
|
+
- The plug-in bundles `ibm_db` 4, which uses [Node-API](https://github.com/ibmdb/node-ibm_db/tree/v4.0.1#prerequisite) instead of NAN. Its native binding does not need to be rebuilt solely because you upgrade to a newer compatible Node.js version on the same operating system and architecture. The native binding and IBM Db2 ODBC CLI driver must still be installed; see [The `ibm_db` module is not installed](#the-ibm_db-module-is-not-installed) if installation is incomplete. Precompiled bindings are available for supported Windows, Linux, and MacOS platforms when source compilation is unavailable.
|
|
41
43
|
|
|
42
44
|
## Installing
|
|
43
45
|
|
|
@@ -171,9 +173,9 @@ IBM® Db2® Plug-in for Zowe CLI was installed, but its required 'ibm_db' module
|
|
|
171
173
|
Db2 commands will fail until the installation of 'ibm_db' is completed.
|
|
172
174
|
```
|
|
173
175
|
|
|
174
|
-
The
|
|
176
|
+
The IBM Db2 Plug-in for Zowe CLI is installed and registered with Zowe CLI when this failure occurs. Only the `ibm_db` module is incomplete, so you do not need to reinstall the plug-in.
|
|
175
177
|
|
|
176
|
-
**Cause**: The plug-in delivers `ibm_db` as a bundled dependency, so that the plug-in can be installed without access to a public npm registry. However, `ibm_db` is a native module. Its own npm install script must download the IBM Db2 ODBC CLI driver and
|
|
178
|
+
**Cause**: The plug-in delivers `ibm_db` as a bundled dependency, so that the plug-in can be installed without access to a public npm registry. However, `ibm_db` is a native module. Its own npm install script must download the IBM Db2 ODBC CLI driver and install the binding for your platform, either by compiling it or using a precompiled binary. npm does not run the lifecycle scripts of a bundled dependency, so that install script does not run when the plug-in is installed. The `--allow-scripts` option of the `zowe plugins install` command does not change that behavior, because npm skips the scripts of bundled dependencies even when scripts are allowed.
|
|
177
179
|
|
|
178
180
|
**Action**: Run the `ibm_db` install script yourself. The error message contains the full path to the `ibm_db` directory on your system, which is normally the following path:
|
|
179
181
|
|
|
@@ -181,7 +183,7 @@ The plug-in itself is installed and registered with Zowe CLI when this failure o
|
|
|
181
183
|
<zowe home>/plugins/installed/node_modules/@zowe/db2-for-zowe-cli/node_modules/ibm_db
|
|
182
184
|
```
|
|
183
185
|
|
|
184
|
-
Change to that directory and run
|
|
186
|
+
Change to that directory and run the `ibm_db` install script:
|
|
185
187
|
|
|
186
188
|
```bash
|
|
187
189
|
cd "<zowe home>/plugins/installed/node_modules/@zowe/db2-for-zowe-cli/node_modules/ibm_db"
|
|
@@ -192,14 +194,14 @@ If npm is not available, run the same script directly with `node installer/drive
|
|
|
192
194
|
|
|
193
195
|
The script downloads the CLI driver from `https://public.dhe.ibm.com`, so the system needs network access to that site. If the system already has a Db2 client, a Db2 server, or a copy of the CLI driver, set the `IBM_DB_HOME` environment variable to that directory before you run the script to skip the download. For more `ibm_db` installation options, see the `README.md` file in the `ibm_db` directory.
|
|
194
196
|
|
|
195
|
-
###
|
|
197
|
+
### Native binary from an older plug-in installation
|
|
196
198
|
|
|
197
199
|
**Error message**:
|
|
198
200
|
```
|
|
199
201
|
The module 'C:\Users\User\.zowe\plugins\installed\node_modules\@zowe\db2-for-zowe-cli\node_modules\ibm_db\build\Release\odbc_bindings.node' was compiled against a different Node.js version using NODE_MODULE_VERSION ###. This version of Node.js requires NODE_MODULE_VERSION ###. Please try re-compiling or re-installing this module (for instance, using npm rebuild or npm install).
|
|
200
202
|
```
|
|
201
203
|
|
|
202
|
-
**Action**:
|
|
204
|
+
**Action**: Upgrade or reinstall the IBM Db2 Database Plug-in for Zowe CLI to replace the old native binary with the bundled `ibm_db` 4 binding. This error can occur with an older `ibm_db` 3 binding compiled for a different Node.js major version. `ibm_db` 4 uses Node-API, so changing between compatible Node.js versions on the same operating system and architecture does not require rebuilding the binding. If the updated module cannot be loaded, follow [The `ibm_db` module is not installed](#the-ibm_db-module-is-not-installed).
|
|
203
205
|
|
|
204
206
|
## Contributing
|
|
205
207
|
|
|
@@ -20,14 +20,6 @@ declare class Db2PluginLifeCycle extends AbstractPluginLifeCycle {
|
|
|
20
20
|
* @memberof Db2PluginLifeCycle
|
|
21
21
|
*/
|
|
22
22
|
static readonly NATIVE_MODULE_NM: string;
|
|
23
|
-
/**
|
|
24
|
-
* A horizontal rule used to make the reported steps stand out among the
|
|
25
|
-
* other messages that are displayed while a plug-in is installed.
|
|
26
|
-
* @type {string}
|
|
27
|
-
* @static
|
|
28
|
-
* @memberof Db2PluginLifeCycle
|
|
29
|
-
*/
|
|
30
|
-
private static readonly DIVIDER;
|
|
31
23
|
/**
|
|
32
24
|
* Confirm that the bundled native module can be loaded after the plug-in
|
|
33
25
|
* has been installed. When it cannot be loaded, report the steps that the
|
|
@@ -51,7 +43,7 @@ declare class Db2PluginLifeCycle extends AbstractPluginLifeCycle {
|
|
|
51
43
|
*
|
|
52
44
|
* @private
|
|
53
45
|
* @static
|
|
54
|
-
* @throws
|
|
46
|
+
* @throws If the native module is missing or installation is incomplete.
|
|
55
47
|
* @memberof Db2PluginLifeCycle
|
|
56
48
|
*/
|
|
57
49
|
private static loadNativeModule;
|
|
@@ -76,5 +68,15 @@ declare class Db2PluginLifeCycle extends AbstractPluginLifeCycle {
|
|
|
76
68
|
* @memberof Db2PluginLifeCycle
|
|
77
69
|
*/
|
|
78
70
|
private static findNativeModuleDir;
|
|
71
|
+
/**
|
|
72
|
+
* A horizontal rule used to make the reported steps stand out among the
|
|
73
|
+
* other messages that are displayed while a plug-in is installed.
|
|
74
|
+
*
|
|
75
|
+
* @private
|
|
76
|
+
* @static
|
|
77
|
+
* @returns {string}
|
|
78
|
+
* @memberof Db2PluginLifeCycle
|
|
79
|
+
*/
|
|
80
|
+
private static get dividerLine();
|
|
79
81
|
}
|
|
80
82
|
export = Db2PluginLifeCycle;
|
|
@@ -37,7 +37,6 @@ class Db2PluginLifeCycle extends imperative_1.AbstractPluginLifeCycle {
|
|
|
37
37
|
* @memberof Db2PluginLifeCycle
|
|
38
38
|
*/
|
|
39
39
|
postInstall() {
|
|
40
|
-
var _a;
|
|
41
40
|
const impLogger = imperative_1.Logger.getImperativeLogger();
|
|
42
41
|
try {
|
|
43
42
|
Db2PluginLifeCycle.loadNativeModule();
|
|
@@ -45,7 +44,7 @@ class Db2PluginLifeCycle extends imperative_1.AbstractPluginLifeCycle {
|
|
|
45
44
|
`after the installation of ${Constants_1.Constants.DISPLAY_NAME}.`);
|
|
46
45
|
}
|
|
47
46
|
catch (err) {
|
|
48
|
-
const warningMsg = Db2PluginLifeCycle.formIncompleteInstallMsg(
|
|
47
|
+
const warningMsg = Db2PluginLifeCycle.formIncompleteInstallMsg(err instanceof Error ? err.message : String(err));
|
|
49
48
|
impLogger.warn(warningMsg);
|
|
50
49
|
throw new imperative_1.ImperativeError({ msg: warningMsg });
|
|
51
50
|
}
|
|
@@ -64,7 +63,7 @@ class Db2PluginLifeCycle extends imperative_1.AbstractPluginLifeCycle {
|
|
|
64
63
|
*
|
|
65
64
|
* @private
|
|
66
65
|
* @static
|
|
67
|
-
* @throws
|
|
66
|
+
* @throws If the native module is missing or installation is incomplete.
|
|
68
67
|
* @memberof Db2PluginLifeCycle
|
|
69
68
|
*/
|
|
70
69
|
static loadNativeModule() {
|
|
@@ -83,7 +82,7 @@ class Db2PluginLifeCycle extends imperative_1.AbstractPluginLifeCycle {
|
|
|
83
82
|
static formIncompleteInstallMsg(reason) {
|
|
84
83
|
const nativeMod = Db2PluginLifeCycle.NATIVE_MODULE_NM;
|
|
85
84
|
const nativeModDir = Db2PluginLifeCycle.findNativeModuleDir();
|
|
86
|
-
return `\n${Db2PluginLifeCycle.
|
|
85
|
+
return `\n${Db2PluginLifeCycle.dividerLine}\n` +
|
|
87
86
|
`${Constants_1.Constants.DISPLAY_NAME} was installed, but its required '${nativeMod}' module could not be loaded.\n` +
|
|
88
87
|
`Db2 commands will fail until the installation of '${nativeMod}' is completed.\n` +
|
|
89
88
|
`\n` +
|
|
@@ -110,7 +109,7 @@ class Db2PluginLifeCycle extends imperative_1.AbstractPluginLifeCycle {
|
|
|
110
109
|
`skip the download.\n` +
|
|
111
110
|
`\n` +
|
|
112
111
|
`See ${path.join(nativeModDir, "README.md")} for more '${nativeMod}' installation options.\n` +
|
|
113
|
-
`${Db2PluginLifeCycle.
|
|
112
|
+
`${Db2PluginLifeCycle.dividerLine}\n`;
|
|
114
113
|
}
|
|
115
114
|
/**
|
|
116
115
|
* Find the directory into which the native module was installed, so that
|
|
@@ -134,6 +133,20 @@ class Db2PluginLifeCycle extends imperative_1.AbstractPluginLifeCycle {
|
|
|
134
133
|
return path.resolve(__dirname, "..", "node_modules", nativeMod);
|
|
135
134
|
}
|
|
136
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* A horizontal rule used to make the reported steps stand out among the
|
|
138
|
+
* other messages that are displayed while a plug-in is installed.
|
|
139
|
+
*
|
|
140
|
+
* @private
|
|
141
|
+
* @static
|
|
142
|
+
* @returns {string}
|
|
143
|
+
* @memberof Db2PluginLifeCycle
|
|
144
|
+
*/
|
|
145
|
+
static get dividerLine() {
|
|
146
|
+
var _a;
|
|
147
|
+
const defaultWidth = 100;
|
|
148
|
+
return "_".repeat(Math.min(((_a = process.stdout) === null || _a === void 0 ? void 0 : _a.columns) || Infinity, defaultWidth));
|
|
149
|
+
}
|
|
137
150
|
}
|
|
138
151
|
/**
|
|
139
152
|
* The name of the native module that Db2 commands require.
|
|
@@ -142,13 +155,5 @@ class Db2PluginLifeCycle extends imperative_1.AbstractPluginLifeCycle {
|
|
|
142
155
|
* @memberof Db2PluginLifeCycle
|
|
143
156
|
*/
|
|
144
157
|
Db2PluginLifeCycle.NATIVE_MODULE_NM = "ibm_db";
|
|
145
|
-
/**
|
|
146
|
-
* A horizontal rule used to make the reported steps stand out among the
|
|
147
|
-
* other messages that are displayed while a plug-in is installed.
|
|
148
|
-
* @type {string}
|
|
149
|
-
* @static
|
|
150
|
-
* @memberof Db2PluginLifeCycle
|
|
151
|
-
*/
|
|
152
|
-
Db2PluginLifeCycle.DIVIDER = "____________________________________________________________________________________________________";
|
|
153
158
|
module.exports = Db2PluginLifeCycle;
|
|
154
159
|
//# sourceMappingURL=Db2PluginLifeCycle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Db2PluginLifeCycle.js","sourceRoot":"","sources":["../src/Db2PluginLifeCycle.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE;AAEF,6BAA6B;AAC7B,iDAAoF;AACpF,2CAAwC;AAExC;;;;;;;;;;;;GAYG;AACH,MAAM,kBAAmB,SAAQ,oCAAuB;
|
|
1
|
+
{"version":3,"file":"Db2PluginLifeCycle.js","sourceRoot":"","sources":["../src/Db2PluginLifeCycle.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE;AAEF,6BAA6B;AAC7B,iDAAoF;AACpF,2CAAwC;AAExC;;;;;;;;;;;;GAYG;AACH,MAAM,kBAAmB,SAAQ,oCAAuB;IASpD;;;;;;;;;OASG;IACI,WAAW;QACd,MAAM,SAAS,GAAG,mBAAM,CAAC,mBAAmB,EAAE,CAAC;QAC/C,IAAI,CAAC;YACD,kBAAkB,CAAC,gBAAgB,EAAE,CAAC;YACtC,SAAS,CAAC,KAAK,CAAC,QAAQ,kBAAkB,CAAC,gBAAgB,mCAAmC;gBAC1F,6BAA6B,qBAAS,CAAC,YAAY,GAAG,CACzD,CAAC;QACN,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,MAAM,UAAU,GAAG,kBAAkB,CAAC,wBAAwB,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;YACjH,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC3B,MAAM,IAAI,4BAAe,CAAC,EAAC,GAAG,EAAE,UAAU,EAAC,CAAC,CAAC;QACjD,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,YAAY;QACf,gBAAgB;IACpB,CAAC;IAED;;;;;;;OAOG;IACK,MAAM,CAAC,gBAAgB;QAC3B,OAAO,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IACjD,CAAC;IAED;;;;;;;;;OASG;IACK,MAAM,CAAC,wBAAwB,CAAC,MAAc;QAClD,MAAM,SAAS,GAAG,kBAAkB,CAAC,gBAAgB,CAAC;QACtD,MAAM,YAAY,GAAG,kBAAkB,CAAC,mBAAmB,EAAE,CAAC;QAE9D,OAAO,KAAK,kBAAkB,CAAC,WAAW,IAAI;YAC1C,GAAG,qBAAS,CAAC,YAAY,qCAAqC,SAAS,iCAAiC;YACxG,qDAAqD,SAAS,mBAAmB;YACjF,IAAI;YACJ,YAAY,MAAM,IAAI;YACtB,IAAI;YACJ,yBAAyB,SAAS,mEAAmE;YACrG,sDAAsD,SAAS,6CAA6C;YAC5G,sGAAsG;YACtG,qGAAqG;YACrG,oGAAoG;YACpG,gFAAgF;YAChF,IAAI;YACJ,iEAAiE;YACjE,IAAI;YACJ,WAAW,YAAY,KAAK;YAC5B,uBAAuB;YACvB,IAAI;YACJ,oEAAoE,SAAS,6BAA6B;YAC1G,sCAAsC;YACtC,IAAI;YACJ,oGAAoG;YACpG,oGAAoG;YACpG,mGAAmG;YACnG,sBAAsB;YACtB,IAAI;YACJ,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,cAAc,SAAS,2BAA2B;YAC7F,GAAG,kBAAkB,CAAC,WAAW,IAAI,CAAC;IAC9C,CAAC;IAED;;;;;;;;OAQG;IACK,MAAM,CAAC,mBAAmB;QAC9B,MAAM,SAAS,GAAG,kBAAkB,CAAC,gBAAgB,CAAC;QACtD,IAAI,CAAC;YACD;;eAEG;YACH,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS,eAAe,CAAC,CAAC,CAAC;QACtE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,wEAAwE;YACxE,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC;QACpE,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACK,MAAM,KAAK,WAAW;;QAC1B,MAAM,YAAY,GAAG,GAAG,CAAC;QACzB,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,MAAA,OAAO,CAAC,MAAM,0CAAE,OAAO,KAAI,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;IACnF,CAAC;;AApID;;;;;GAKG;AACoB,mCAAgB,GAAW,QAAQ,CAAC;AAiI/D,iBAAS,kBAAkB,CAAC"}
|
|
@@ -1,5 +1,67 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v1.19.0 — July 22, 2026
|
|
4
|
+
|
|
5
|
+
This release raises the form-data security floor, adds configuration and type-system capabilities, and fixes NO_PROXY matching, interceptor errors, progress reporting, and serialization edge cases.
|
|
6
|
+
|
|
7
|
+
## 🔒 Security Fixes
|
|
8
|
+
|
|
9
|
+
- Multipart Form Data: Raised the form-data dependency floor to ^4.0.6, preventing fresh installations from resolving versions affected by the CRLF injection vulnerability GHSA-hmw2-7cc7-3qxx (https://github.com/advisories/GHSA-hmw2-7cc7-3qxx). (#11028)
|
|
10
|
+
|
|
11
|
+
## 🚀 New Features
|
|
12
|
+
|
|
13
|
+
- Configuration Extensibility: Preserved own-enumerable symbol-keyed fields through mergeConfig and added a generic params type across public TypeScript declarations, responses, errors,
|
|
14
|
+
adapters, and serializers. (#11043, #11081)
|
|
15
|
+
- Header Parameter Parsing: Added the opt-in AxiosHeaders.parseParameters() parser for quote-aware, RFC-style HTTP parameter parsing while preserving legacy parsing behavior. (#11051)
|
|
16
|
+
- HTTP Status Codes: Added the missing Cloudflare 520 WebServerReturnsAnUnknownError status and matching ESM/CJS declarations. (#11067)
|
|
17
|
+
|
|
18
|
+
## 🐛 Bug Fixes
|
|
19
|
+
|
|
20
|
+
- Form Data Conversion: Limited formDataToJSON path splitting to dot and bracket notation, preserving literal punctuation in keys, and removed browser-facing Buffer.from usage from toFormData to avoid unnecessary polyfills. (#11006, #11018)
|
|
21
|
+
- Proxy Bypass: Canonicalized IPv4 shorthand, octal, and hexadecimal forms during NO_PROXY matching and honored * entries within comma- or space-separated bypass lists. (#11029, #11053)
|
|
22
|
+
- Cancellation: Propagated already-aborted input signals immediately when composing abort signals. (#11035)
|
|
23
|
+
- Header Handling: Preserved empty first values for duplicate singleton headers and made AxiosHeaders#getSetCookie() consistently return arrays for present values. (#11036, #11037)
|
|
24
|
+
- URL Handling: Included normalized, safely redacted offending URLs in malformed-protocol errors and removed repeated trailing slashes when combining base URLs. (#11008, #11038)
|
|
25
|
+
|
|
26
|
+
- Progress Events: Clamped malformed negative progress values to zero and ensured final Node.js download progress events are delivered before streamed responses close. (#11039, #11040)
|
|
27
|
+
- Error and JSON Serialization: Serialized Set values as arrays in JSON-compatible snapshots and synthesized useful AxiosError messages from otherwise-empty AggregateError instances. (#11044, #11059)
|
|
28
|
+
- Content-Length Enforcement: Corrected base64 data: URL size estimation so maxContentLength is enforced consistently by the HTTP and Fetch adapters. (#11061)
|
|
29
|
+
- Synchronous Interceptors: Prevented requests from being dispatched after synchronous request interceptors fail unless their paired rejection handler resolves successfully. (#11071)
|
|
30
|
+
|
|
31
|
+
## 🔧 Maintenance & Chores
|
|
32
|
+
|
|
33
|
+
- Dependencies: Updated development and test tooling, the docs fixture's Axios version, and GitHub Actions integrations including Checkout, Setup Node, Setup Deno, and Zizmor. (#11031, #11055, #11056, #11058, #11079, #11080, #11088, #11089, #11090)
|
|
34
|
+
- Build Outputs: Limited sourcemap generation to published minified bundles, removing broken map references from non-minified builds. (#11054)
|
|
35
|
+
- Form Data Internals: Centralized FormData header handling and made the Node.js adapter tolerate getHeaders() returning undefined under the content-only policy. (#11062)
|
|
36
|
+
- Developer Experience: Ignored common local AI-tooling directories and fixed a constant-reassignment crash when the development sandbox serves its root path. (#11032, #11073)
|
|
37
|
+
- Documentation: Updated sponsor information, clarified that baseURL is not a path-security boundary, scoped provenance claims to attested releases, and corrected the configuration-defaults documentation. (#11041, #11068, #11076, #11078)
|
|
38
|
+
- Publishing: Simplified v1 publishing to use the npm version bundled with Node.js 26 and updated package metadata for the 1.19.0 release. (#11083, #11095)
|
|
39
|
+
|
|
40
|
+
## 🌟 New Contributors
|
|
41
|
+
|
|
42
|
+
We are thrilled to welcome our new contributors. Thank you for helping improve Axios:
|
|
43
|
+
|
|
44
|
+
- @afonsojramos (#11028)
|
|
45
|
+
- @MahinAnowar (#11006)
|
|
46
|
+
- @yassertawfik4 (#11024)
|
|
47
|
+
- @AnandSundar (#11029)
|
|
48
|
+
- @lin-hongkuan (#11035)
|
|
49
|
+
- @Wali007-lab (#11054)
|
|
50
|
+
- @magicdawn (#11043)
|
|
51
|
+
- @andrewkernel (#11053)
|
|
52
|
+
- @Sagargupta16 (#11059)
|
|
53
|
+
- @Rpaudel379 (#11078)
|
|
54
|
+
- @kobihikri (#11076)
|
|
55
|
+
- @spokodev (#11061)
|
|
56
|
+
- @shaedrich (#11081)
|
|
57
|
+
- @QodeXcli (#11062)
|
|
58
|
+
- @akahoshi1421 (#11067)
|
|
59
|
+
- @TheHonoredOne914 (#11071)
|
|
60
|
+
- @Ahsan1Murtaza (#11073)
|
|
61
|
+
|
|
62
|
+
[Full Changelog](https://github.com/axios/axios/compare/v1.18.1...v1.19.0)
|
|
63
|
+
|
|
64
|
+
|
|
3
65
|
## v1.18.0 — June 13, 2026
|
|
4
66
|
|
|
5
67
|
This release hardens redirect and URL handling, improves the validateStatus configuration semantics, and includes updates to documentation, dependencies, and release metadata.
|
|
@@ -349,6 +349,67 @@
|
|
|
349
349
|
>
|
|
350
350
|
</p>
|
|
351
351
|
</td>
|
|
352
|
+
<td align="center" width="33.333333333333336%">
|
|
353
|
+
<a
|
|
354
|
+
href="https://kasyno.us.com/?utm_source=axios_docs_website&utm_medium=website&utm_campaign=axios_open_collective_sponsorship"
|
|
355
|
+
style="padding: 10px; display: inline-block"
|
|
356
|
+
target="_blank"
|
|
357
|
+
>
|
|
358
|
+
<img
|
|
359
|
+
width="71px"
|
|
360
|
+
height="70px"
|
|
361
|
+
src="https://images.opencollective.com/polskie-kasyno-online/c25e456/avatar.png"
|
|
362
|
+
alt="polskie kasyno online"
|
|
363
|
+
/>
|
|
364
|
+
</a>
|
|
365
|
+
<p
|
|
366
|
+
align="center"
|
|
367
|
+
>
|
|
368
|
+
Kasyno.us.com to niezależny portal o tematyce kasyno online Polska, który pomaga graczom znaleźć bezpieczne i sprawdzone kasyna internetowe.
|
|
369
|
+
</p>
|
|
370
|
+
<p align="center">
|
|
371
|
+
<a
|
|
372
|
+
href="https://kasyno.us.com/?utm_source=axios_docs_website&utm_medium=website&utm_campaign=axios_open_collective_sponsorship"
|
|
373
|
+
target="_blank"
|
|
374
|
+
><b>kasyno.us.com</b></a
|
|
375
|
+
>
|
|
376
|
+
</p>
|
|
377
|
+
</td>
|
|
378
|
+
</tr>
|
|
379
|
+
<tr width="33.333333333333336%">
|
|
380
|
+
<td align="center" width="33.333333333333336%">
|
|
381
|
+
<a
|
|
382
|
+
href="https://www.scrapingbee.com/?utm_source=axios_docs_website&utm_medium=website&utm_campaign=axios_open_collective_sponsorship"
|
|
383
|
+
style="padding: 10px; display: inline-block"
|
|
384
|
+
target="_blank"
|
|
385
|
+
>
|
|
386
|
+
<img
|
|
387
|
+
width="90px"
|
|
388
|
+
height="90px"
|
|
389
|
+
src="https://images.opencollective.com/scrapingbee/6d5dc95/logo.png"
|
|
390
|
+
alt="ScrapingBee"
|
|
391
|
+
/>
|
|
392
|
+
</a>
|
|
393
|
+
<p
|
|
394
|
+
align="center"
|
|
395
|
+
>
|
|
396
|
+
Scrape websites with a powerful web scraping API without managing proxies, browsers, or anti-bot defenses.
|
|
397
|
+
</p>
|
|
398
|
+
<p align="center">
|
|
399
|
+
<a
|
|
400
|
+
href="https://www.scrapingbee.com/?utm_source=axios_docs_website&utm_medium=website&utm_campaign=axios_open_collective_sponsorship"
|
|
401
|
+
target="_blank"
|
|
402
|
+
><b>scrapingbee.com</b></a
|
|
403
|
+
>
|
|
404
|
+
</p>
|
|
405
|
+
</td>
|
|
406
|
+
<td align="center" width="33.333333333333336%">
|
|
407
|
+
<a
|
|
408
|
+
href="https://opencollective.com/axios/contribute"
|
|
409
|
+
target="_blank"
|
|
410
|
+
>💜 Become a sponsor</a
|
|
411
|
+
>
|
|
412
|
+
</td>
|
|
352
413
|
<td align="center" width="33.333333333333336%">
|
|
353
414
|
<a
|
|
354
415
|
href="https://opencollective.com/axios/contribute"
|
|
@@ -648,6 +709,7 @@ axios({
|
|
|
648
709
|
|
|
649
710
|
```js
|
|
650
711
|
// GET request for remote image in node.js
|
|
712
|
+
import fs from 'fs';
|
|
651
713
|
const response = await axios({
|
|
652
714
|
method: 'get',
|
|
653
715
|
url: 'https://bit.ly/2mTM3nY',
|
|
@@ -763,6 +825,8 @@ These config options are available for requests. Only `url` is required. Request
|
|
|
763
825
|
// `baseURL` is not a security boundary. If `url` is attacker-controlled, validate it
|
|
764
826
|
// before passing it to axios. Relative URLs can contain `..` segments that resolve
|
|
765
827
|
// outside an intended path prefix after the final URL is parsed.
|
|
828
|
+
// HTTP(S) URLs must include `//` after the protocol. Values such as
|
|
829
|
+
// `https:example.com` and `https:/example.com` are rejected with ERR_INVALID_URL.
|
|
766
830
|
baseURL: 'https://some-domain.com/api/',
|
|
767
831
|
|
|
768
832
|
// `allowAbsoluteUrls` determines whether or not absolute URLs will override a configured `baseUrl`.
|
|
@@ -1371,6 +1435,40 @@ axios.interceptors.request.use(
|
|
|
1371
1435
|
);
|
|
1372
1436
|
```
|
|
1373
1437
|
|
|
1438
|
+
If a synchronous request interceptor throws, Axios calls that interceptor's paired rejection handler and stops running the remaining request interceptors. A rejection handler that returns normally, including one that returns `undefined` or a fulfilled Promise, treats the error as handled: Axios dispatches the request with the last valid config, and ignores the handler's return value. To block dispatch, omit the rejection handler or throw/return a rejected Promise from it. The final error then continues through response rejection interceptors.
|
|
1439
|
+
|
|
1440
|
+
Use a rejected Promise when validation must prevent the request:
|
|
1441
|
+
|
|
1442
|
+
```js
|
|
1443
|
+
axios.interceptors.request.use(
|
|
1444
|
+
function validate(config) {
|
|
1445
|
+
if (!config.headers.has('Authorization')) {
|
|
1446
|
+
throw new Error('Authorization is required');
|
|
1447
|
+
}
|
|
1448
|
+
return config;
|
|
1449
|
+
},
|
|
1450
|
+
function rejectInvalidRequest(error) {
|
|
1451
|
+
return Promise.reject(error);
|
|
1452
|
+
},
|
|
1453
|
+
{ synchronous: true }
|
|
1454
|
+
);
|
|
1455
|
+
```
|
|
1456
|
+
|
|
1457
|
+
A logging-only rejection handler can return normally to preserve the existing request-continuation behavior:
|
|
1458
|
+
|
|
1459
|
+
```js
|
|
1460
|
+
axios.interceptors.request.use(
|
|
1461
|
+
function prepare(config) {
|
|
1462
|
+
throw new Error('Optional preparation failed');
|
|
1463
|
+
},
|
|
1464
|
+
function logPreparationFailure(error) {
|
|
1465
|
+
console.warn(error);
|
|
1466
|
+
// Returning normally dispatches with the last valid config.
|
|
1467
|
+
},
|
|
1468
|
+
{ synchronous: true }
|
|
1469
|
+
);
|
|
1470
|
+
```
|
|
1471
|
+
|
|
1374
1472
|
If you want to execute a particular interceptor based on a runtime check,
|
|
1375
1473
|
you can add a `runWhen` function to the options object. The request interceptor will not run **if and only if** the return
|
|
1376
1474
|
of `runWhen` is `false`. Axios calls the function with the config
|
|
@@ -1438,7 +1536,7 @@ When a response is fulfilled and multiple response interceptors are registered:
|
|
|
1438
1536
|
- If a fulfillment interceptor throws, Axios skips the next fulfillment interceptor and calls the next rejection interceptor.
|
|
1439
1537
|
- After the error is caught, later fulfillment interceptors run again, just like in a promise chain.
|
|
1440
1538
|
|
|
1441
|
-
Read [the interceptor tests](./
|
|
1539
|
+
Read [the interceptor tests](./tests/browser/interceptors.browser.test.js) to see all this in code.
|
|
1442
1540
|
|
|
1443
1541
|
## Error types
|
|
1444
1542
|
|
|
@@ -1496,6 +1594,10 @@ axios.get('/user/12345').catch(function (error) {
|
|
|
1496
1594
|
});
|
|
1497
1595
|
```
|
|
1498
1596
|
|
|
1597
|
+
Axios rejects an `http:` or `https:` request `url` or `baseURL` that omits `//` after the protocol. For example, `https:example.com` and `https:/example.com` reject with `AxiosError` code `ERR_INVALID_URL` instead of being silently normalized. Pass a well-formed URL such as `https://example.com`.
|
|
1598
|
+
|
|
1599
|
+
The error identifies the malformed URL, for example `Invalid URL "https:example.com": missing "//" after protocol`. To keep logs useful without leaking secrets, Axios reports the control-character-normalized URL with credentials, query parameter values, and fragment contents redacted; the scheme, host, path, and query parameter names remain visible.
|
|
1600
|
+
|
|
1499
1601
|
Use `validateStatus` to override the default condition (`status >= 200 && status < 300`) and choose which HTTP status codes should reject.
|
|
1500
1602
|
|
|
1501
1603
|
```js
|
|
@@ -1931,6 +2033,24 @@ formData.append('users[1][surname]', 'Anderson');
|
|
|
1931
2033
|
formData.append('obj2{}', '[{"x":1}]');
|
|
1932
2034
|
```
|
|
1933
2035
|
|
|
2036
|
+
### Converting FormData to JSON
|
|
2037
|
+
|
|
2038
|
+
`axios.formToJSON()` converts `FormData` field names that use dot or bracket notation into nested objects and arrays. Only `.`, `[`, and `]` are structural separators. Other characters, including `-`, spaces, `+`, `*`, and `&`, remain part of the literal key.
|
|
2039
|
+
|
|
2040
|
+
```js
|
|
2041
|
+
const form = new FormData();
|
|
2042
|
+
form.append('user-name', 'johndoe');
|
|
2043
|
+
form.append('user.name', 'john');
|
|
2044
|
+
|
|
2045
|
+
console.log(axios.formToJSON(form));
|
|
2046
|
+
// {
|
|
2047
|
+
// 'user-name': 'johndoe',
|
|
2048
|
+
// user: { name: 'john' }
|
|
2049
|
+
// }
|
|
2050
|
+
```
|
|
2051
|
+
|
|
2052
|
+
`user[name]` also creates `{ user: { name: ... } }`, while `items[]` creates an array.
|
|
2053
|
+
|
|
1934
2054
|
Axios supports `postForm`, `putForm`, and `patchForm` as shortcuts for the matching HTTP methods with the `Content-Type` header preset to `multipart/form-data`.
|
|
1935
2055
|
|
|
1936
2056
|
## Posting files
|
|
@@ -2004,10 +2124,9 @@ submits this JSON object:
|
|
|
2004
2124
|
{
|
|
2005
2125
|
"foo": "1",
|
|
2006
2126
|
"deep": {
|
|
2007
|
-
"prop":
|
|
2008
|
-
"spaced": "3"
|
|
2009
|
-
}
|
|
2127
|
+
"prop": "2"
|
|
2010
2128
|
},
|
|
2129
|
+
"deep prop spaced": "3",
|
|
2011
2130
|
"baz": [
|
|
2012
2131
|
"4",
|
|
2013
2132
|
"5"
|
|
@@ -2018,6 +2137,8 @@ submits this JSON object:
|
|
|
2018
2137
|
}
|
|
2019
2138
|
```
|
|
2020
2139
|
|
|
2140
|
+
Only dot and bracket notation create nested paths when a form is converted to JSON. Spaces and other punctuation remain part of literal field names.
|
|
2141
|
+
|
|
2021
2142
|
Sending `Blobs`/`Files` as JSON (`base64`) is not currently supported.
|
|
2022
2143
|
|
|
2023
2144
|
## Progress capturing
|
|
@@ -2246,8 +2367,9 @@ Returns `this`.
|
|
|
2246
2367
|
### AxiosHeaders#get(header)
|
|
2247
2368
|
|
|
2248
2369
|
```
|
|
2249
|
-
get(headerName: string,
|
|
2370
|
+
get(headerName: string, parser: typeof AxiosHeaders.parseParameters): AxiosHeaderParameters;
|
|
2250
2371
|
get(headerName: string, parser: RegExp): RegExpExecArray | null;
|
|
2372
|
+
get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue;
|
|
2251
2373
|
```
|
|
2252
2374
|
|
|
2253
2375
|
Returns the internal value of the header. It can take an extra argument to parse the header's value with `RegExp.exec`,
|
|
@@ -2267,6 +2389,15 @@ console.log(headers.get('Content-Type', true)); // parse key-value pairs from a
|
|
|
2267
2389
|
// boundary: 'Asrf456BGe4h'
|
|
2268
2390
|
// }
|
|
2269
2391
|
|
|
2392
|
+
const quotedHeaders = new AxiosHeaders({
|
|
2393
|
+
'Content-Type': 'multipart/form-data; boundary="a,b"',
|
|
2394
|
+
});
|
|
2395
|
+
|
|
2396
|
+
console.log({
|
|
2397
|
+
...quotedHeaders.get('Content-Type', AxiosHeaders.parseParameters),
|
|
2398
|
+
});
|
|
2399
|
+
// { boundary: 'a,b' }
|
|
2400
|
+
|
|
2270
2401
|
console.log(
|
|
2271
2402
|
headers.get('Content-Type', (value, name, headers) => {
|
|
2272
2403
|
return String(value).replace(/a/g, 'ZZZ');
|
|
@@ -2278,6 +2409,10 @@ console.log(headers.get('Content-Type', /boundary=(\w+)/)?.[0]);
|
|
|
2278
2409
|
// boundary=Asrf456BGe4h
|
|
2279
2410
|
```
|
|
2280
2411
|
|
|
2412
|
+
`AxiosHeaders.parseParameters` is the opt-in parser for normalized HTTP parameter values. It returns a null-prototype map, matches parameter names case-insensitively, removes quoted-string delimiters, decodes escaped quotes and backslashes, preserves commas and semicolons inside quoted values, and removes only HTTP optional whitespace around unquoted values. It omits the unsafe keys `__proto__`, `constructor`, and `prototype`.
|
|
2413
|
+
|
|
2414
|
+
Passing `true` remains the legacy tokenizer and keeps its existing output for backward compatibility.
|
|
2415
|
+
|
|
2281
2416
|
Returns the value of the header.
|
|
2282
2417
|
|
|
2283
2418
|
### AxiosHeaders#has(header, matcher?)
|
|
@@ -2562,6 +2697,99 @@ try {
|
|
|
2562
2697
|
}
|
|
2563
2698
|
```
|
|
2564
2699
|
|
|
2700
|
+
### Typing request data and query params
|
|
2701
|
+
|
|
2702
|
+
`AxiosRequestConfig<D = any, P = any>` uses `D` for the request body and `P` for query parameters. The params serializer receives the same `P`, and both types are preserved on the default response config:
|
|
2703
|
+
|
|
2704
|
+
```typescript
|
|
2705
|
+
import axios, {
|
|
2706
|
+
type AxiosPromise,
|
|
2707
|
+
type AxiosRequestConfig,
|
|
2708
|
+
type InternalAxiosRequestConfig,
|
|
2709
|
+
} from 'axios';
|
|
2710
|
+
|
|
2711
|
+
interface RequestBody {
|
|
2712
|
+
includeArchived: boolean;
|
|
2713
|
+
}
|
|
2714
|
+
|
|
2715
|
+
interface SearchParams {
|
|
2716
|
+
query: string;
|
|
2717
|
+
page?: number;
|
|
2718
|
+
}
|
|
2719
|
+
|
|
2720
|
+
interface SearchResponse {
|
|
2721
|
+
results: string[];
|
|
2722
|
+
}
|
|
2723
|
+
|
|
2724
|
+
const config: AxiosRequestConfig<RequestBody, SearchParams> = {
|
|
2725
|
+
data: { includeArchived: false },
|
|
2726
|
+
params: { query: 'axios', page: 1 },
|
|
2727
|
+
paramsSerializer: (params) => `${params.query}:${params.page ?? 1}`,
|
|
2728
|
+
};
|
|
2729
|
+
|
|
2730
|
+
const response = await axios.get('/search', config);
|
|
2731
|
+
response.config.data; // RequestBody | undefined
|
|
2732
|
+
response.config.params; // SearchParams | undefined
|
|
2733
|
+
|
|
2734
|
+
const invalidConfig: AxiosRequestConfig<RequestBody, SearchParams> = {
|
|
2735
|
+
// @ts-expect-error `query` must be a string
|
|
2736
|
+
params: { query: 123 },
|
|
2737
|
+
};
|
|
2738
|
+
|
|
2739
|
+
const adapter = (
|
|
2740
|
+
adapterConfig: InternalAxiosRequestConfig<RequestBody, SearchParams>
|
|
2741
|
+
): AxiosPromise<SearchResponse, RequestBody, SearchParams> =>
|
|
2742
|
+
Promise.resolve({
|
|
2743
|
+
data: { results: [] },
|
|
2744
|
+
status: 200,
|
|
2745
|
+
statusText: 'OK',
|
|
2746
|
+
headers: {},
|
|
2747
|
+
config: adapterConfig,
|
|
2748
|
+
});
|
|
2749
|
+
```
|
|
2750
|
+
|
|
2751
|
+
The request methods place `P` last—`<T, R, D, P>`—so the existing response data (`T`), custom response (`R`), and request data (`D`) positions do not change. Explicit custom response types still determine the resolved value. `RawAxiosRequestConfig`, `InternalAxiosRequestConfig`, defaults, `AxiosResponse`, `AxiosPromise<T, D, P>`, `AxiosError`, `CanceledError`, callable instances, adapters, and `mergeConfig()` also carry `P`. The default is `any` for backward compatibility.
|
|
2752
|
+
|
|
2753
|
+
Use all three public error generics when cancellation narrowing must retain the response, request body, and params types:
|
|
2754
|
+
|
|
2755
|
+
```typescript
|
|
2756
|
+
declare const error: unknown;
|
|
2757
|
+
|
|
2758
|
+
if (axios.isCancel<SearchResponse, RequestBody, SearchParams>(error)) {
|
|
2759
|
+
error.config?.data; // RequestBody | undefined
|
|
2760
|
+
error.config?.params; // SearchParams | undefined
|
|
2761
|
+
}
|
|
2762
|
+
```
|
|
2763
|
+
|
|
2764
|
+
### Symbol-keyed custom request config
|
|
2765
|
+
|
|
2766
|
+
Own enumerable symbol properties survive config merging, so module-augmented options can reach request interceptors and adapters:
|
|
2767
|
+
|
|
2768
|
+
```typescript
|
|
2769
|
+
import axios from 'axios';
|
|
2770
|
+
|
|
2771
|
+
export const someFlag: unique symbol = Symbol(
|
|
2772
|
+
'some flag used in request interceptor'
|
|
2773
|
+
);
|
|
2774
|
+
|
|
2775
|
+
declare module 'axios' {
|
|
2776
|
+
interface AxiosRequestConfig<D = any, P = any> {
|
|
2777
|
+
[someFlag]?: boolean;
|
|
2778
|
+
}
|
|
2779
|
+
}
|
|
2780
|
+
|
|
2781
|
+
axios.interceptors.request.use((config) => {
|
|
2782
|
+
if (config[someFlag]) {
|
|
2783
|
+
config.headers.set('X-Some-Flag', 'enabled');
|
|
2784
|
+
}
|
|
2785
|
+
return config;
|
|
2786
|
+
});
|
|
2787
|
+
|
|
2788
|
+
await axios.get('/users', { [someFlag]: true });
|
|
2789
|
+
```
|
|
2790
|
+
|
|
2791
|
+
Only own enumerable symbol properties are copied; inherited and non-enumerable symbol properties are not.
|
|
2792
|
+
|
|
2565
2793
|
Because axios publishes an ESM default export and a CJS `module.exports`, TypeScript has a few caveats.
|
|
2566
2794
|
The recommended setting is `"moduleResolution": "node16"`, which is implied by `"module": "node16"`. This requires TypeScript 4.7 or greater.
|
|
2567
2795
|
If you use ESM, your settings should be fine.
|