@jjrawlins/cdk-iam-policy-builder-helper 0.0.67 → 0.0.68
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/.jsii +3 -3
- package/cdk-iam-policy-builder-helper/jsii/jsii.go +2 -2
- package/cdk-iam-policy-builder-helper/version +1 -1
- package/lib/constructs/Actions.d.ts +1 -0
- package/lib/constructs/Actions.js +2 -1
- package/methods_list.txt +1 -0
- package/node_modules/@aws-sdk/client-iam/dist-cjs/index.js +7 -0
- package/node_modules/@aws-sdk/client-iam/dist-es/models/models_0.js +7 -0
- package/node_modules/@aws-sdk/client-iam/dist-types/models/models_0.d.ts +7 -0
- package/node_modules/@aws-sdk/client-iam/dist-types/ts3.4/models/models_0.d.ts +7 -0
- package/node_modules/@aws-sdk/client-iam/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-node/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromTokenFile.d.ts +1 -2
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/ts3.4/fromTokenFile.d.ts +4 -2
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +1 -1
- package/node_modules/axios/CHANGELOG.md +402 -368
- package/node_modules/axios/README.md +80 -49
- package/node_modules/axios/dist/axios.js +121 -46
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +2 -2
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +126 -57
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +126 -57
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- 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 +347 -98
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +4 -0
- package/node_modules/axios/index.d.ts +4 -0
- package/node_modules/axios/lib/adapters/adapters.js +85 -40
- package/node_modules/axios/lib/adapters/fetch.js +1 -1
- package/node_modules/axios/lib/adapters/http.js +221 -43
- package/node_modules/axios/lib/core/InterceptorManager.js +1 -1
- package/node_modules/axios/lib/core/mergeConfig.js +4 -4
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/HttpStatusCode.js +6 -0
- package/node_modules/axios/lib/helpers/bind.js +7 -0
- package/node_modules/axios/lib/helpers/cookies.js +24 -13
- package/node_modules/axios/package.json +9 -4
- package/package.json +2 -2
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
<h3 align="center"> 🥇 Gold sponsors <br> </h3> <table align="center" width="100%"><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://
|
|
3
|
-
</td><td align="center" width="33.333333333333336%"> <a href="https://stytch.com/?utm_source=oss-sponsorship&utm_medium=paid_sponsorship&utm_content=website-link&utm_campaign=axios-http" style="padding: 10px; display: inline-block" target="_blank"> <picture> <source width="200px" height="38px" media="(prefers-color-scheme: dark)" srcset="https://axios-http.com/assets/sponsors/stytch_white.png"> <img width="200px" height="38px" src="https://axios-http.com/assets/sponsors/stytch.png" alt="Stytch"/> </picture> </a> <p align="center" title="API-first authentication, authorization, and fraud prevention">API-first authentication, authorization, and fraud prevention</p> <p align="center"> <a href="https://stytch.com/?utm_source=oss-sponsorship&utm_medium=paid_sponsorship&utm_content=website-link&utm_campaign=axios-http" target="_blank"><b>Website</b></a> | <a href="https://stytch.com/docs?utm_source=oss-sponsorship&utm_medium=paid_sponsorship&utm_content=docs-link&utm_campaign=axios-http" target="_blank"><b>Documentation</b></a> | <a href="https://github.com/stytchauth/stytch-node?utm_source=oss-sponsorship&utm_medium=paid_sponsorship&utm_content=node-sdk&utm_campaign=axios-http" target="_blank"><b>Node.js</b></a> </p>
|
|
2
|
+
<h3 align="center"> 🥇 Gold sponsors <br> </h3> <table align="center" width="100%"><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://stytch.com/?utm_source=oss-sponsorship&utm_medium=paid_sponsorship&utm_content=website-link&utm_campaign=axios-http" style="padding: 10px; display: inline-block" target="_blank"> <picture> <source width="200px" height="38px" media="(prefers-color-scheme: dark)" srcset="https://axios-http.com/assets/sponsors/stytch_white.png"> <img width="200px" height="38px" src="https://axios-http.com/assets/sponsors/stytch.png" alt="Stytch"/> </picture> </a> <p align="center" title="API-first authentication, authorization, and fraud prevention">API-first authentication, authorization, and fraud prevention</p> <p align="center"> <a href="https://stytch.com/?utm_source=oss-sponsorship&utm_medium=paid_sponsorship&utm_content=website-link&utm_campaign=axios-http" target="_blank"><b>Website</b></a> | <a href="https://stytch.com/docs?utm_source=oss-sponsorship&utm_medium=paid_sponsorship&utm_content=docs-link&utm_campaign=axios-http" target="_blank"><b>Documentation</b></a> | <a href="https://github.com/stytchauth/stytch-node?utm_source=oss-sponsorship&utm_medium=paid_sponsorship&utm_content=node-sdk&utm_campaign=axios-http" target="_blank"><b>Node.js</b></a> </p>
|
|
4
3
|
</td><td align="center" width="33.333333333333336%"> <a href="https://www.principal.com/about-us?utm_source=axios&utm_medium=sponsorlist&utm_campaign=sponsorship" style="padding: 10px; display: inline-block" target="_blank"> <img width="133px" height="43px" src="https://axios-http.com/assets/sponsors/principal.svg" alt="Principal Financial Group"/> </a> <p align="center" title="We’re bound by one common purpose: to give you the financial tools, resources and information you need to live your best life.">We’re bound by one common purpose: to give you the financial tools, resources and information you ne...</p> <p align="center"> <a href="https://www.principal.com/about-us?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship" target="_blank"><b>www.principal.com</b></a> </p>
|
|
5
|
-
</td
|
|
6
|
-
</td><td align="center" width="33.333333333333336%"> <a href="https://www.descope.com/?utm_source=axios&utm_medium=referral&utm_campaign=axios-oss-sponsorship" style="padding: 10px; display: inline-block" target="_blank"> <picture> <source width="200px" height="52px" media="(prefers-color-scheme: dark)" srcset="https://axios-http.com/assets/sponsors/descope_white.png"> <img width="200px" height="52px" src="https://axios-http.com/assets/sponsors/descope.png" alt="Descope"/> </picture> </a> <p align="center" title="Hi, we're Descope! We are building something in the authentication space for app developers and can’t wait to place it in your hands.">Hi, we're Descope! We are building something in the authentication space for app developers and...</p> <p align="center"> <a href="https://www.descope.com/?utm_source=axios&utm_medium=referral&utm_campaign=axios-oss-sponsorship" target="_blank"><b>Website</b></a> | <a href="https://docs.descope.com/?utm_source=axios&utm_medium=referral&utm_campaign=axios-oss-sponsorship" target="_blank"><b>Docs</b></a> | <a href="https://www.descope.com/community?utm_source=axios&utm_medium=referral&utm_campaign=axios-oss-sponsorship" target="_blank"><b>Community</b></a> </p>
|
|
4
|
+
</td><td align="center" width="33.333333333333336%"> <a href="https://twicsy.com/buy-instagram-followers?utm_source=axios&utm_medium=sponsorlist&utm_campaign=sponsorship" style="padding: 10px; display: inline-block" target="_blank"> <img width="85px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/dfa9670ad5e66eea17315332453c7f4e3a3b5905.png" alt="Buy Instagram Followers Twicsy"/> </a> <p align="center" title="Buy real Instagram followers from Twicsy starting at only $2.97. Twicsy has been voted the best site to buy followers from the likes of US Magazine.">Buy real Instagram followers from Twicsy starting at only $2.97. Twicsy has been voted the best site...</p> <p align="center"> <a href="https://twicsy.com/buy-instagram-followers?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship" target="_blank"><b>twicsy.com</b></a> </p>
|
|
5
|
+
</td></tr><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://www.descope.com/?utm_source=axios&utm_medium=referral&utm_campaign=axios-oss-sponsorship" style="padding: 10px; display: inline-block" target="_blank"> <picture> <source width="200px" height="52px" media="(prefers-color-scheme: dark)" srcset="https://axios-http.com/assets/sponsors/descope_white.png"> <img width="200px" height="52px" src="https://axios-http.com/assets/sponsors/descope.png" alt="Descope"/> </picture> </a> <p align="center" title="Hi, we're Descope! We are building something in the authentication space for app developers and can’t wait to place it in your hands.">Hi, we're Descope! We are building something in the authentication space for app developers and...</p> <p align="center"> <a href="https://www.descope.com/?utm_source=axios&utm_medium=referral&utm_campaign=axios-oss-sponsorship" target="_blank"><b>Website</b></a> | <a href="https://docs.descope.com/?utm_source=axios&utm_medium=referral&utm_campaign=axios-oss-sponsorship" target="_blank"><b>Docs</b></a> | <a href="https://www.descope.com/community?utm_source=axios&utm_medium=referral&utm_campaign=axios-oss-sponsorship" target="_blank"><b>Community</b></a> </p>
|
|
7
6
|
</td><td align="center" width="33.333333333333336%"> <a href="https://route4me.com/?utm_source=axios&utm_medium=sponsorlist&utm_campaign=sponsorship" style="padding: 10px; display: inline-block" target="_blank"> <picture> <source width="200px" height="51px" media="(prefers-color-scheme: dark)" srcset="https://axios-http.com/assets/sponsors/route4me_white.png"> <img width="200px" height="51px" src="https://axios-http.com/assets/sponsors/route4me.png" alt="Route4Me"/> </picture> </a> <p align="center" title="Best Route Planning And Route Optimization Software">Best Route Planning And Route Optimization Software</p> <p align="center"> <a href="https://route4me.com/platform/route-optimization-software?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship" target="_blank"><b>Explore</b></a> | <a href="https://route4me.com/platform/marketplace/pricing?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship" target="_blank"><b>Free Trial</b></a> | <a href="https://route4me.com/contact?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship" target="_blank"><b>Contact</b></a> </p>
|
|
8
|
-
</td
|
|
9
|
-
</td><td align="center" width="33.333333333333336%"> <a href="https://www.famety.net/?utm_source=axios&utm_medium=sponsorlist&utm_campaign=sponsorship" style="padding: 10px; display: inline-block" target="_blank"> <img width="70px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/56645c65d4bad0ab84265e02430d19d64afde927.png" alt="Famety - Buy Instagram Followers"/> </a> <p align="center" title="At Famety, you can grow your social media following quickly, safely, and easily with just a few clicks. Rated the world’s #1 social media service since 2013.">At Famety, you can grow your social media following quickly, safely, and easily with just a few clic...</p> <p align="center"> <a href="https://www.famety.net/?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship" target="_blank"><b>www.famety.net</b></a> </p>
|
|
7
|
+
</td><td align="center" width="33.333333333333336%"> <a href="https://buzzoid.com/buy-instagram-followers/?utm_source=axios&utm_medium=sponsorlist&utm_campaign=sponsorship" style="padding: 10px; display: inline-block" target="_blank"> <img width="62px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/e1625cb54e10ee40180c99d1495a462e9d6664a4.png" alt="Buzzoid - Buy Instagram Followers"/> </a> <p align="center" title="At Buzzoid, you can buy Instagram followers quickly, safely, and easily with just a few clicks. Rated world's #1 IG service since 2012.">At Buzzoid, you can buy Instagram followers quickly, safely, and easily with just a few clicks. Rate...</p> <p align="center"> <a href="https://buzzoid.com/buy-instagram-followers/?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship" target="_blank"><b>buzzoid.com</b></a> </p>
|
|
8
|
+
</td></tr><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://www.famety.net/?utm_source=axios&utm_medium=sponsorlist&utm_campaign=sponsorship" style="padding: 10px; display: inline-block" target="_blank"> <img width="70px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/56645c65d4bad0ab84265e02430d19d64afde927.png" alt="Famety - Buy Instagram Followers"/> </a> <p align="center" title="At Famety, you can grow your social media following quickly, safely, and easily with just a few clicks. Rated the world’s #1 social media service since 2013.">At Famety, you can grow your social media following quickly, safely, and easily with just a few clic...</p> <p align="center"> <a href="https://www.famety.net/?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship" target="_blank"><b>www.famety.net</b></a> </p>
|
|
10
9
|
</td><td align="center" width="33.333333333333336%"> <a href="https://poprey.com/?utm_source=axios&utm_medium=sponsorlist&utm_campaign=sponsorship" style="padding: 10px; display: inline-block" target="_blank"> <img width="70px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/e699ec99f7df3a203ddbc49d3c7712a907e628ea.png" alt="Poprey - Buy Instagram Likes"/> </a> <p align="center" title="Buy Instagram Likes">Buy Instagram Likes</p> <p align="center"> <a href="https://poprey.com/?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship" target="_blank"><b>poprey.com</b></a> </p>
|
|
11
|
-
</td
|
|
10
|
+
</td><td align="center" width="33.333333333333336%"> <a href="https://requestly.com/?utm_source=axios&utm_medium=sponsorlist&utm_campaign=sponsorship" style="padding: 10px; display: inline-block" target="_blank"> <img width="71px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/16450b4dc0deb9dab5a511bf2bc8b8b4ac33412f.png" alt="Requestly"/> </a> <p align="center" title="A lightweight open-source API Development, Testing & Mocking platform">A lightweight open-source API Development, Testing & Mocking platform</p> <p align="center"> <a href="https://requestly.com/?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship" target="_blank"><b>requestly.com</b></a> </p>
|
|
11
|
+
</td></tr><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://opencollective.com/axios/contribute" target="_blank" >💜 Become a sponsor</a>
|
|
12
12
|
</td><td align="center" width="33.333333333333336%"> <a href="https://opencollective.com/axios/contribute" target="_blank" >💜 Become a sponsor</a>
|
|
13
13
|
</td><td align="center" width="33.333333333333336%"> <a href="https://opencollective.com/axios/contribute" target="_blank" >💜 Become a sponsor</a>
|
|
14
14
|
</td></tr></table>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<!--<div>marker</div>-->
|
|
17
17
|
<br><br>
|
|
18
18
|
<div align="center">
|
|
19
|
-
<a href="https://axios-http.com"><img src="https://axios-http.com/assets/logo.svg" /></a><br>
|
|
19
|
+
<a href="https://axios-http.com"><img src="https://axios-http.com/assets/logo.svg" alt="Axios" /></a><br>
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
22
|
<p align="center">Promise based HTTP client for the browser and node.js</p>
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
[](https://gitter.im/mzabriskie/axios)
|
|
40
40
|
[](https://www.codetriage.com/axios/axios)
|
|
41
41
|
[](https://snyk.io/test/npm/axios)
|
|
42
|
+
[](CONTRIBUTORS.md)
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
|
|
@@ -80,12 +81,13 @@
|
|
|
80
81
|
- [Files Posting](#files-posting)
|
|
81
82
|
- [HTML Form Posting](#-html-form-posting-browser)
|
|
82
83
|
- [🆕 Progress capturing](#-progress-capturing)
|
|
83
|
-
- [🆕 Rate limiting](#-
|
|
84
|
+
- [🆕 Rate limiting](#-rate-limiting)
|
|
84
85
|
- [🆕 AxiosHeaders](#-axiosheaders)
|
|
85
86
|
- [🔥 Fetch adapter](#-fetch-adapter)
|
|
86
87
|
- [🔥 Custom fetch](#-custom-fetch)
|
|
87
88
|
- [🔥 Using with Tauri](#-using-with-tauri)
|
|
88
89
|
- [🔥 Using with SvelteKit](#-using-with-sveltekit-)
|
|
90
|
+
- [🔥 HTTP2](#-http2)
|
|
89
91
|
- [Semver](#semver)
|
|
90
92
|
- [Promises](#promises)
|
|
91
93
|
- [TypeScript](#typescript)
|
|
@@ -95,21 +97,22 @@
|
|
|
95
97
|
|
|
96
98
|
## Features
|
|
97
99
|
|
|
98
|
-
- Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser
|
|
99
|
-
- Make [http](https://nodejs.org/api/http.html) requests from
|
|
100
|
-
-
|
|
101
|
-
- Intercept
|
|
102
|
-
- Transform request and response data
|
|
103
|
-
- Cancel requests
|
|
104
|
-
- Automatic
|
|
105
|
-
- 🆕
|
|
106
|
-
- Client
|
|
100
|
+
- **Browser Requests:** Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) directly from the browser.
|
|
101
|
+
- **Node.js Requests:** Make [http](https://nodejs.org/api/http.html) requests from Node.js environments.
|
|
102
|
+
- **Promise-based:** Fully supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API for easier asynchronous code.
|
|
103
|
+
- **Interceptors:** Intercept requests and responses to add custom logic or transform data.
|
|
104
|
+
- **Data Transformation:** Transform request and response data automatically.
|
|
105
|
+
- **Request Cancellation:** Cancel requests using built-in mechanisms.
|
|
106
|
+
- **Automatic JSON Handling:** Automatically serializes and parses [JSON](https://www.json.org/json-en.html) data.
|
|
107
|
+
- **Form Serialization:** 🆕 Automatically serializes data objects to `multipart/form-data` or `x-www-form-urlencoded` formats.
|
|
108
|
+
- **XSRF Protection:** Client-side support to protect against [Cross-Site Request Forgery](https://en.wikipedia.org/wiki/Cross-site_request_forgery).
|
|
107
109
|
|
|
108
110
|
## Browser Support
|
|
109
111
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
| Chrome | Firefox | Safari | Opera | Edge |
|
|
113
|
+
|:------:|:-------:|:------:|:-----:|:----:|
|
|
114
|
+
|  |  |  |  |  |
|
|
115
|
+
| Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ |
|
|
113
116
|
|
|
114
117
|
[](https://saucelabs.com/u/axios)
|
|
115
118
|
|
|
@@ -199,7 +202,7 @@ Using unpkg CDN:
|
|
|
199
202
|
|
|
200
203
|
## Example
|
|
201
204
|
|
|
202
|
-
> **Note**: CommonJS usage
|
|
205
|
+
> **Note**: CommonJS usage
|
|
203
206
|
> In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()`, use the following approach:
|
|
204
207
|
|
|
205
208
|
```js
|
|
@@ -421,18 +424,18 @@ These are the available config options for making requests. Only the `url` is re
|
|
|
421
424
|
params: {
|
|
422
425
|
ID: 12345
|
|
423
426
|
},
|
|
424
|
-
|
|
425
|
-
// `paramsSerializer` is an optional config that allows you to customize serializing `params`.
|
|
427
|
+
|
|
428
|
+
// `paramsSerializer` is an optional config that allows you to customize serializing `params`.
|
|
426
429
|
paramsSerializer: {
|
|
427
430
|
|
|
428
431
|
// Custom encoder function which sends key/value pairs in an iterative fashion.
|
|
429
|
-
encode?: (param: string): string => { /* Do custom operations here and return transformed string */ },
|
|
430
|
-
|
|
432
|
+
encode?: (param: string): string => { /* Do custom operations here and return transformed string */ },
|
|
433
|
+
|
|
431
434
|
// Custom serializer function for the entire parameter. Allows user to mimic pre 1.x behaviour.
|
|
432
|
-
serialize?: (params: Record<string, any>, options?: ParamsSerializerOptions ),
|
|
433
|
-
|
|
434
|
-
// Configuration for formatting array indexes in the params.
|
|
435
|
-
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).
|
|
435
|
+
serialize?: (params: Record<string, any>, options?: ParamsSerializerOptions ),
|
|
436
|
+
|
|
437
|
+
// Configuration for formatting array indexes in the params.
|
|
438
|
+
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).
|
|
436
439
|
},
|
|
437
440
|
|
|
438
441
|
// `data` is the data to be sent as the request body
|
|
@@ -494,7 +497,7 @@ These are the available config options for making requests. Only the `url` is re
|
|
|
494
497
|
|
|
495
498
|
// `xsrfHeaderName` is the name of the http header that carries the xsrf token value
|
|
496
499
|
xsrfHeaderName: 'X-XSRF-TOKEN', // default
|
|
497
|
-
|
|
500
|
+
|
|
498
501
|
// `undefined` (default) - set XSRF header only for the same origin requests
|
|
499
502
|
withXSRFToken: boolean | undefined | ((config: InternalAxiosRequestConfig) => boolean | undefined),
|
|
500
503
|
|
|
@@ -544,7 +547,7 @@ These are the available config options for making requests. Only the `url` is re
|
|
|
544
547
|
// Only either `socketPath` or `proxy` can be specified.
|
|
545
548
|
// If both are specified, `socketPath` is used.
|
|
546
549
|
socketPath: null, // default
|
|
547
|
-
|
|
550
|
+
|
|
548
551
|
// `transport` determines the transport method that will be used to make the request.
|
|
549
552
|
// If defined, it will be used. Otherwise, if `maxRedirects` is 0,
|
|
550
553
|
// the default `http` or `https` library will be used, depending on the protocol specified in `protocol`.
|
|
@@ -837,10 +840,10 @@ The general structure of axios errors is as follows:
|
|
|
837
840
|
| -------- | ---------- |
|
|
838
841
|
| message | A quick summary of the error message and the status it failed with. |
|
|
839
842
|
| name | This defines where the error originated from. For axios, it will always be an 'AxiosError'. |
|
|
840
|
-
| stack | Provides the stack trace of the error. |
|
|
843
|
+
| stack | Provides the stack trace of the error. |
|
|
841
844
|
| config | An axios config object with specific instance configurations defined by the user from when the request was made |
|
|
842
845
|
| code | Represents an axios identified error. The table below lists out specific definitions for internal axios error. |
|
|
843
|
-
| status | HTTP response status code. See [here](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) for common HTTP response status code meanings.
|
|
846
|
+
| status | HTTP response status code. See [here](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) for common HTTP response status code meanings.
|
|
844
847
|
|
|
845
848
|
Below is a list of potential axios identified error:
|
|
846
849
|
|
|
@@ -1285,7 +1288,7 @@ Sending `Blobs`/`Files` as JSON (`base64`) is not currently supported.
|
|
|
1285
1288
|
Axios supports both browser and node environments to capture request upload/download progress.
|
|
1286
1289
|
The frequency of progress events is forced to be limited to `3` times per second.
|
|
1287
1290
|
|
|
1288
|
-
```js
|
|
1291
|
+
```js
|
|
1289
1292
|
await axios.post(url, data, {
|
|
1290
1293
|
onUploadProgress: function (axiosProgressEvent) {
|
|
1291
1294
|
/*{
|
|
@@ -1304,13 +1307,13 @@ await axios.post(url, data, {
|
|
|
1304
1307
|
loaded: number;
|
|
1305
1308
|
total?: number;
|
|
1306
1309
|
progress?: number;
|
|
1307
|
-
bytes: number;
|
|
1310
|
+
bytes: number;
|
|
1308
1311
|
estimated?: number;
|
|
1309
1312
|
rate?: number; // download speed in bytes
|
|
1310
1313
|
download: true; // download sign
|
|
1311
1314
|
}*/
|
|
1312
1315
|
}
|
|
1313
|
-
});
|
|
1316
|
+
});
|
|
1314
1317
|
```
|
|
1315
1318
|
|
|
1316
1319
|
You can also track stream upload/download progress in node.js:
|
|
@@ -1320,7 +1323,7 @@ const {data} = await axios.post(SERVER_URL, readableStream, {
|
|
|
1320
1323
|
onUploadProgress: ({progress}) => {
|
|
1321
1324
|
console.log((progress * 100).toFixed(2));
|
|
1322
1325
|
},
|
|
1323
|
-
|
|
1326
|
+
|
|
1324
1327
|
headers: {
|
|
1325
1328
|
'Content-Length': contentLength
|
|
1326
1329
|
},
|
|
@@ -1346,7 +1349,7 @@ const {data} = await axios.post(LOCAL_SERVER_URL, myBuffer, {
|
|
|
1346
1349
|
onUploadProgress: ({progress, rate}) => {
|
|
1347
1350
|
console.log(`Upload [${(progress*100).toFixed(2)}%]: ${(rate / 1024).toFixed(2)}KB/s`)
|
|
1348
1351
|
},
|
|
1349
|
-
|
|
1352
|
+
|
|
1350
1353
|
maxRate: [100 * 1024], // 100KB/s limit
|
|
1351
1354
|
});
|
|
1352
1355
|
```
|
|
@@ -1384,13 +1387,13 @@ The headers object is always initialized inside interceptors and transformers:
|
|
|
1384
1387
|
"My-set-header1": "my-set-value1",
|
|
1385
1388
|
"My-set-header2": "my-set-value2"
|
|
1386
1389
|
});
|
|
1387
|
-
|
|
1390
|
+
|
|
1388
1391
|
request.headers.set('User-Agent', false); // disable subsequent setting the header by Axios
|
|
1389
1392
|
|
|
1390
1393
|
request.headers.setContentType('text/plain');
|
|
1391
|
-
|
|
1394
|
+
|
|
1392
1395
|
request.headers['My-set-header2'] = 'newValue' // direct access is deprecated
|
|
1393
|
-
|
|
1396
|
+
|
|
1394
1397
|
return request;
|
|
1395
1398
|
}
|
|
1396
1399
|
);
|
|
@@ -1416,7 +1419,7 @@ for(const [header, value] of headers) {
|
|
|
1416
1419
|
|
|
1417
1420
|
### new AxiosHeaders(headers?)
|
|
1418
1421
|
|
|
1419
|
-
Constructs a new `AxiosHeaders` instance.
|
|
1422
|
+
Constructs a new `AxiosHeaders` instance.
|
|
1420
1423
|
|
|
1421
1424
|
```
|
|
1422
1425
|
constructor(headers?: RawAxiosHeaders | AxiosHeaders | string);
|
|
@@ -1471,7 +1474,7 @@ const headers = new AxiosHeaders({
|
|
|
1471
1474
|
'Content-Type': 'multipart/form-data; boundary=Asrf456BGe4h'
|
|
1472
1475
|
});
|
|
1473
1476
|
|
|
1474
|
-
console.log(headers.get('Content-Type'));
|
|
1477
|
+
console.log(headers.get('Content-Type'));
|
|
1475
1478
|
// multipart/form-data; boundary=Asrf456BGe4h
|
|
1476
1479
|
|
|
1477
1480
|
console.log(headers.get('Content-Type', true)); // parse key-value pairs from a string separated with \s,;= delimiters:
|
|
@@ -1515,7 +1518,7 @@ Returns `true` if at least one header has been removed.
|
|
|
1515
1518
|
clear(matcher?: AxiosHeaderMatcher): boolean;
|
|
1516
1519
|
```
|
|
1517
1520
|
|
|
1518
|
-
Removes all headers.
|
|
1521
|
+
Removes all headers.
|
|
1519
1522
|
Unlike the `delete` method matcher, this optional matcher will be used to match against the header name rather than the value.
|
|
1520
1523
|
|
|
1521
1524
|
```ts
|
|
@@ -1570,7 +1573,7 @@ Returns a new `AxiosHeaders` instance.
|
|
|
1570
1573
|
toJSON(asStrings?: boolean): RawAxiosHeaders;
|
|
1571
1574
|
````
|
|
1572
1575
|
|
|
1573
|
-
Resolve all internal headers values into a new null prototype object.
|
|
1576
|
+
Resolve all internal headers values into a new null prototype object.
|
|
1574
1577
|
Set `asStrings` to true to resolve arrays as a string containing all elements, separated by commas.
|
|
1575
1578
|
|
|
1576
1579
|
### AxiosHeaders.from(thing?)
|
|
@@ -1626,7 +1629,7 @@ const fetchAxios = axios.create({
|
|
|
1626
1629
|
const {data} = fetchAxios.get(url);
|
|
1627
1630
|
```
|
|
1628
1631
|
|
|
1629
|
-
The adapter supports the same functionality as `xhr` adapter, **including upload and download progress capturing**.
|
|
1632
|
+
The adapter supports the same functionality as `xhr` adapter, **including upload and download progress capturing**.
|
|
1630
1633
|
Also, it supports additional response types such as `stream` and `formdata` (if supported by the environment).
|
|
1631
1634
|
|
|
1632
1635
|
### 🔥 Custom fetch
|
|
@@ -1680,7 +1683,7 @@ const instance = axios.create({
|
|
|
1680
1683
|
const {data} = await instance.get("https://google.com");
|
|
1681
1684
|
```
|
|
1682
1685
|
|
|
1683
|
-
#### 🔥 Using with SvelteKit
|
|
1686
|
+
#### 🔥 Using with SvelteKit
|
|
1684
1687
|
|
|
1685
1688
|
[SvelteKit](https://svelte.dev/docs/kit/web-standards#Fetch-APIs) framework has a custom implementation of the fetch function for server rendering (so called `load` functions), and also uses relative paths,
|
|
1686
1689
|
which makes it incompatible with the standard URL API. So, Axios must be configured to use the custom fetch API:
|
|
@@ -1700,6 +1703,34 @@ export async function load({ fetch }) {
|
|
|
1700
1703
|
}
|
|
1701
1704
|
```
|
|
1702
1705
|
|
|
1706
|
+
## 🔥 HTTP2
|
|
1707
|
+
|
|
1708
|
+
In version `1.13.0`, experimental `HTTP2` support was added to the `http` adapter.
|
|
1709
|
+
The `httpVersion` option is now available to select the protocol version used.
|
|
1710
|
+
Additional native options for the internal `session.request()` call can be passed via the `http2Options` config.
|
|
1711
|
+
This config also includes the custom `sessionTimeout` parameter, which defaults to `1000ms`.
|
|
1712
|
+
|
|
1713
|
+
```js
|
|
1714
|
+
const form = new FormData();
|
|
1715
|
+
|
|
1716
|
+
form.append('foo', '123');
|
|
1717
|
+
|
|
1718
|
+
const {data, headers, status} = await axios.post('https://httpbin.org/post', form, {
|
|
1719
|
+
httpVersion: 2,
|
|
1720
|
+
http2Options: {
|
|
1721
|
+
// rejectUnauthorized: false,
|
|
1722
|
+
// sessionTimeout: 1000
|
|
1723
|
+
},
|
|
1724
|
+
onUploadProgress(e) {
|
|
1725
|
+
console.log('upload progress', e);
|
|
1726
|
+
},
|
|
1727
|
+
onDownloadProgress(e) {
|
|
1728
|
+
console.log('download progress', e);
|
|
1729
|
+
},
|
|
1730
|
+
responseType: 'arraybuffer'
|
|
1731
|
+
});
|
|
1732
|
+
```
|
|
1733
|
+
|
|
1703
1734
|
## Semver
|
|
1704
1735
|
|
|
1705
1736
|
Since Axios has reached a `v.1.0.0` we will fully embrace semver as per the spec [here](https://semver.org/)
|
|
@@ -1753,4 +1784,4 @@ axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/
|
|
|
1753
1784
|
|
|
1754
1785
|
## License
|
|
1755
1786
|
|
|
1756
|
-
[MIT](LICENSE)
|
|
1787
|
+
[](LICENSE)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Axios v1.
|
|
1
|
+
/*! Axios v1.13.0 Copyright (c) 2025 Matt Zabriskie and contributors */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -668,6 +668,13 @@
|
|
|
668
668
|
};
|
|
669
669
|
}
|
|
670
670
|
|
|
671
|
+
/**
|
|
672
|
+
* Create a bound version of a function with a specified `this` context
|
|
673
|
+
*
|
|
674
|
+
* @param {Function} fn - The function to bind
|
|
675
|
+
* @param {*} thisArg - The value to be passed as the `this` parameter
|
|
676
|
+
* @returns {Function} A new function that will call the original function with the specified `this` context
|
|
677
|
+
*/
|
|
671
678
|
function bind(fn, thisArg) {
|
|
672
679
|
return function wrap() {
|
|
673
680
|
return fn.apply(thisArg, arguments);
|
|
@@ -1831,7 +1838,7 @@
|
|
|
1831
1838
|
*
|
|
1832
1839
|
* @param {Number} id The ID that was returned by `use`
|
|
1833
1840
|
*
|
|
1834
|
-
* @returns {
|
|
1841
|
+
* @returns {void}
|
|
1835
1842
|
*/
|
|
1836
1843
|
}, {
|
|
1837
1844
|
key: "eject",
|
|
@@ -2702,20 +2709,33 @@
|
|
|
2702
2709
|
var cookies = platform.hasStandardBrowserEnv ?
|
|
2703
2710
|
// Standard browser envs support document.cookie
|
|
2704
2711
|
{
|
|
2705
|
-
write: function write(name, value, expires, path, domain, secure) {
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
utils$1.
|
|
2709
|
-
|
|
2710
|
-
|
|
2712
|
+
write: function write(name, value, expires, path, domain, secure, sameSite) {
|
|
2713
|
+
if (typeof document === 'undefined') return;
|
|
2714
|
+
var cookie = ["".concat(name, "=").concat(encodeURIComponent(value))];
|
|
2715
|
+
if (utils$1.isNumber(expires)) {
|
|
2716
|
+
cookie.push("expires=".concat(new Date(expires).toUTCString()));
|
|
2717
|
+
}
|
|
2718
|
+
if (utils$1.isString(path)) {
|
|
2719
|
+
cookie.push("path=".concat(path));
|
|
2720
|
+
}
|
|
2721
|
+
if (utils$1.isString(domain)) {
|
|
2722
|
+
cookie.push("domain=".concat(domain));
|
|
2723
|
+
}
|
|
2724
|
+
if (secure === true) {
|
|
2725
|
+
cookie.push('secure');
|
|
2726
|
+
}
|
|
2727
|
+
if (utils$1.isString(sameSite)) {
|
|
2728
|
+
cookie.push("SameSite=".concat(sameSite));
|
|
2729
|
+
}
|
|
2711
2730
|
document.cookie = cookie.join('; ');
|
|
2712
2731
|
},
|
|
2713
2732
|
read: function read(name) {
|
|
2714
|
-
|
|
2715
|
-
|
|
2733
|
+
if (typeof document === 'undefined') return null;
|
|
2734
|
+
var match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
|
|
2735
|
+
return match ? decodeURIComponent(match[1]) : null;
|
|
2716
2736
|
},
|
|
2717
2737
|
remove: function remove(name) {
|
|
2718
|
-
this.write(name, '', Date.now() - 86400000);
|
|
2738
|
+
this.write(name, '', Date.now() - 86400000, '/');
|
|
2719
2739
|
}
|
|
2720
2740
|
} :
|
|
2721
2741
|
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
@@ -3639,7 +3659,7 @@
|
|
|
3639
3659
|
};
|
|
3640
3660
|
var seedCache = new Map();
|
|
3641
3661
|
var getFetch = function getFetch(config) {
|
|
3642
|
-
var env = config
|
|
3662
|
+
var env = config && config.env || {};
|
|
3643
3663
|
var fetch = env.fetch,
|
|
3644
3664
|
Request = env.Request,
|
|
3645
3665
|
Response = env.Response;
|
|
@@ -3659,6 +3679,15 @@
|
|
|
3659
3679
|
};
|
|
3660
3680
|
getFetch();
|
|
3661
3681
|
|
|
3682
|
+
/**
|
|
3683
|
+
* Known adapters mapping.
|
|
3684
|
+
* Provides environment-specific adapters for Axios:
|
|
3685
|
+
* - `http` for Node.js
|
|
3686
|
+
* - `xhr` for browsers
|
|
3687
|
+
* - `fetch` for fetch API-based requests
|
|
3688
|
+
*
|
|
3689
|
+
* @type {Object<string, Function|Object>}
|
|
3690
|
+
*/
|
|
3662
3691
|
var knownAdapters = {
|
|
3663
3692
|
http: httpAdapter,
|
|
3664
3693
|
xhr: xhrAdapter,
|
|
@@ -3666,6 +3695,8 @@
|
|
|
3666
3695
|
get: getFetch
|
|
3667
3696
|
}
|
|
3668
3697
|
};
|
|
3698
|
+
|
|
3699
|
+
// Assign adapter names for easier debugging and identification
|
|
3669
3700
|
utils$1.forEach(knownAdapters, function (fn, value) {
|
|
3670
3701
|
if (fn) {
|
|
3671
3702
|
try {
|
|
@@ -3680,47 +3711,85 @@
|
|
|
3680
3711
|
});
|
|
3681
3712
|
}
|
|
3682
3713
|
});
|
|
3714
|
+
|
|
3715
|
+
/**
|
|
3716
|
+
* Render a rejection reason string for unknown or unsupported adapters
|
|
3717
|
+
*
|
|
3718
|
+
* @param {string} reason
|
|
3719
|
+
* @returns {string}
|
|
3720
|
+
*/
|
|
3683
3721
|
var renderReason = function renderReason(reason) {
|
|
3684
3722
|
return "- ".concat(reason);
|
|
3685
3723
|
};
|
|
3724
|
+
|
|
3725
|
+
/**
|
|
3726
|
+
* Check if the adapter is resolved (function, null, or false)
|
|
3727
|
+
*
|
|
3728
|
+
* @param {Function|null|false} adapter
|
|
3729
|
+
* @returns {boolean}
|
|
3730
|
+
*/
|
|
3686
3731
|
var isResolvedHandle = function isResolvedHandle(adapter) {
|
|
3687
3732
|
return utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
3688
3733
|
};
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3734
|
+
|
|
3735
|
+
/**
|
|
3736
|
+
* Get the first suitable adapter from the provided list.
|
|
3737
|
+
* Tries each adapter in order until a supported one is found.
|
|
3738
|
+
* Throws an AxiosError if no adapter is suitable.
|
|
3739
|
+
*
|
|
3740
|
+
* @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
|
|
3741
|
+
* @param {Object} config - Axios request configuration
|
|
3742
|
+
* @throws {AxiosError} If no suitable adapter is available
|
|
3743
|
+
* @returns {Function} The resolved adapter function
|
|
3744
|
+
*/
|
|
3745
|
+
function getAdapter(adapters, config) {
|
|
3746
|
+
adapters = utils$1.isArray(adapters) ? adapters : [adapters];
|
|
3747
|
+
var _adapters = adapters,
|
|
3748
|
+
length = _adapters.length;
|
|
3749
|
+
var nameOrAdapter;
|
|
3750
|
+
var adapter;
|
|
3751
|
+
var rejectedReasons = {};
|
|
3752
|
+
for (var i = 0; i < length; i++) {
|
|
3753
|
+
nameOrAdapter = adapters[i];
|
|
3754
|
+
var id = void 0;
|
|
3755
|
+
adapter = nameOrAdapter;
|
|
3756
|
+
if (!isResolvedHandle(nameOrAdapter)) {
|
|
3757
|
+
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
3758
|
+
if (adapter === undefined) {
|
|
3759
|
+
throw new AxiosError("Unknown adapter '".concat(id, "'"));
|
|
3709
3760
|
}
|
|
3710
|
-
rejectedReasons[id || '#' + i] = adapter;
|
|
3711
3761
|
}
|
|
3712
|
-
if (
|
|
3713
|
-
|
|
3714
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
3715
|
-
id = _ref2[0],
|
|
3716
|
-
state = _ref2[1];
|
|
3717
|
-
return "adapter ".concat(id, " ") + (state === false ? 'is not supported by the environment' : 'is not available in the build');
|
|
3718
|
-
});
|
|
3719
|
-
var s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified';
|
|
3720
|
-
throw new AxiosError("There is no suitable adapter to dispatch the request " + s, 'ERR_NOT_SUPPORT');
|
|
3762
|
+
if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
|
3763
|
+
break;
|
|
3721
3764
|
}
|
|
3722
|
-
|
|
3723
|
-
}
|
|
3765
|
+
rejectedReasons[id || '#' + i] = adapter;
|
|
3766
|
+
}
|
|
3767
|
+
if (!adapter) {
|
|
3768
|
+
var reasons = Object.entries(rejectedReasons).map(function (_ref) {
|
|
3769
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
3770
|
+
id = _ref2[0],
|
|
3771
|
+
state = _ref2[1];
|
|
3772
|
+
return "adapter ".concat(id, " ") + (state === false ? 'is not supported by the environment' : 'is not available in the build');
|
|
3773
|
+
});
|
|
3774
|
+
var s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified';
|
|
3775
|
+
throw new AxiosError("There is no suitable adapter to dispatch the request " + s, 'ERR_NOT_SUPPORT');
|
|
3776
|
+
}
|
|
3777
|
+
return adapter;
|
|
3778
|
+
}
|
|
3779
|
+
|
|
3780
|
+
/**
|
|
3781
|
+
* Exports Axios adapters and utility to resolve an adapter
|
|
3782
|
+
*/
|
|
3783
|
+
var adapters = {
|
|
3784
|
+
/**
|
|
3785
|
+
* Resolve an adapter from a list of adapter names or functions.
|
|
3786
|
+
* @type {Function}
|
|
3787
|
+
*/
|
|
3788
|
+
getAdapter: getAdapter,
|
|
3789
|
+
/**
|
|
3790
|
+
* Exposes all known adapters
|
|
3791
|
+
* @type {Object<string, Function|Object>}
|
|
3792
|
+
*/
|
|
3724
3793
|
adapters: knownAdapters
|
|
3725
3794
|
};
|
|
3726
3795
|
|
|
@@ -3778,7 +3847,7 @@
|
|
|
3778
3847
|
});
|
|
3779
3848
|
}
|
|
3780
3849
|
|
|
3781
|
-
var VERSION = "1.
|
|
3850
|
+
var VERSION = "1.13.0";
|
|
3782
3851
|
|
|
3783
3852
|
var validators$1 = {};
|
|
3784
3853
|
|
|
@@ -4314,7 +4383,13 @@
|
|
|
4314
4383
|
InsufficientStorage: 507,
|
|
4315
4384
|
LoopDetected: 508,
|
|
4316
4385
|
NotExtended: 510,
|
|
4317
|
-
NetworkAuthenticationRequired: 511
|
|
4386
|
+
NetworkAuthenticationRequired: 511,
|
|
4387
|
+
WebServerIsDown: 521,
|
|
4388
|
+
ConnectionTimedOut: 522,
|
|
4389
|
+
OriginIsUnreachable: 523,
|
|
4390
|
+
TimeoutOccurred: 524,
|
|
4391
|
+
SslHandshakeFailed: 525,
|
|
4392
|
+
InvalidSslCertificate: 526
|
|
4318
4393
|
};
|
|
4319
4394
|
Object.entries(HttpStatusCode).forEach(function (_ref) {
|
|
4320
4395
|
var _ref2 = _slicedToArray(_ref, 2),
|