@nuxtjs/axios
Advanced tools
Comparing version 5.12.1 to 5.12.2
@@ -5,2 +5,13 @@ # Changelog | ||
### [5.12.2](https://github.com/nuxt-community/axios-module/compare/v5.12.1...v5.12.2) (2020-08-25) | ||
### Bug Fixes | ||
* **types:** extend Axios.AxiosRequestConfig with "progress" option ([#408](https://github.com/nuxt-community/axios-module/issues/408)) ([ea4ea7e](https://github.com/nuxt-community/axios-module/commit/ea4ea7e323e053d6ae025210534c675e468a273c)) | ||
### Docs | ||
* Migrate docs to nuxt/content ([#404](https://github.com/nuxt-community/axios-module/pull/404)) | ||
### [5.12.1](https://github.com/nuxt-community/axios-module/compare/v5.12.0...v5.12.1) (2020-08-05) | ||
@@ -7,0 +18,0 @@ |
@@ -11,3 +11,3 @@ import Axios from 'axios' | ||
setHeader (name, value, scopes = 'common') { | ||
for (let scope of Array.isArray(scopes) ? scopes : [ scopes ]) { | ||
for (const scope of Array.isArray(scopes) ? scopes : [ scopes ]) { | ||
if (!value) { | ||
@@ -46,3 +46,3 @@ delete this.defaults.headers[scope][name]; | ||
// Request helpers ($get, $post, ...) | ||
for (let method of ['request', 'delete', 'get', 'head', 'options', 'post', 'put', 'patch']) { | ||
for (const method of ['request', 'delete', 'get', 'head', 'options', 'post', 'put', 'patch']) { | ||
axiosExtra['$' + method] = function () { return this[method].apply(this, arguments).then(res => res && res.data) } | ||
@@ -52,3 +52,3 @@ } | ||
const extendAxiosInstance = axios => { | ||
for (let key in axiosExtra) { | ||
for (const key in axiosExtra) { | ||
axios[key] = axiosExtra[key].bind(axios) | ||
@@ -212,3 +212,3 @@ } | ||
const reqHeaders = { ...ctx.req.headers } | ||
for (let h of <%= serialize(options.proxyHeadersIgnore) %>) { | ||
for (const h of <%= serialize(options.proxyHeadersIgnore) %>) { | ||
delete reqHeaders[h] | ||
@@ -215,0 +215,0 @@ } |
{ | ||
"name": "@nuxtjs/axios", | ||
"version": "5.12.1", | ||
"version": "5.12.2", | ||
"description": "Secure and easy axios integration with Nuxt.js", | ||
@@ -27,5 +27,5 @@ "license": "MIT", | ||
"@nuxtjs/proxy": "^2.0.1", | ||
"axios": "^0.19.2", | ||
"axios": "^0.20.0", | ||
"axios-retry": "^3.1.8", | ||
"consola": "^2.14.0", | ||
"consola": "^2.15.0", | ||
"defu": "^3.1.0" | ||
@@ -36,4 +36,2 @@ }, | ||
"@babel/preset-env": "latest", | ||
"@commitlint/cli": "latest", | ||
"@commitlint/config-conventional": "latest", | ||
"@nuxtjs/eslint-config": "latest", | ||
@@ -51,3 +49,2 @@ "babel-eslint": "latest", | ||
"eslint-plugin-vue": "latest", | ||
"husky": "latest", | ||
"jest": "latest", | ||
@@ -54,0 +51,0 @@ "nuxt-edge": "latest", |
# 📦 Axios Module | ||
[![npm version][npm-version-src]][npm-version-href] | ||
[![npm downloads][npm-downloads-src]][npm-downloads-href] | ||
[![Circle CI][circle-ci-src]][circle-ci-href] | ||
[![Checks][checks-src]][checks-href] | ||
[![Codecov][codecov-src]][codecov-href] | ||
[![Dependencies][david-dm-src]][david-dm-href] | ||
[![Standard JS][standard-js-src]][standard-js-href] | ||
> Secure and Easy <a href="https://github.com/mzabriskie/axios">Axios</a> integration with Nuxt.js | ||
## ✅ Features | ||
✓ Automatically set base URL for client & server side | ||
✓ Exposes `setToken` function to `$axios` so we can easily and globally set authentication tokens | ||
✓ Automatically enables `withCredentials` when requesting to base URL | ||
✓ Proxy request headers in SSR (Useful for auth) | ||
✓ Fetch Style requests | ||
✓ Integrated with Nuxt.js Progressbar while making requests | ||
✓ Integrated with [Proxy Module](https://github.com/nuxt-community/proxy-module) | ||
✓ Auto retry requests with [axios-retry](https://github.com/softonic/axios-retry) | ||
📖 [**Read Documentation**](https://axios.nuxtjs.org) | ||
@@ -45,13 +26,10 @@ | ||
<!-- Badges --> | ||
[npm-version-src]: https://img.shields.io/npm/dt/@nuxtjs/axios.svg?style=flat-square | ||
<!-- Badges --> | ||
[npm-version-src]: https://flat.badgen.net/npm/v/@nuxtjs/axios | ||
[npm-version-href]: https://npmjs.com/package/@nuxtjs/axios | ||
[npm-downloads-src]: https://img.shields.io/npm/v/@nuxtjs/axios/latest.svg?style=flat-square | ||
[npm-downloads-src]: https://flat.badgen.net/npm/dm/@nuxtjs/axios | ||
[npm-downloads-href]: https://npmjs.com/package/@nuxtjs/axios | ||
[circle-ci-src]: https://img.shields.io/circleci/project/github/nuxt-community/axios-module.svg?style=flat-square | ||
[circle-ci-href]: https://circleci.com/gh/nuxt-community/axios-module | ||
[codecov-src]: https://img.shields.io/codecov/c/github/nuxt-community/axios-module.svg?style=flat-square | ||
[checks-src]: https://flat.badgen.net/github/checks/nuxt-community/axios-module/dev | ||
[checks-href]: https://github.com/nuxt-community/axios-module/actions | ||
[codecov-src]: https://flat.badgen.net/codecov/c/github/nuxt-community/axios-module | ||
[codecov-href]: https://codecov.io/gh/nuxt-community/axios-module | ||
[david-dm-src]: https://david-dm.org/nuxt-community/axios-module/status.svg?style=flat-square | ||
[david-dm-href]: https://david-dm.org/nuxt-community/axios-module | ||
[standard-js-src]: https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square | ||
[standard-js-href]: https://standardjs.com |
@@ -32,3 +32,3 @@ import { AxiosError, AxiosRequestConfig, AxiosResponse, AxiosStatic } from 'axios' | ||
debug?: boolean, | ||
host?: string, | ||
host?: string, | ||
prefix?: string, | ||
@@ -53,2 +53,8 @@ progress?: boolean, | ||
declare module 'axios' { | ||
interface AxiosRequestConfig { | ||
progress?: boolean; | ||
} | ||
} | ||
declare module '@nuxt/vue-app' { | ||
@@ -55,0 +61,0 @@ interface Context { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17
381
43540
35
+ Addedaxios@0.20.0(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
- Removedaxios@0.19.2(transitive)
- Removedfollow-redirects@1.5.10(transitive)
Updatedaxios@^0.20.0
Updatedconsola@^2.15.0