node-red-contrib-tak-registration 0.11.0 → 0.11.4

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.
Files changed (250) hide show
  1. package/node_modules/@types/node/LICENSE +0 -0
  2. package/node_modules/@types/node/README.md +4 -5
  3. package/node_modules/@types/node/assert/strict.d.ts +4 -4
  4. package/node_modules/@types/node/assert.d.ts +50 -26
  5. package/node_modules/@types/node/async_hooks.d.ts +13 -6
  6. package/node_modules/@types/node/buffer.d.ts +46 -38
  7. package/node_modules/@types/node/child_process.d.ts +278 -138
  8. package/node_modules/@types/node/cluster.d.ts +107 -89
  9. package/node_modules/@types/node/console.d.ts +18 -15
  10. package/node_modules/@types/node/constants.d.ts +12 -11
  11. package/node_modules/@types/node/crypto.d.ts +746 -268
  12. package/node_modules/@types/node/dgram.d.ts +82 -46
  13. package/node_modules/@types/node/diagnostics_channel.d.ts +3 -3
  14. package/node_modules/@types/node/dns/promises.d.ts +37 -26
  15. package/node_modules/@types/node/dns.d.ts +204 -63
  16. package/node_modules/@types/node/dom-events.d.ts +67 -71
  17. package/node_modules/@types/node/domain.d.ts +4 -4
  18. package/node_modules/@types/node/events.d.ts +99 -8
  19. package/node_modules/@types/node/fs/promises.d.ts +122 -85
  20. package/node_modules/@types/node/fs.d.ts +520 -316
  21. package/node_modules/@types/node/globals.d.ts +346 -286
  22. package/node_modules/@types/node/globals.global.d.ts +0 -0
  23. package/node_modules/@types/node/http.d.ts +321 -189
  24. package/node_modules/@types/node/http2.d.ts +630 -377
  25. package/node_modules/@types/node/https.d.ts +221 -112
  26. package/node_modules/@types/node/index.d.ts +0 -45
  27. package/node_modules/@types/node/inspector.d.ts +0 -1
  28. package/node_modules/@types/node/module.d.ts +75 -31
  29. package/node_modules/@types/node/net.d.ts +149 -93
  30. package/node_modules/@types/node/os.d.ts +10 -9
  31. package/node_modules/@types/node/package.json +88 -90
  32. package/node_modules/@types/node/path.d.ts +13 -13
  33. package/node_modules/@types/node/perf_hooks.d.ts +19 -18
  34. package/node_modules/@types/node/process.d.ts +170 -126
  35. package/node_modules/@types/node/punycode.d.ts +4 -4
  36. package/node_modules/@types/node/querystring.d.ts +14 -4
  37. package/node_modules/@types/node/readline/promises.d.ts +12 -7
  38. package/node_modules/@types/node/readline.d.ts +69 -56
  39. package/node_modules/@types/node/repl.d.ts +67 -61
  40. package/node_modules/@types/node/stream/consumers.d.ts +10 -10
  41. package/node_modules/@types/node/stream/promises.d.ts +56 -15
  42. package/node_modules/@types/node/stream/web.d.ts +40 -20
  43. package/node_modules/@types/node/stream.d.ts +365 -232
  44. package/node_modules/@types/node/string_decoder.d.ts +8 -8
  45. package/node_modules/@types/node/test.d.ts +133 -212
  46. package/node_modules/@types/node/timers/promises.d.ts +4 -4
  47. package/node_modules/@types/node/timers.d.ts +26 -11
  48. package/node_modules/@types/node/tls.d.ts +152 -72
  49. package/node_modules/@types/node/trace_events.d.ts +3 -3
  50. package/node_modules/@types/node/ts4.8/assert/strict.d.ts +4 -4
  51. package/node_modules/@types/node/ts4.8/assert.d.ts +50 -26
  52. package/node_modules/@types/node/ts4.8/async_hooks.d.ts +13 -6
  53. package/node_modules/@types/node/ts4.8/buffer.d.ts +47 -39
  54. package/node_modules/@types/node/ts4.8/child_process.d.ts +278 -138
  55. package/node_modules/@types/node/ts4.8/cluster.d.ts +107 -89
  56. package/node_modules/@types/node/ts4.8/console.d.ts +18 -15
  57. package/node_modules/@types/node/ts4.8/constants.d.ts +12 -11
  58. package/node_modules/@types/node/ts4.8/crypto.d.ts +746 -268
  59. package/node_modules/@types/node/ts4.8/dgram.d.ts +82 -46
  60. package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +3 -3
  61. package/node_modules/@types/node/ts4.8/dns/promises.d.ts +37 -26
  62. package/node_modules/@types/node/ts4.8/dns.d.ts +204 -63
  63. package/node_modules/@types/node/ts4.8/dom-events.d.ts +67 -71
  64. package/node_modules/@types/node/ts4.8/domain.d.ts +4 -4
  65. package/node_modules/@types/node/ts4.8/events.d.ts +99 -8
  66. package/node_modules/@types/node/ts4.8/fs/promises.d.ts +122 -85
  67. package/node_modules/@types/node/ts4.8/fs.d.ts +520 -316
  68. package/node_modules/@types/node/ts4.8/globals.d.ts +346 -286
  69. package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -0
  70. package/node_modules/@types/node/ts4.8/http.d.ts +321 -189
  71. package/node_modules/@types/node/ts4.8/http2.d.ts +630 -377
  72. package/node_modules/@types/node/ts4.8/https.d.ts +221 -112
  73. package/node_modules/@types/node/ts4.8/index.d.ts +0 -0
  74. package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -1
  75. package/node_modules/@types/node/ts4.8/module.d.ts +75 -31
  76. package/node_modules/@types/node/ts4.8/net.d.ts +149 -93
  77. package/node_modules/@types/node/ts4.8/os.d.ts +10 -9
  78. package/node_modules/@types/node/ts4.8/path.d.ts +13 -13
  79. package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +19 -18
  80. package/node_modules/@types/node/ts4.8/process.d.ts +170 -126
  81. package/node_modules/@types/node/ts4.8/punycode.d.ts +4 -4
  82. package/node_modules/@types/node/ts4.8/querystring.d.ts +14 -4
  83. package/node_modules/@types/node/ts4.8/readline/promises.d.ts +12 -7
  84. package/node_modules/@types/node/ts4.8/readline.d.ts +69 -56
  85. package/node_modules/@types/node/ts4.8/repl.d.ts +67 -61
  86. package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +10 -10
  87. package/node_modules/@types/node/ts4.8/stream/promises.d.ts +56 -15
  88. package/node_modules/@types/node/ts4.8/stream/web.d.ts +40 -20
  89. package/node_modules/@types/node/ts4.8/stream.d.ts +494 -223
  90. package/node_modules/@types/node/ts4.8/string_decoder.d.ts +8 -8
  91. package/node_modules/@types/node/ts4.8/test.d.ts +135 -214
  92. package/node_modules/@types/node/ts4.8/timers/promises.d.ts +4 -4
  93. package/node_modules/@types/node/ts4.8/timers.d.ts +26 -11
  94. package/node_modules/@types/node/ts4.8/tls.d.ts +152 -72
  95. package/node_modules/@types/node/ts4.8/trace_events.d.ts +3 -3
  96. package/node_modules/@types/node/ts4.8/tty.d.ts +10 -10
  97. package/node_modules/@types/node/ts4.8/url.d.ts +26 -14
  98. package/node_modules/@types/node/ts4.8/util.d.ts +187 -120
  99. package/node_modules/@types/node/ts4.8/v8.d.ts +4 -4
  100. package/node_modules/@types/node/ts4.8/vm.d.ts +58 -50
  101. package/node_modules/@types/node/ts4.8/wasi.d.ts +10 -4
  102. package/node_modules/@types/node/ts4.8/worker_threads.d.ts +83 -86
  103. package/node_modules/@types/node/ts4.8/zlib.d.ts +9 -9
  104. package/node_modules/@types/node/tty.d.ts +10 -10
  105. package/node_modules/@types/node/url.d.ts +26 -14
  106. package/node_modules/@types/node/util.d.ts +187 -120
  107. package/node_modules/@types/node/v8.d.ts +4 -4
  108. package/node_modules/@types/node/vm.d.ts +58 -50
  109. package/node_modules/@types/node/wasi.d.ts +10 -4
  110. package/node_modules/@types/node/worker_threads.d.ts +83 -86
  111. package/node_modules/@types/node/zlib.d.ts +9 -9
  112. package/node_modules/axios/CHANGELOG.md +225 -0
  113. package/node_modules/axios/README.md +273 -9
  114. package/node_modules/axios/dist/axios.js +249 -178
  115. package/node_modules/axios/dist/axios.js.map +1 -1
  116. package/node_modules/axios/dist/axios.min.js +1 -1
  117. package/node_modules/axios/dist/axios.min.js.map +1 -1
  118. package/node_modules/axios/dist/browser/axios.cjs +213 -193
  119. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  120. package/node_modules/axios/dist/esm/axios.js +213 -193
  121. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  122. package/node_modules/axios/dist/esm/axios.min.js +1 -1
  123. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  124. package/node_modules/axios/dist/node/axios.cjs +297 -213
  125. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  126. package/node_modules/axios/index.d.cts +20 -11
  127. package/node_modules/axios/index.d.ts +21 -12
  128. package/node_modules/axios/lib/adapters/adapters.js +33 -15
  129. package/node_modules/axios/lib/adapters/http.js +25 -12
  130. package/node_modules/axios/lib/adapters/xhr.js +17 -10
  131. package/node_modules/axios/lib/core/mergeConfig.js +1 -0
  132. package/node_modules/axios/lib/defaults/index.js +1 -1
  133. package/node_modules/axios/lib/env/data.js +1 -1
  134. package/node_modules/axios/lib/helpers/cookies.js +39 -49
  135. package/node_modules/axios/lib/helpers/isURLSameOrigin.js +2 -2
  136. package/node_modules/axios/lib/platform/browser/index.js +0 -51
  137. package/node_modules/axios/lib/platform/common/utils.js +47 -0
  138. package/node_modules/axios/lib/platform/index.js +5 -1
  139. package/node_modules/axios/package.json +2 -1
  140. package/node_modules/call-bind/.eslintrc +0 -1
  141. package/node_modules/call-bind/.nycrc +0 -4
  142. package/node_modules/call-bind/CHANGELOG.md +35 -0
  143. package/node_modules/call-bind/README.md +63 -1
  144. package/node_modules/call-bind/index.js +10 -13
  145. package/node_modules/call-bind/package.json +33 -23
  146. package/node_modules/call-bind/test/callBound.js +0 -1
  147. package/node_modules/call-bind/test/index.js +18 -4
  148. package/node_modules/{function-bind → deep-equal}/.editorconfig +1 -1
  149. package/node_modules/deep-equal/.eslintrc +6 -0
  150. package/node_modules/deep-equal/.nycrc +17 -0
  151. package/node_modules/deep-equal/CHANGELOG.md +204 -4
  152. package/node_modules/deep-equal/assert.js +3 -0
  153. package/node_modules/deep-equal/package.json +39 -17
  154. package/node_modules/deep-equal/readme.markdown +28 -12
  155. package/node_modules/deep-equal/test/_tape.js +24 -3
  156. package/node_modules/deep-equal/test/cmp.js +1047 -48
  157. package/node_modules/define-data-property/CHANGELOG.md +10 -0
  158. package/node_modules/define-data-property/index.d.ts.map +1 -1
  159. package/node_modules/define-data-property/index.js +8 -0
  160. package/node_modules/define-data-property/package.json +11 -9
  161. package/node_modules/define-data-property/test/index.js +6 -11
  162. package/node_modules/define-data-property/tsconfig.json +1 -0
  163. package/node_modules/fast-xml-parser/CHANGELOG.md +11 -0
  164. package/node_modules/fast-xml-parser/package.json +5 -5
  165. package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +1 -0
  166. package/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js +4 -0
  167. package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +6 -3
  168. package/node_modules/follow-redirects/index.js +16 -4
  169. package/node_modules/follow-redirects/package.json +2 -3
  170. package/node_modules/function-bind/.eslintrc +11 -5
  171. package/node_modules/function-bind/.github/FUNDING.yml +12 -0
  172. package/node_modules/function-bind/.github/SECURITY.md +3 -0
  173. package/node_modules/function-bind/.nycrc +13 -0
  174. package/node_modules/function-bind/CHANGELOG.md +136 -0
  175. package/node_modules/function-bind/README.md +25 -27
  176. package/node_modules/function-bind/implementation.js +44 -12
  177. package/node_modules/function-bind/package.json +38 -14
  178. package/node_modules/get-intrinsic/CHANGELOG.md +8 -0
  179. package/node_modules/get-intrinsic/index.js +1 -1
  180. package/node_modules/get-intrinsic/package.json +11 -11
  181. package/node_modules/has-property-descriptors/CHANGELOG.md +11 -0
  182. package/node_modules/has-property-descriptors/package.json +13 -6
  183. package/node_modules/hasown/.eslintrc +5 -0
  184. package/node_modules/hasown/.github/FUNDING.yml +12 -0
  185. package/node_modules/hasown/.nycrc +13 -0
  186. package/node_modules/hasown/CHANGELOG.md +20 -0
  187. package/node_modules/hasown/LICENSE +21 -0
  188. package/node_modules/hasown/README.md +40 -0
  189. package/node_modules/hasown/index.d.ts +3 -0
  190. package/node_modules/hasown/index.d.ts.map +1 -0
  191. package/node_modules/hasown/index.js +8 -0
  192. package/node_modules/hasown/package.json +91 -0
  193. package/node_modules/hasown/tsconfig.json +49 -0
  194. package/node_modules/set-function-length/.eslintrc +27 -0
  195. package/node_modules/set-function-length/.github/FUNDING.yml +12 -0
  196. package/node_modules/set-function-length/.nycrc +13 -0
  197. package/node_modules/set-function-length/CHANGELOG.md +41 -0
  198. package/node_modules/set-function-length/LICENSE +21 -0
  199. package/node_modules/set-function-length/README.md +56 -0
  200. package/node_modules/set-function-length/env.js +19 -0
  201. package/node_modules/set-function-length/index.js +41 -0
  202. package/node_modules/set-function-length/package.json +84 -0
  203. package/node_modules/undici-types/README.md +6 -0
  204. package/node_modules/undici-types/agent.d.ts +31 -0
  205. package/node_modules/undici-types/api.d.ts +43 -0
  206. package/node_modules/undici-types/balanced-pool.d.ts +18 -0
  207. package/node_modules/undici-types/cache.d.ts +36 -0
  208. package/node_modules/undici-types/client.d.ts +97 -0
  209. package/node_modules/undici-types/connector.d.ts +34 -0
  210. package/node_modules/undici-types/content-type.d.ts +21 -0
  211. package/node_modules/undici-types/cookies.d.ts +28 -0
  212. package/node_modules/undici-types/diagnostics-channel.d.ts +67 -0
  213. package/node_modules/undici-types/dispatcher.d.ts +241 -0
  214. package/node_modules/undici-types/errors.d.ts +128 -0
  215. package/node_modules/undici-types/fetch.d.ts +209 -0
  216. package/node_modules/undici-types/file.d.ts +39 -0
  217. package/node_modules/undici-types/filereader.d.ts +54 -0
  218. package/node_modules/undici-types/formdata.d.ts +108 -0
  219. package/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  220. package/node_modules/undici-types/global-origin.d.ts +7 -0
  221. package/node_modules/undici-types/handlers.d.ts +9 -0
  222. package/node_modules/undici-types/header.d.ts +4 -0
  223. package/node_modules/undici-types/index.d.ts +63 -0
  224. package/node_modules/undici-types/interceptors.d.ts +5 -0
  225. package/node_modules/undici-types/mock-agent.d.ts +50 -0
  226. package/node_modules/undici-types/mock-client.d.ts +25 -0
  227. package/node_modules/undici-types/mock-errors.d.ts +12 -0
  228. package/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  229. package/node_modules/undici-types/mock-pool.d.ts +25 -0
  230. package/node_modules/undici-types/package.json +55 -0
  231. package/node_modules/undici-types/patch.d.ts +71 -0
  232. package/node_modules/undici-types/pool-stats.d.ts +19 -0
  233. package/node_modules/undici-types/pool.d.ts +28 -0
  234. package/node_modules/undici-types/proxy-agent.d.ts +30 -0
  235. package/node_modules/undici-types/readable.d.ts +61 -0
  236. package/node_modules/undici-types/webidl.d.ts +220 -0
  237. package/node_modules/undici-types/websocket.d.ts +131 -0
  238. package/package.json +3 -3
  239. package/tak-ingest.js +39 -24
  240. package/tak-registration.html +4 -4
  241. package/tak-registration.js +2 -3
  242. package/node_modules/define-data-property/tsinit +0 -109
  243. package/node_modules/function-bind/.jscs.json +0 -176
  244. package/node_modules/function-bind/.npmignore +0 -22
  245. package/node_modules/function-bind/.travis.yml +0 -168
  246. package/node_modules/has/LICENSE-MIT +0 -22
  247. package/node_modules/has/README.md +0 -18
  248. package/node_modules/has/package.json +0 -48
  249. package/node_modules/has/src/index.js +0 -5
  250. package/node_modules/has/test/index.js +0 -10
@@ -66,6 +66,7 @@
66
66
  - [HTML Form Posting](#-html-form-posting-browser)
67
67
  - [🆕 Progress capturing](#-progress-capturing)
68
68
  - [🆕 Rate limiting](#-progress-capturing)
69
+ - [🆕 AxiosHeaders](#-axiosheaders)
69
70
  - [Semver](#semver)
70
71
  - [Promises](#promises)
71
72
  - [TypeScript](#typescript)
@@ -167,7 +168,7 @@ Using unpkg CDN:
167
168
 
168
169
  ## Example
169
170
 
170
- > **Note** CommonJS usage
171
+ > **Note**: CommonJS usage
171
172
  > In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()`, use the following approach:
172
173
 
173
174
  ```js
@@ -384,12 +385,18 @@ These are the available config options for making requests. Only the `url` is re
384
385
  params: {
385
386
  ID: 12345
386
387
  },
387
-
388
- // `paramsSerializer` is an optional config in charge of serializing `params`
388
+
389
+ // `paramsSerializer` is an optional config that allows you to customize serializing `params`.
389
390
  paramsSerializer: {
390
- encode?: (param: string): string => { /* Do custom ops here and return transformed string */ }, // custom encoder function; sends Key/Values in an iterative fashion
391
- serialize?: (params: Record<string, any>, options?: ParamsSerializerOptions ), // mimic pre 1.x behavior and send entire params object to a custom serializer func. Allows consumer to control how params are serialized.
392
- indexes: false // array indexes format (null - no brackets, false (default) - empty brackets, true - brackets with indexes)
391
+
392
+ //Custom encoder function which sends key/value pairs in an iterative fashion.
393
+ encode?: (param: string): string => { /* Do custom operations here and return transformed string */ },
394
+
395
+ // Custom serializer function for the entire parameter. Allows user to mimic pre 1.x behaviour.
396
+ serialize?: (params: Record<string, any>, options?: ParamsSerializerOptions ),
397
+
398
+ //Configuration for formatting array indexes in the params.
399
+ indexes: false // Three available options: (1) indexes: null (leads to no brackets), (2) (default) indexes: false (leads to empty brackets), (3) indexes: true (leads to brackets with indexes).
393
400
  },
394
401
 
395
402
  // `data` is the data to be sent as the request body
@@ -445,6 +452,9 @@ These are the available config options for making requests. Only the `url` is re
445
452
 
446
453
  // `xsrfHeaderName` is the name of the http header that carries the xsrf token value
447
454
  xsrfHeaderName: 'X-XSRF-TOKEN', // default
455
+
456
+ // `undefined` (default) - set XSRF header only for the same origin requests
457
+ withXSRFToken: boolean | undefined | ((config: InternalAxiosRequestConfig) => boolean | undefined),
448
458
 
449
459
  // `onUploadProgress` allows handling of progress events for uploads
450
460
  // browser & node.js
@@ -536,7 +546,7 @@ These are the available config options for making requests. Only the `url` is re
536
546
  // automatically. If set to `true` will also remove the 'content-encoding' header
537
547
  // from the responses objects of all decompressed responses
538
548
  // - Node only (XHR cannot turn off decompression)
539
- decompress: true // default
549
+ decompress: true, // default
540
550
 
541
551
  // `insecureHTTPParser` boolean.
542
552
  // Indicates where to use an insecure HTTP parser that accepts invalid HTTP headers.
@@ -544,7 +554,7 @@ These are the available config options for making requests. Only the `url` is re
544
554
  // Using the insecure parser should be avoided.
545
555
  // see options https://nodejs.org/dist/latest-v12.x/docs/api/http.html#http_http_request_url_options_callback
546
556
  // see also https://nodejs.org/en/blog/vulnerability/february-2020-security-releases/#strict-http-header-parsing-none
547
- insecureHTTPParser: undefined // default
557
+ insecureHTTPParser: undefined, // default
548
558
 
549
559
  // transitional options for backward compatibility that may be removed in the newer versions
550
560
  transitional: {
@@ -1264,7 +1274,7 @@ const {data} = await axios.post(SERVER_URL, readableStream, {
1264
1274
  ````
1265
1275
 
1266
1276
  > **Note:**
1267
- > Capturing FormData upload progress is currently not currently supported in node.js environments.
1277
+ > Capturing FormData upload progress is not currently supported in node.js environments.
1268
1278
 
1269
1279
  > **⚠️ Warning**
1270
1280
  > It is recommended to disable redirects by setting maxRedirects: 0 to upload the stream in the **node.js** environment,
@@ -1285,6 +1295,260 @@ const {data} = await axios.post(LOCAL_SERVER_URL, myBuffer, {
1285
1295
  });
1286
1296
  ```
1287
1297
 
1298
+ ## 🆕 AxiosHeaders
1299
+
1300
+ Axios has its own `AxiosHeaders` class to manipulate headers using a Map-like API that guarantees caseless work.
1301
+ Although HTTP is case-insensitive in headers, Axios will retain the case of the original header for stylistic reasons
1302
+ and for a workaround when servers mistakenly consider the header's case.
1303
+ The old approach of directly manipulating headers object is still available, but deprecated and not recommended for future usage.
1304
+
1305
+ ### Working with headers
1306
+
1307
+ An AxiosHeaders object instance can contain different types of internal values. that control setting and merging logic.
1308
+ The final headers object with string values is obtained by Axios by calling the `toJSON` method.
1309
+
1310
+ > Note: By JSON here we mean an object consisting only of string values intended to be sent over the network.
1311
+
1312
+ The header value can be one of the following types:
1313
+ - `string` - normal string value that will be sent to the server
1314
+ - `null` - skip header when rendering to JSON
1315
+ - `false` - skip header when rendering to JSON, additionally indicates that `set` method must be called with `rewrite` option set to `true`
1316
+ to overwrite this value (Axios uses this internally to allow users to opt out of installing certain headers like `User-Agent` or `Content-Type`)
1317
+ - `undefined` - value is not set
1318
+
1319
+ > Note: The header value is considered set if it is not equal to undefined.
1320
+
1321
+ The headers object is always initialized inside interceptors and transformers:
1322
+
1323
+ ```ts
1324
+ axios.interceptors.request.use((request: InternalAxiosRequestConfig) => {
1325
+ request.headers.set('My-header', 'value');
1326
+
1327
+ request.headers.set({
1328
+ "My-set-header1": "my-set-value1",
1329
+ "My-set-header2": "my-set-value2"
1330
+ });
1331
+
1332
+ request.headers.set('User-Agent', false); // disable subsequent setting the header by Axios
1333
+
1334
+ request.headers.setContentType('text/plain');
1335
+
1336
+ request.headers['My-set-header2'] = 'newValue' // direct access is deprecated
1337
+
1338
+ return request;
1339
+ }
1340
+ );
1341
+ ````
1342
+
1343
+ You can iterate over an `AxiosHeaders` instance using a `for...of` statement:
1344
+
1345
+ ````js
1346
+ const headers = new AxiosHeaders({
1347
+ foo: '1',
1348
+ bar: '2',
1349
+ baz: '3'
1350
+ });
1351
+
1352
+ for(const [header, value] of headers) {
1353
+ console.log(header, value);
1354
+ }
1355
+
1356
+ // foo 1
1357
+ // bar 2
1358
+ // baz 3
1359
+ ````
1360
+
1361
+ ### new AxiosHeaders(headers?)
1362
+
1363
+ Constructs a new `AxiosHeaders` instance.
1364
+
1365
+ ```
1366
+ constructor(headers?: RawAxiosHeaders | AxiosHeaders | string);
1367
+ ```
1368
+
1369
+ If the headers object is a string, it will be parsed as RAW HTTP headers.
1370
+
1371
+ ````js
1372
+ const headers = new AxiosHeaders(`
1373
+ Host: www.bing.com
1374
+ User-Agent: curl/7.54.0
1375
+ Accept: */*`);
1376
+
1377
+ console.log(headers);
1378
+
1379
+ // Object [AxiosHeaders] {
1380
+ // host: 'www.bing.com',
1381
+ // 'user-agent': 'curl/7.54.0',
1382
+ // accept: '*/*'
1383
+ // }
1384
+ ````
1385
+
1386
+ ### AxiosHeaders#set
1387
+
1388
+ ```ts
1389
+ set(headerName, value: Axios, rewrite?: boolean);
1390
+ set(headerName, value, rewrite?: (this: AxiosHeaders, value: string, name: string, headers: RawAxiosHeaders) => boolean);
1391
+ set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean);
1392
+ ```
1393
+
1394
+ The `rewrite` argument controls the overwriting behavior:
1395
+ - `false` - do not overwrite if header's value is set (is not `undefined`)
1396
+ - `undefined` (default) - overwrite the header unless its value is set to `false`
1397
+ - `true` - rewrite anyway
1398
+
1399
+ The option can also accept a user-defined function that determines whether the value should be overwritten or not.
1400
+
1401
+ Returns `this`.
1402
+
1403
+ ### AxiosHeaders#get(header)
1404
+
1405
+ ```
1406
+ get(headerName: string, matcher?: true | AxiosHeaderMatcher): AxiosHeaderValue;
1407
+ get(headerName: string, parser: RegExp): RegExpExecArray | null;
1408
+ ````
1409
+
1410
+ Returns the internal value of the header. It can take an extra argument to parse the header's value with `RegExp.exec`,
1411
+ matcher function or internal key-value parser.
1412
+
1413
+ ```ts
1414
+ const headers = new AxiosHeaders({
1415
+ 'Content-Type': 'multipart/form-data; boundary=Asrf456BGe4h'
1416
+ });
1417
+
1418
+ console.log(headers.get('Content-Type'));
1419
+ // multipart/form-data; boundary=Asrf456BGe4h
1420
+
1421
+ console.log(headers.get('Content-Type', true)); // parse key-value pairs from a string separated with \s,;= delimiters:
1422
+ // [Object: null prototype] {
1423
+ // 'multipart/form-data': undefined,
1424
+ // boundary: 'Asrf456BGe4h'
1425
+ // }
1426
+
1427
+
1428
+ console.log(headers.get('Content-Type', (value, name, headers) => {
1429
+ return String(value).replace(/a/g, 'ZZZ');
1430
+ }));
1431
+ // multipZZZrt/form-dZZZtZZZ; boundZZZry=Asrf456BGe4h
1432
+
1433
+ console.log(headers.get('Content-Type', /boundary=(\w+)/)?.[0]);
1434
+ // boundary=Asrf456BGe4h
1435
+
1436
+ ```
1437
+
1438
+ Returns the value of the header.
1439
+
1440
+ ### AxiosHeaders#has(header, matcher?)
1441
+
1442
+ ```
1443
+ has(header: string, matcher?: AxiosHeaderMatcher): boolean;
1444
+ ```
1445
+
1446
+ Returns `true` if the header is set (has no `undefined` value).
1447
+
1448
+ ### AxiosHeaders#delete(header, matcher?)
1449
+
1450
+ ```
1451
+ delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean;
1452
+ ```
1453
+
1454
+ Returns `true` if at least one header has been removed.
1455
+
1456
+ ### AxiosHeaders#clear(matcher?)
1457
+
1458
+ ```
1459
+ clear(matcher?: AxiosHeaderMatcher): boolean;
1460
+ ```
1461
+
1462
+ Removes all headers.
1463
+ Unlike the `delete` method matcher, this optional matcher will be used to match against the header name rather than the value.
1464
+
1465
+ ```ts
1466
+ const headers = new AxiosHeaders({
1467
+ 'foo': '1',
1468
+ 'x-foo': '2',
1469
+ 'x-bar': '3',
1470
+ });
1471
+
1472
+ console.log(headers.clear(/^x-/)); // true
1473
+
1474
+ console.log(headers.toJSON()); // [Object: null prototype] { foo: '1' }
1475
+ ```
1476
+
1477
+ Returns `true` if at least one header has been cleared.
1478
+
1479
+ ### AxiosHeaders#normalize(format);
1480
+
1481
+ If the headers object was changed directly, it can have duplicates with the same name but in different cases.
1482
+ This method normalizes the headers object by combining duplicate keys into one.
1483
+ Axios uses this method internally after calling each interceptor.
1484
+ Set `format` to true for converting headers name to lowercase and capitalize the initial letters (`cOntEnt-type` => `Content-Type`)
1485
+
1486
+ ```js
1487
+ const headers = new AxiosHeaders({
1488
+ 'foo': '1',
1489
+ });
1490
+
1491
+ headers.Foo = '2';
1492
+ headers.FOO = '3';
1493
+
1494
+ console.log(headers.toJSON()); // [Object: null prototype] { foo: '1', Foo: '2', FOO: '3' }
1495
+ console.log(headers.normalize().toJSON()); // [Object: null prototype] { foo: '3' }
1496
+ console.log(headers.normalize(true).toJSON()); // [Object: null prototype] { Foo: '3' }
1497
+ ```
1498
+
1499
+ Returns `this`.
1500
+
1501
+ ### AxiosHeaders#concat(...targets)
1502
+
1503
+ ```
1504
+ concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
1505
+ ```
1506
+
1507
+ Merges the instance with targets into a new `AxiosHeaders` instance. If the target is a string, it will be parsed as RAW HTTP headers.
1508
+
1509
+ Returns a new `AxiosHeaders` instance.
1510
+
1511
+ ### AxiosHeaders#toJSON(asStrings?)
1512
+
1513
+ ````
1514
+ toJSON(asStrings?: boolean): RawAxiosHeaders;
1515
+ ````
1516
+
1517
+ Resolve all internal headers values into a new null prototype object.
1518
+ Set `asStrings` to true to resolve arrays as a string containing all elements, separated by commas.
1519
+
1520
+ ### AxiosHeaders.from(thing?)
1521
+
1522
+ ````
1523
+ from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders;
1524
+ ````
1525
+
1526
+ Returns a new `AxiosHeaders` instance created from the raw headers passed in,
1527
+ or simply returns the given headers object if it's an `AxiosHeaders` instance.
1528
+
1529
+ ### AxiosHeaders.concat(...targets)
1530
+
1531
+ ````
1532
+ concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
1533
+ ````
1534
+
1535
+ Returns a new `AxiosHeaders` instance created by merging the target objects.
1536
+
1537
+ ### Shortcuts
1538
+
1539
+ The following shortcuts are available:
1540
+
1541
+ - `setContentType`, `getContentType`, `hasContentType`
1542
+
1543
+ - `setContentLength`, `getContentLength`, `hasContentLength`
1544
+
1545
+ - `setAccept`, `getAccept`, `hasAccept`
1546
+
1547
+ - `setUserAgent`, `getUserAgent`, `hasUserAgent`
1548
+
1549
+ - `setContentEncoding`, `getContentEncoding`, `hasContentEncoding`
1550
+
1551
+
1288
1552
  ## Semver
1289
1553
 
1290
1554
  Until axios reaches a `1.0` release, breaking changes will be released with a new minor version. For example `0.5.1`, and `0.5.4` will have the same API, but `0.6.0` will have breaking changes.