Comparing version 9.1.10 to 9.1.11
@@ -6,2 +6,28 @@ # Change Log | ||
## [9.1.11](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.1.10...v9.1.11) (2020-06-14) | ||
### Bug Fixes | ||
* **kitsu:** use ID-less URL for bulk extension in PATCH requests ([2c31d42](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/2c31d42)) | ||
### Chores | ||
* **release:** update documentation ([ba00f68](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/ba00f68)) | ||
### Other Changes | ||
* Update README.md ([6266c30](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/6266c30)) | ||
### Tests | ||
* **kitsu:** re-add bulk test ([3fcd884](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/3fcd884)) | ||
## [9.1.10](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.1.9...v9.1.10) (2020-05-31) | ||
@@ -8,0 +34,0 @@ |
@@ -1,1 +0,1 @@ | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var s=e(require("axios")),a=e(require("pluralize")),t=require("kitsu-core");module.exports=class{constructor(e={}){!1===e.camelCaseTypes?this.camel=e=>e:this.camel=t.camel,"none"===e.resourceCase?this.resCase=e=>e:"snake"===e.resourceCase?this.resCase=t.snake:this.resCase=t.kebab,!1===e.pluralize?this.plural=e=>e:this.plural=a,this.headers=Object.assign({},e.headers,{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json"}),this.axios=s.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,s={},a={}){try{const[r,i,l]=e.split("/");let c=this.plural(this.resCase(r));i&&(c+="/".concat(i)),l&&(c+="/".concat(this.resCase(l)));const{data:h}=await this.axios.get(c,{params:s,paramsSerializer:e=>t.query(e),headers:Object.assign(this.headers,a)});return t.deserialise(h)}catch(e){throw t.error(e)}}async patch(e,s,a={}){try{const[r,i]=t.splitModel(e,{resourceCase:this.resCase,pluralModel:this.plural}),l=t.serialise(r,s,"PATCH",{camelCaseTypes:this.camel,pluralTypes:this.plural}),{data:c}=await this.axios.patch("".concat(i,"/").concat(s.id),l,{headers:Object.assign(this.headers,a)});return t.deserialise(c)}catch(e){throw t.error(e)}}async post(e,s,a={}){try{const[r,i]=t.splitModel(e,{resourceCase:this.resCase,pluralModel:this.plural}),{data:l}=await this.axios.post(i,t.serialise(r,s,"POST",{camelCaseTypes:this.camel,pluralTypes:this.plural}),{headers:Object.assign(this.headers,a)});return t.deserialise(l)}catch(e){throw t.error(e)}}async delete(e,s,a={}){try{const[r,i]=t.splitModel(e,{resourceCase:this.resCase,pluralModel:this.plural});let l,c;Array.isArray(s)?(l=i,c=s.map(e=>({id:e}))):(l="".concat(i,"/").concat(s),c={id:s});const{data:h}=await this.axios.delete(l,{data:t.serialise(r,c,"DELETE",{camelCaseTypes:this.camel,pluralTypes:this.plural}),headers:Object.assign(this.headers,a)});return h}catch(e){throw t.error(e)}}async self(e={},s={}){try{return(await this.get("users",Object.assign({filter:{self:!0}},e),s)).data[0]}catch(e){throw t.error(e)}}async request({body:e,method:s,params:a,type:r,url:i},l={}){try{var c;s=(null===(c=s)||void 0===c?void 0:c.toUpperCase())||"GET";const{data:h}=await this.axios.request({method:s,url:i,data:["GET","DELETE"].includes(s)?void 0:t.serialise(r,e,s,{camelCaseTypes:this.camel,pluralTypes:this.plural}),params:a,paramsSerializer:e=>t.query(e),headers:Object.assign(this.headers,l)});return t.deserialise(h)}catch(e){throw t.error(e)}}}; | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var s=e(require("axios")),a=e(require("pluralize")),t=require("kitsu-core");module.exports=class{constructor(e={}){!1===e.camelCaseTypes?this.camel=e=>e:this.camel=t.camel,"none"===e.resourceCase?this.resCase=e=>e:"snake"===e.resourceCase?this.resCase=t.snake:this.resCase=t.kebab,!1===e.pluralize?this.plural=e=>e:this.plural=a,this.headers=Object.assign({},e.headers,{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json"}),this.axios=s.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,s={},a={}){try{const[r,i,l]=e.split("/");let c=this.plural(this.resCase(r));i&&(c+="/".concat(i)),l&&(c+="/".concat(this.resCase(l)));const{data:h}=await this.axios.get(c,{params:s,paramsSerializer:e=>t.query(e),headers:Object.assign(this.headers,a)});return t.deserialise(h)}catch(e){throw t.error(e)}}async patch(e,s,a={}){try{const[r,i]=t.splitModel(e,{resourceCase:this.resCase,pluralModel:this.plural}),l=t.serialise(r,s,"PATCH",{camelCaseTypes:this.camel,pluralTypes:this.plural}),c=(null==s?void 0:s.id)?"".concat(i,"/").concat(s.id):i,{data:h}=await this.axios.patch(c,l,{headers:Object.assign(this.headers,a)});return t.deserialise(h)}catch(e){throw t.error(e)}}async post(e,s,a={}){try{const[r,i]=t.splitModel(e,{resourceCase:this.resCase,pluralModel:this.plural}),{data:l}=await this.axios.post(i,t.serialise(r,s,"POST",{camelCaseTypes:this.camel,pluralTypes:this.plural}),{headers:Object.assign(this.headers,a)});return t.deserialise(l)}catch(e){throw t.error(e)}}async delete(e,s,a={}){try{const[r,i]=t.splitModel(e,{resourceCase:this.resCase,pluralModel:this.plural});let l,c;Array.isArray(s)?(l=i,c=s.map(e=>({id:e}))):(l="".concat(i,"/").concat(s),c={id:s});const{data:h}=await this.axios.delete(l,{data:t.serialise(r,c,"DELETE",{camelCaseTypes:this.camel,pluralTypes:this.plural}),headers:Object.assign(this.headers,a)});return h}catch(e){throw t.error(e)}}async self(e={},s={}){try{return(await this.get("users",Object.assign({filter:{self:!0}},e),s)).data[0]}catch(e){throw t.error(e)}}async request({body:e,method:s,params:a,type:r,url:i},l={}){try{var c;s=(null===(c=s)||void 0===c?void 0:c.toUpperCase())||"GET";const{data:h}=await this.axios.request({method:s,url:i,data:["GET","DELETE"].includes(s)?void 0:t.serialise(r,e,s,{camelCaseTypes:this.camel,pluralTypes:this.plural}),params:a,paramsSerializer:e=>t.query(e),headers:Object.assign(this.headers,l)});return t.deserialise(h)}catch(e){throw t.error(e)}}}; |
{ | ||
"version": "9.1.10", | ||
"version": "9.1.11", | ||
"name": "kitsu", | ||
@@ -50,3 +50,3 @@ "description": "A simple, lightweight & framework agnostic JSON:API client using Axios", | ||
"axios": "^0.19.0", | ||
"kitsu-core": "^9.1.10", | ||
"kitsu-core": "^9.1.11", | ||
"pluralize": "^8.0.0" | ||
@@ -66,3 +66,3 @@ }, | ||
], | ||
"gitHead": "a6e2ba10dee67e7fcdb0fbe68554e4ff55fa1cfd", | ||
"gitHead": "edb7e07755b5d4a78509cb539d03f18ee3a2f5ca", | ||
"devDependencies": { | ||
@@ -69,0 +69,0 @@ "@size-limit/preset-small-lib": "~4.5.0" |
@@ -23,6 +23,2 @@ <h1 align=center>Kitsu</h1> | ||
<p align=center> | ||
<a href=https://paypal.me/wopian><img alt="support me on paypal.me"src=https://flat.badgen.net/badge/support%20me%20on/paypal.me/pink></a> | ||
</p> | ||
<p align=center>A simple, lightweight & framework agnostic <a href=http://jsonapi.org>JSON:API</a> client using Axios</p> | ||
@@ -217,3 +213,3 @@ | ||
[packages/kitsu/src/index.js:30-463](https://github.com/wopian/kitsu/blob/8811addad1e0d7752ee1b0acc52cbd72bf485c86/packages/kitsu/src/index.js#L30-L463 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:30-464](https://github.com/wopian/kitsu/blob/3fcd88441936dfcec441faf3c5903c04c6c0c0cc/packages/kitsu/src/index.js#L30-L464 "Source code on GitHub") | ||
@@ -265,3 +261,3 @@ Creates a new `kitsu` instance | ||
[packages/kitsu/src/index.js:52-53](https://github.com/wopian/kitsu/blob/8811addad1e0d7752ee1b0acc52cbd72bf485c86/packages/kitsu/src/index.js#L52-L53 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:52-53](https://github.com/wopian/kitsu/blob/3fcd88441936dfcec441faf3c5903c04c6c0c0cc/packages/kitsu/src/index.js#L52-L53 "Source code on GitHub") | ||
@@ -288,3 +284,3 @@ - **See: <https://www.npmjs.com/package/pluralize> for documentation | ||
[packages/kitsu/src/index.js:67-67](https://github.com/wopian/kitsu/blob/8811addad1e0d7752ee1b0acc52cbd72bf485c86/packages/kitsu/src/index.js#L67-L67 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:67-67](https://github.com/wopian/kitsu/blob/3fcd88441936dfcec441faf3c5903c04c6c0c0cc/packages/kitsu/src/index.js#L67-L67 "Source code on GitHub") | ||
@@ -320,3 +316,3 @@ Get the current headers or add additional headers | ||
[packages/kitsu/src/index.js:112-112](https://github.com/wopian/kitsu/blob/8811addad1e0d7752ee1b0acc52cbd72bf485c86/packages/kitsu/src/index.js#L112-L112 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:112-112](https://github.com/wopian/kitsu/blob/3fcd88441936dfcec441faf3c5903c04c6c0c0cc/packages/kitsu/src/index.js#L112-L112 "Source code on GitHub") | ||
@@ -372,3 +368,3 @@ - **See: <https://github.com/axios/axios#interceptors> for documentation | ||
[packages/kitsu/src/index.js:189-208](https://github.com/wopian/kitsu/blob/8811addad1e0d7752ee1b0acc52cbd72bf485c86/packages/kitsu/src/index.js#L189-L208 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:189-208](https://github.com/wopian/kitsu/blob/3fcd88441936dfcec441faf3c5903c04c6c0c0cc/packages/kitsu/src/index.js#L189-L208 "Source code on GitHub") | ||
@@ -489,3 +485,3 @@ Fetch resources (alias `fetch`) | ||
[packages/kitsu/src/index.js:241-261](https://github.com/wopian/kitsu/blob/8811addad1e0d7752ee1b0acc52cbd72bf485c86/packages/kitsu/src/index.js#L241-L261 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:241-262](https://github.com/wopian/kitsu/blob/3fcd88441936dfcec441faf3c5903c04c6c0c0cc/packages/kitsu/src/index.js#L241-L262 "Source code on GitHub") | ||
@@ -553,3 +549,3 @@ Update a resource (alias `update`) | ||
[packages/kitsu/src/index.js:289-308](https://github.com/wopian/kitsu/blob/8811addad1e0d7752ee1b0acc52cbd72bf485c86/packages/kitsu/src/index.js#L289-L308 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:290-309](https://github.com/wopian/kitsu/blob/3fcd88441936dfcec441faf3c5903c04c6c0c0cc/packages/kitsu/src/index.js#L290-L309 "Source code on GitHub") | ||
@@ -597,3 +593,3 @@ Create a new resource (alias `create`) | ||
[packages/kitsu/src/index.js:323-352](https://github.com/wopian/kitsu/blob/8811addad1e0d7752ee1b0acc52cbd72bf485c86/packages/kitsu/src/index.js#L323-L352 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:324-353](https://github.com/wopian/kitsu/blob/3fcd88441936dfcec441faf3c5903c04c6c0c0cc/packages/kitsu/src/index.js#L324-L353 "Source code on GitHub") | ||
@@ -628,3 +624,3 @@ Remove a resource (alias `remove`) | ||
[packages/kitsu/src/index.js:374-381](https://github.com/wopian/kitsu/blob/8811addad1e0d7752ee1b0acc52cbd72bf485c86/packages/kitsu/src/index.js#L374-L381 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:375-382](https://github.com/wopian/kitsu/blob/3fcd88441936dfcec441faf3c5903c04c6c0c0cc/packages/kitsu/src/index.js#L375-L382 "Source code on GitHub") | ||
@@ -666,3 +662,3 @@ Get the authenticated user's data | ||
[packages/kitsu/src/index.js:442-462](https://github.com/wopian/kitsu/blob/8811addad1e0d7752ee1b0acc52cbd72bf485c86/packages/kitsu/src/index.js#L442-L462 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:443-463](https://github.com/wopian/kitsu/blob/3fcd88441936dfcec441faf3c5903c04c6c0c0cc/packages/kitsu/src/index.js#L443-L463 "Source code on GitHub") | ||
@@ -669,0 +665,0 @@ Send arbitrary requests |
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
63500
770
Updatedkitsu-core@^9.1.11