Comparing version 8.0.0 to 8.0.1
@@ -6,2 +6,23 @@ # Change Log | ||
## [8.0.1](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v8.0.0...v8.0.1) (2019-12-24) | ||
### Build System / Dependencies | ||
* update linters ([#346](https://github.com/wopian/kitsu/tree/master/packages/kitsu/issues/346)) ([6dd5080](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/6dd5080)) | ||
### Chores | ||
* **release:** update documentation ([b8399f4](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/b8399f4)) | ||
### Refactors | ||
* **kitsu-core:** remove unnecessary instances of async/await ([#351](https://github.com/wopian/kitsu/tree/master/packages/kitsu/issues/351)) ([8a88fe4](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/8a88fe4)) | ||
# [8.0.0](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v7.3.0...v8.0.0) (2019-12-03) | ||
@@ -8,0 +29,0 @@ |
@@ -1,1 +0,1 @@ | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var axios=_interopDefault(require("axios")),pluralise=_interopDefault(require("pluralize")),kitsuCore=require("kitsu-core");class Kitsu{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!1===e.camelCaseTypes?this.camel=e=>e:this.camel=kitsuCore.camel,"none"===e.resourceCase?this.resCase=e=>e:"snake"===e.resourceCase?this.resCase=kitsuCore.snake:this.resCase=kitsuCore.kebab,!1===e.pluralize?this.plural=e=>e:this.plural=pluralise,this.headers=Object.assign({},e.headers,{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json"}),this.axios=axios.create(Object.assign({},{baseURL:e.baseURL||"https://kitsu.io/api/edge",timeout:e.timeout||3e4},e.axiosOptions)),this.fetch=this.get,this.update=this.patch,this.create=this.post,this.remove=this.delete,this.interceptors=this.axios.interceptors}async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{let[i,a,r]=e.split("/"),o=this.plural(this.resCase(i));a&&(o+="/".concat(a)),r&&(o+="/".concat(this.resCase(r)));const{data:h}=await this.axios.get(o,{params:t,paramsSerializer:e=>kitsuCore.query(e),headers:Object.assign(this.headers,s)});return kitsuCore.deserialise(h)}catch(e){throw kitsuCore.error(e)}}async patch(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{const i=await kitsuCore.serialise.apply(this,[e,t,"PATCH"]),a=this.plural(this.resCase(e))+"/"+t.id,{data:r}=await this.axios.patch(a,i,{headers:Object.assign(this.headers,s)});return r}catch(e){throw kitsuCore.error(e)}}async post(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{const i=this.plural(this.resCase(e)),{data:a}=await this.axios.post(i,await kitsuCore.serialise.apply(this,[e,t]),{headers:Object.assign(this.headers,s)});return a}catch(e){throw kitsuCore.error(e)}}async delete(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{const i=this.plural(this.resCase(e))+"/"+t,{data:a}=await this.axios.delete(i,{data:await kitsuCore.serialise.apply(this,[e,{id:t},"DELETE"]),headers:Object.assign(this.headers,s)});return a}catch(e){throw kitsuCore.error(e)}}async self(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{return(await this.get("users",Object.assign({filter:{self:!0}},e),t)).data[0]}catch(e){throw kitsuCore.error(e)}}}module.exports=Kitsu; | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var axios=_interopDefault(require("axios")),pluralise=_interopDefault(require("pluralize")),kitsuCore=require("kitsu-core");class Kitsu{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!1===e.camelCaseTypes?this.camel=e=>e:this.camel=kitsuCore.camel,"none"===e.resourceCase?this.resCase=e=>e:"snake"===e.resourceCase?this.resCase=kitsuCore.snake:this.resCase=kitsuCore.kebab,!1===e.pluralize?this.plural=e=>e:this.plural=pluralise,this.headers=Object.assign({},e.headers,{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json"}),this.axios=axios.create(Object.assign({},{baseURL:e.baseURL||"https://kitsu.io/api/edge",timeout:e.timeout||3e4},e.axiosOptions)),this.fetch=this.get,this.update=this.patch,this.create=this.post,this.remove=this.delete,this.interceptors=this.axios.interceptors}async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{const[i,a,r]=e.split("/");let o=this.plural(this.resCase(i));a&&(o+="/".concat(a)),r&&(o+="/".concat(this.resCase(r)));const{data:h}=await this.axios.get(o,{params:t,paramsSerializer:e=>kitsuCore.query(e),headers:Object.assign(this.headers,s)});return kitsuCore.deserialise(h)}catch(e){throw kitsuCore.error(e)}}async patch(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{const i=kitsuCore.serialise.apply(this,[e,t,"PATCH"]),a=this.plural(this.resCase(e))+"/"+t.id,{data:r}=await this.axios.patch(a,i,{headers:Object.assign(this.headers,s)});return r}catch(e){throw kitsuCore.error(e)}}async post(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{const i=this.plural(this.resCase(e)),{data:a}=await this.axios.post(i,kitsuCore.serialise.apply(this,[e,t]),{headers:Object.assign(this.headers,s)});return a}catch(e){throw kitsuCore.error(e)}}async delete(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{const i=this.plural(this.resCase(e))+"/"+t,{data:a}=await this.axios.delete(i,{data:kitsuCore.serialise.apply(this,[e,{id:t},"DELETE"]),headers:Object.assign(this.headers,s)});return a}catch(e){throw kitsuCore.error(e)}}async self(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{return(await this.get("users",Object.assign({filter:{self:!0}},e),t)).data[0]}catch(e){throw kitsuCore.error(e)}}}module.exports=Kitsu; |
{ | ||
"version": "8.0.0", | ||
"version": "8.0.1", | ||
"name": "kitsu", | ||
@@ -50,3 +50,3 @@ "description": "Simple & lightweight JSON-API client for Kitsu and other compliant APIs", | ||
"axios": "^0.19.0", | ||
"kitsu-core": "^8.0.0", | ||
"kitsu-core": "^8.0.1", | ||
"pluralize": "^8.0.0" | ||
@@ -64,3 +64,3 @@ }, | ||
], | ||
"gitHead": "cfa05dcfbe5607c47624e425c82a973bc547bc21", | ||
"gitHead": "22d628df87995487215fddf9cbad622bd0c7417b", | ||
"devDependencies": { | ||
@@ -67,0 +67,0 @@ "@size-limit/preset-small-lib": "~2.2.1" |
@@ -197,3 +197,3 @@ <h1 align=center>Kitsu</h1> | ||
[packages/kitsu/src/index.js:30-324](https://github.com/wopian/kitsu/blob/4bd2182f2aa387b1f93305f286ec266f62241a1a/packages/kitsu/src/index.js#L30-L324 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:30-324](https://github.com/wopian/kitsu/blob/6dd508093be95a4cec217dde319c8dedbe76832b/packages/kitsu/src/index.js#L30-L324 "Source code on GitHub") | ||
@@ -245,3 +245,3 @@ Creates a new `kitsu` instance | ||
[packages/kitsu/src/index.js:52-53](https://github.com/wopian/kitsu/blob/4bd2182f2aa387b1f93305f286ec266f62241a1a/packages/kitsu/src/index.js#L52-L53 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:52-53](https://github.com/wopian/kitsu/blob/6dd508093be95a4cec217dde319c8dedbe76832b/packages/kitsu/src/index.js#L52-L53 "Source code on GitHub") | ||
@@ -266,3 +266,3 @@ - **See: <https://www.npmjs.com/package/pluralize> for documentation** | ||
[packages/kitsu/src/index.js:67-67](https://github.com/wopian/kitsu/blob/4bd2182f2aa387b1f93305f286ec266f62241a1a/packages/kitsu/src/index.js#L67-L67 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:67-67](https://github.com/wopian/kitsu/blob/6dd508093be95a4cec217dde319c8dedbe76832b/packages/kitsu/src/index.js#L67-L67 "Source code on GitHub") | ||
@@ -298,3 +298,3 @@ Get the current headers or add additional headers | ||
[packages/kitsu/src/index.js:111-111](https://github.com/wopian/kitsu/blob/4bd2182f2aa387b1f93305f286ec266f62241a1a/packages/kitsu/src/index.js#L111-L111 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:111-111](https://github.com/wopian/kitsu/blob/6dd508093be95a4cec217dde319c8dedbe76832b/packages/kitsu/src/index.js#L111-L111 "Source code on GitHub") | ||
@@ -347,3 +347,3 @@ Axios Interceptors (alias of `axios.interceptors`) | ||
[packages/kitsu/src/index.js:184-203](https://github.com/wopian/kitsu/blob/4bd2182f2aa387b1f93305f286ec266f62241a1a/packages/kitsu/src/index.js#L184-L203 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:184-203](https://github.com/wopian/kitsu/blob/6dd508093be95a4cec217dde319c8dedbe76832b/packages/kitsu/src/index.js#L184-L203 "Source code on GitHub") | ||
@@ -460,3 +460,3 @@ Fetch resources (alias `fetch`) | ||
[packages/kitsu/src/index.js:219-233](https://github.com/wopian/kitsu/blob/4bd2182f2aa387b1f93305f286ec266f62241a1a/packages/kitsu/src/index.js#L219-L233 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:219-233](https://github.com/wopian/kitsu/blob/6dd508093be95a4cec217dde319c8dedbe76832b/packages/kitsu/src/index.js#L219-L233 "Source code on GitHub") | ||
@@ -487,3 +487,3 @@ Update a resource (alias `update`) | ||
[packages/kitsu/src/index.js:256-269](https://github.com/wopian/kitsu/blob/4bd2182f2aa387b1f93305f286ec266f62241a1a/packages/kitsu/src/index.js#L256-L269 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:256-269](https://github.com/wopian/kitsu/blob/6dd508093be95a4cec217dde319c8dedbe76832b/packages/kitsu/src/index.js#L256-L269 "Source code on GitHub") | ||
@@ -521,3 +521,3 @@ Create a new resource (alias `create`) | ||
[packages/kitsu/src/index.js:282-294](https://github.com/wopian/kitsu/blob/4bd2182f2aa387b1f93305f286ec266f62241a1a/packages/kitsu/src/index.js#L282-L294 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:282-294](https://github.com/wopian/kitsu/blob/6dd508093be95a4cec217dde319c8dedbe76832b/packages/kitsu/src/index.js#L282-L294 "Source code on GitHub") | ||
@@ -545,3 +545,3 @@ Remove a resource (alias `remove`) | ||
[packages/kitsu/src/index.js:316-323](https://github.com/wopian/kitsu/blob/4bd2182f2aa387b1f93305f286ec266f62241a1a/packages/kitsu/src/index.js#L316-L323 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:316-323](https://github.com/wopian/kitsu/blob/6dd508093be95a4cec217dde319c8dedbe76832b/packages/kitsu/src/index.js#L316-L323 "Source code on GitHub") | ||
@@ -548,0 +548,0 @@ Get the authenticated user's data |
Sorry, the diff of this file is not supported yet
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
74266
Updatedkitsu-core@^8.0.1