Comparing version 10.0.0-alpha.10 to 10.0.0-alpha.11
284
CHANGELOG.md
@@ -6,8 +6,20 @@ # Change Log | ||
# [10.0.0-alpha.10](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v10.0.0-alpha.9...v10.0.0-alpha.10) (2021-02-04) | ||
# [10.0.0-alpha.11](https://github.com/wopian/kitsu/compare/v10.0.0-alpha.10...v10.0.0-alpha.11) (2021-06-07) | ||
### Bug Fixes | ||
* re-add support for resource object-linkage for relationships ([#552](https://github.com/wopian/kitsu/issues/552)) ([f66d077](https://github.com/wopian/kitsu/commit/f66d077c8872a0f4c34ed46a48086ec32cdaf64e)) | ||
# [10.0.0-alpha.10](https://github.com/wopian/kitsu/compare/v10.0.0-alpha.9...v10.0.0-alpha.10) (2021-02-04) | ||
### Chores | ||
* **release:** update documentation ([92d4246](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/92d4246)) | ||
* **release:** update documentation ([92d4246](https://github.com/wopian/kitsu/commit/92d4246)) | ||
@@ -18,3 +30,3 @@ | ||
# [10.0.0-alpha.9](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v10.0.0-alpha.8...v10.0.0-alpha.9) (2021-01-06) | ||
# [10.0.0-alpha.9](https://github.com/wopian/kitsu/compare/v10.0.0-alpha.8...v10.0.0-alpha.9) (2021-01-06) | ||
@@ -24,3 +36,3 @@ | ||
* update dependency axios to ^0.21.1 ([b34d854](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/b34d854)) | ||
* update dependency axios to ^0.21.1 ([b34d854](https://github.com/wopian/kitsu/commit/b34d854)) | ||
@@ -30,3 +42,3 @@ | ||
* **release:** update documentation ([840d383](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/840d383)) | ||
* **release:** update documentation ([840d383](https://github.com/wopian/kitsu/commit/840d383)) | ||
@@ -36,3 +48,3 @@ | ||
* update minimum browser support for compiled outputs ([1bd4f77](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/1bd4f77)) | ||
* update minimum browser support for compiled outputs ([1bd4f77](https://github.com/wopian/kitsu/commit/1bd4f77)) | ||
@@ -42,3 +54,3 @@ | ||
* **kitsu:** change output directory to `dist` ([ac249b7](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/ac249b7)) | ||
* **kitsu:** change output directory to `dist` ([ac249b7](https://github.com/wopian/kitsu/commit/ac249b7)) | ||
@@ -50,3 +62,3 @@ | ||
# [10.0.0-alpha.8](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v10.0.0-alpha.7...v10.0.0-alpha.8) (2020-12-06) | ||
# [10.0.0-alpha.8](https://github.com/wopian/kitsu/compare/v10.0.0-alpha.7...v10.0.0-alpha.8) (2020-12-06) | ||
@@ -56,6 +68,6 @@ | ||
* **kitsu:** update devdependency [@size-limit](https://github.com/size-limit)/preset-small-lib to ~4.7.0 ([#487](https://github.com/wopian/kitsu/tree/master/packages/kitsu/issues/487)) ([e82cafa](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/e82cafa)) | ||
* **kitsu:** update devdependency [@size-limit](https://github.com/size-limit)/preset-small-lib to ~4.8.0 ([#493](https://github.com/wopian/kitsu/tree/master/packages/kitsu/issues/493)) ([50cfe59](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/50cfe59)) | ||
* **kitsu:** update devdependency [@size-limit](https://github.com/size-limit)/preset-small-lib to ~4.9.0 ([#498](https://github.com/wopian/kitsu/tree/master/packages/kitsu/issues/498)) ([68170d2](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/68170d2)) | ||
* drop node 10 support ([#484](https://github.com/wopian/kitsu/tree/master/packages/kitsu/issues/484)) ([e34fcec](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/e34fcec)) | ||
* **kitsu:** update devdependency [@size-limit](https://github.com/size-limit)/preset-small-lib to ~4.7.0 ([#487](https://github.com/wopian/kitsu/issues/487)) ([e82cafa](https://github.com/wopian/kitsu/commit/e82cafa)) | ||
* **kitsu:** update devdependency [@size-limit](https://github.com/size-limit)/preset-small-lib to ~4.8.0 ([#493](https://github.com/wopian/kitsu/issues/493)) ([50cfe59](https://github.com/wopian/kitsu/commit/50cfe59)) | ||
* **kitsu:** update devdependency [@size-limit](https://github.com/size-limit)/preset-small-lib to ~4.9.0 ([#498](https://github.com/wopian/kitsu/issues/498)) ([68170d2](https://github.com/wopian/kitsu/commit/68170d2)) | ||
* drop node 10 support ([#484](https://github.com/wopian/kitsu/issues/484)) ([e34fcec](https://github.com/wopian/kitsu/commit/e34fcec)) | ||
@@ -65,3 +77,3 @@ | ||
* **release:** update documentation ([fe39500](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/fe39500)) | ||
* **release:** update documentation ([fe39500](https://github.com/wopian/kitsu/commit/fe39500)) | ||
@@ -71,6 +83,6 @@ | ||
* **kitsu:** add missing commas to quick start ([32ab682](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/32ab682)) | ||
* **kitsu:** update examples to 10.x ([0154200](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/0154200)) | ||
* **kitsu:** update quick start to 10.x ([e1b988c](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/e1b988c)) | ||
* fix markdown links again ([44689d1](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/44689d1)) | ||
* **kitsu:** add missing commas to quick start ([32ab682](https://github.com/wopian/kitsu/commit/32ab682)) | ||
* **kitsu:** update examples to 10.x ([0154200](https://github.com/wopian/kitsu/commit/0154200)) | ||
* **kitsu:** update quick start to 10.x ([e1b988c](https://github.com/wopian/kitsu/commit/e1b988c)) | ||
* fix markdown links again ([44689d1](https://github.com/wopian/kitsu/commit/44689d1)) | ||
@@ -82,3 +94,3 @@ | ||
# [10.0.0-alpha.7](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v10.0.0-alpha.6...v10.0.0-alpha.7) (2020-10-25) | ||
# [10.0.0-alpha.7](https://github.com/wopian/kitsu/compare/v10.0.0-alpha.6...v10.0.0-alpha.7) (2020-10-25) | ||
@@ -88,5 +100,5 @@ | ||
* **kitsu:** update dependency axios to ~0.21.0 ([#463](https://github.com/wopian/kitsu/tree/master/packages/kitsu/issues/463)) ([3f9f996](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/3f9f996)) | ||
* **kitsu:** update dependency merge-options to ^3.0.0 ([#464](https://github.com/wopian/kitsu/tree/master/packages/kitsu/issues/464)) ([b8d174e](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/b8d174e)) | ||
* **kitsu:** update devdependency [@size-limit](https://github.com/size-limit)/preset-small-lib to ~4.6.0 ([#469](https://github.com/wopian/kitsu/tree/master/packages/kitsu/issues/469)) ([e9d2feb](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/e9d2feb)) | ||
* **kitsu:** update dependency axios to ~0.21.0 ([#463](https://github.com/wopian/kitsu/issues/463)) ([3f9f996](https://github.com/wopian/kitsu/commit/3f9f996)) | ||
* **kitsu:** update dependency merge-options to ^3.0.0 ([#464](https://github.com/wopian/kitsu/issues/464)) ([b8d174e](https://github.com/wopian/kitsu/commit/b8d174e)) | ||
* **kitsu:** update devdependency [@size-limit](https://github.com/size-limit)/preset-small-lib to ~4.6.0 ([#469](https://github.com/wopian/kitsu/issues/469)) ([e9d2feb](https://github.com/wopian/kitsu/commit/e9d2feb)) | ||
@@ -96,3 +108,3 @@ | ||
* **release:** update documentation ([6d025ca](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/6d025ca)) | ||
* **release:** update documentation ([6d025ca](https://github.com/wopian/kitsu/commit/6d025ca)) | ||
@@ -103,3 +115,3 @@ | ||
# [10.0.0-alpha.6](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v10.0.0-alpha.5...v10.0.0-alpha.6) (2020-08-22) | ||
# [10.0.0-alpha.6](https://github.com/wopian/kitsu/compare/v10.0.0-alpha.5...v10.0.0-alpha.6) (2020-08-22) | ||
@@ -109,3 +121,3 @@ | ||
* **external:** pin axios to 0.19 to avoid breaking bug in 0.20 ([aa56def](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/aa56def)) | ||
* **external:** pin axios to 0.19 to avoid breaking bug in 0.20 ([aa56def](https://github.com/wopian/kitsu/commit/aa56def)) | ||
@@ -115,3 +127,3 @@ | ||
* **release:** update documentation ([e71b1dc](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/e71b1dc)) | ||
* **release:** update documentation ([e71b1dc](https://github.com/wopian/kitsu/commit/e71b1dc)) | ||
@@ -122,3 +134,3 @@ | ||
# [10.0.0-alpha.5](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v10.0.0-alpha.4...v10.0.0-alpha.5) (2020-08-04) | ||
# [10.0.0-alpha.5](https://github.com/wopian/kitsu/compare/v10.0.0-alpha.4...v10.0.0-alpha.5) (2020-08-04) | ||
@@ -128,3 +140,3 @@ | ||
* **release:** update documentation ([2f479c2](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/2f479c2)) | ||
* **release:** update documentation ([2f479c2](https://github.com/wopian/kitsu/commit/2f479c2)) | ||
@@ -134,3 +146,3 @@ | ||
* fix markdown links ([e29946a](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/e29946a)) | ||
* fix markdown links ([e29946a](https://github.com/wopian/kitsu/commit/e29946a)) | ||
@@ -141,3 +153,3 @@ | ||
# [10.0.0-alpha.4](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v10.0.0-alpha.3...v10.0.0-alpha.4) (2020-08-04) | ||
# [10.0.0-alpha.4](https://github.com/wopian/kitsu/compare/v10.0.0-alpha.3...v10.0.0-alpha.4) (2020-08-04) | ||
@@ -147,4 +159,4 @@ | ||
* **release:** update documentation ([56b33eb](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/56b33eb)) | ||
* add funding to package.json ([8b00d5a](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/8b00d5a)) | ||
* **release:** update documentation ([56b33eb](https://github.com/wopian/kitsu/commit/56b33eb)) | ||
* add funding to package.json ([8b00d5a](https://github.com/wopian/kitsu/commit/8b00d5a)) | ||
@@ -154,3 +166,3 @@ | ||
* **kitsu:** document the expected structure of the model parameters ([173277e](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/173277e)) | ||
* **kitsu:** document the expected structure of the model parameters ([173277e](https://github.com/wopian/kitsu/commit/173277e)) | ||
@@ -160,3 +172,3 @@ | ||
* add test case for camelCase relationships ([818f033](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/818f033)) | ||
* add test case for camelCase relationships ([818f033](https://github.com/wopian/kitsu/commit/818f033)) | ||
@@ -167,3 +179,3 @@ | ||
# [10.0.0-alpha.3](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v10.0.0-alpha.2...v10.0.0-alpha.3) (2020-07-26) | ||
# [10.0.0-alpha.3](https://github.com/wopian/kitsu/compare/v10.0.0-alpha.2...v10.0.0-alpha.3) (2020-07-26) | ||
@@ -173,3 +185,3 @@ | ||
* **release:** update documentation ([f89a7cf](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/f89a7cf)) | ||
* **release:** update documentation ([f89a7cf](https://github.com/wopian/kitsu/commit/f89a7cf)) | ||
@@ -179,3 +191,3 @@ | ||
* add typescript types badges ([3a09066](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/3a09066)) | ||
* add typescript types badges ([3a09066](https://github.com/wopian/kitsu/commit/3a09066)) | ||
@@ -185,3 +197,3 @@ | ||
* run tests in both node and jsdom environments ([a383794](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/a383794)) | ||
* run tests in both node and jsdom environments ([a383794](https://github.com/wopian/kitsu/commit/a383794)) | ||
@@ -192,3 +204,3 @@ | ||
# [10.0.0-alpha.2](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v10.0.0-alpha.1...v10.0.0-alpha.2) (2020-07-16) | ||
# [10.0.0-alpha.2](https://github.com/wopian/kitsu/compare/v10.0.0-alpha.1...v10.0.0-alpha.2) (2020-07-16) | ||
@@ -198,3 +210,3 @@ | ||
* **release:** update documentation ([699bb64](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/699bb64)) | ||
* **release:** update documentation ([699bb64](https://github.com/wopian/kitsu/commit/699bb64)) | ||
@@ -204,3 +216,3 @@ | ||
* move contributing, releases and license above api documentation ([b0de3ab](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/b0de3ab)) | ||
* move contributing, releases and license above api documentation ([b0de3ab](https://github.com/wopian/kitsu/commit/b0de3ab)) | ||
@@ -211,3 +223,3 @@ | ||
# [10.0.0-alpha.1](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v10.0.0-alpha.0...v10.0.0-alpha.1) (2020-06-15) | ||
# [10.0.0-alpha.1](https://github.com/wopian/kitsu/compare/v10.0.0-alpha.0...v10.0.0-alpha.1) (2020-06-15) | ||
@@ -217,4 +229,4 @@ | ||
* **release:** update documentation ([1b1f6d6](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/1b1f6d6)) | ||
* **release:** update documentation ([883512b](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/883512b)) | ||
* **release:** update documentation ([1b1f6d6](https://github.com/wopian/kitsu/commit/1b1f6d6)) | ||
* **release:** update documentation ([883512b](https://github.com/wopian/kitsu/commit/883512b)) | ||
@@ -224,3 +236,3 @@ | ||
* **kitsu:** fix typo in migration guide ([af5ac6b](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/af5ac6b)) | ||
* **kitsu:** fix typo in migration guide ([af5ac6b](https://github.com/wopian/kitsu/commit/af5ac6b)) | ||
@@ -231,3 +243,3 @@ | ||
# [10.0.0-alpha.0](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.1.11...v10.0.0-alpha.0) (2020-06-15) | ||
# [10.0.0-alpha.0](https://github.com/wopian/kitsu/compare/v9.1.11...v10.0.0-alpha.0) (2020-06-15) | ||
@@ -237,3 +249,3 @@ | ||
* **release:** update documentation ([da50d92](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/da50d92)) | ||
* **release:** update documentation ([da50d92](https://github.com/wopian/kitsu/commit/da50d92)) | ||
@@ -243,4 +255,4 @@ | ||
* update READMEs ([469d23a](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/469d23a)) | ||
* **kitsu:** add v10 migration guide ([eb79c78](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/eb79c78)) | ||
* update READMEs ([469d23a](https://github.com/wopian/kitsu/commit/469d23a)) | ||
* **kitsu:** add v10 migration guide ([eb79c78](https://github.com/wopian/kitsu/commit/eb79c78)) | ||
@@ -250,5 +262,5 @@ | ||
* **kitsu:** delete - add param parameter ([85a192b](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/85a192b)) | ||
* **kitsu:** patch - add params parameter ([8d8eda3](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/8d8eda3)) | ||
* **kitsu:** post - add params parameter ([13686be](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/13686be)) | ||
* **kitsu:** delete - add param parameter ([85a192b](https://github.com/wopian/kitsu/commit/85a192b)) | ||
* **kitsu:** patch - add params parameter ([8d8eda3](https://github.com/wopian/kitsu/commit/8d8eda3)) | ||
* **kitsu:** post - add params parameter ([13686be](https://github.com/wopian/kitsu/commit/13686be)) | ||
@@ -258,7 +270,7 @@ | ||
* **kitsu:** merge params and headers parameters into a single config object ([f98eef9](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/f98eef9)) | ||
* **kitsu:** request - move headers into config object ([85937c4](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/85937c4)) | ||
* **kitsu:** self - move params and headers into a config object ([c55949a](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/c55949a)) | ||
* **kitsu:** use merge-options instead of Object.assign ([8b49cc1](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/8b49cc1)) | ||
* **kitsu:** use merge-options instead of Object.assign for class constructor options ([9a162a0](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/9a162a0)) | ||
* **kitsu:** merge params and headers parameters into a single config object ([f98eef9](https://github.com/wopian/kitsu/commit/f98eef9)) | ||
* **kitsu:** request - move headers into config object ([85937c4](https://github.com/wopian/kitsu/commit/85937c4)) | ||
* **kitsu:** self - move params and headers into a config object ([c55949a](https://github.com/wopian/kitsu/commit/c55949a)) | ||
* **kitsu:** use merge-options instead of Object.assign ([8b49cc1](https://github.com/wopian/kitsu/commit/8b49cc1)) | ||
* **kitsu:** use merge-options instead of Object.assign for class constructor options ([9a162a0](https://github.com/wopian/kitsu/commit/9a162a0)) | ||
@@ -269,3 +281,3 @@ | ||
## [9.1.11](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.1.10...v9.1.11) (2020-06-14) | ||
## [9.1.11](https://github.com/wopian/kitsu/compare/v9.1.10...v9.1.11) (2020-06-14) | ||
@@ -275,3 +287,3 @@ | ||
* **kitsu:** use ID-less URL for bulk extension in PATCH requests ([2c31d42](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/2c31d42)) | ||
* **kitsu:** use ID-less URL for bulk extension in PATCH requests ([2c31d42](https://github.com/wopian/kitsu/commit/2c31d42)) | ||
@@ -281,3 +293,3 @@ | ||
* **release:** update documentation ([ba00f68](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/ba00f68)) | ||
* **release:** update documentation ([ba00f68](https://github.com/wopian/kitsu/commit/ba00f68)) | ||
@@ -287,3 +299,3 @@ | ||
* Update README.md ([6266c30](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/6266c30)) | ||
* Update README.md ([6266c30](https://github.com/wopian/kitsu/commit/6266c30)) | ||
@@ -293,3 +305,3 @@ | ||
* **kitsu:** re-add bulk test ([3fcd884](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/3fcd884)) | ||
* **kitsu:** re-add bulk test ([3fcd884](https://github.com/wopian/kitsu/commit/3fcd884)) | ||
@@ -300,3 +312,3 @@ | ||
## [9.1.10](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.1.9...v9.1.10) (2020-05-31) | ||
## [9.1.10](https://github.com/wopian/kitsu/compare/v9.1.9...v9.1.10) (2020-05-31) | ||
@@ -306,3 +318,3 @@ | ||
* **release:** update documentation ([3817edc](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/3817edc)) | ||
* **release:** update documentation ([3817edc](https://github.com/wopian/kitsu/commit/3817edc)) | ||
@@ -312,3 +324,3 @@ | ||
* fix spacing in description ([8811add](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/8811add)) | ||
* fix spacing in description ([8811add](https://github.com/wopian/kitsu/commit/8811add)) | ||
@@ -319,3 +331,3 @@ | ||
## [9.1.9](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.1.8...v9.1.9) (2020-05-31) | ||
## [9.1.9](https://github.com/wopian/kitsu/compare/v9.1.8...v9.1.9) (2020-05-31) | ||
@@ -325,3 +337,3 @@ | ||
* **release:** update documentation ([220ad78](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/220ad78)) | ||
* **release:** update documentation ([220ad78](https://github.com/wopian/kitsu/commit/220ad78)) | ||
@@ -331,3 +343,3 @@ | ||
* fix size limit ([10fa5a1](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/10fa5a1)) | ||
* fix size limit ([10fa5a1](https://github.com/wopian/kitsu/commit/10fa5a1)) | ||
@@ -337,3 +349,3 @@ | ||
* update package descriptions ([29b8693](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/29b8693)) | ||
* update package descriptions ([29b8693](https://github.com/wopian/kitsu/commit/29b8693)) | ||
@@ -344,3 +356,3 @@ | ||
## [9.1.8](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.1.7...v9.1.8) (2020-05-28) | ||
## [9.1.8](https://github.com/wopian/kitsu/compare/v9.1.7...v9.1.8) (2020-05-28) | ||
@@ -350,4 +362,4 @@ | ||
* add export paths with .js and .mjs for Node 13.1/14 exports field ([a8a06dd](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/a8a06dd)) | ||
* remove replace-in-file rewriting module import ([cbdc45e](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/cbdc45e)) | ||
* add export paths with .js and .mjs for Node 13.1/14 exports field ([a8a06dd](https://github.com/wopian/kitsu/commit/a8a06dd)) | ||
* remove replace-in-file rewriting module import ([cbdc45e](https://github.com/wopian/kitsu/commit/cbdc45e)) | ||
@@ -357,4 +369,4 @@ | ||
* **release:** update documentation ([fa0cdd8](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/fa0cdd8)) | ||
* **release:** update documentation ([ce00974](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/ce00974)) | ||
* **release:** update documentation ([fa0cdd8](https://github.com/wopian/kitsu/commit/fa0cdd8)) | ||
* **release:** update documentation ([ce00974](https://github.com/wopian/kitsu/commit/ce00974)) | ||
@@ -365,3 +377,3 @@ | ||
## [9.1.7](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.1.6...v9.1.7) (2020-05-28) | ||
## [9.1.7](https://github.com/wopian/kitsu/compare/v9.1.6...v9.1.7) (2020-05-28) | ||
@@ -371,3 +383,3 @@ | ||
* use Node 13.1/14 exports field in package.json ([0a4692a](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/0a4692a)) | ||
* use Node 13.1/14 exports field in package.json ([0a4692a](https://github.com/wopian/kitsu/commit/0a4692a)) | ||
@@ -377,3 +389,3 @@ | ||
* **release:** update documentation ([8424d78](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/8424d78)) | ||
* **release:** update documentation ([8424d78](https://github.com/wopian/kitsu/commit/8424d78)) | ||
@@ -384,3 +396,3 @@ | ||
## [9.1.6](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.1.5...v9.1.6) (2020-05-21) | ||
## [9.1.6](https://github.com/wopian/kitsu/compare/v9.1.5...v9.1.6) (2020-05-21) | ||
@@ -390,3 +402,3 @@ | ||
* **release:** update documentation ([dca0f14](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/dca0f14)) | ||
* **release:** update documentation ([dca0f14](https://github.com/wopian/kitsu/commit/dca0f14)) | ||
@@ -396,3 +408,3 @@ | ||
* **npm:** ignore yarn log files ([297d1ef](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/297d1ef)) | ||
* **npm:** ignore yarn log files ([297d1ef](https://github.com/wopian/kitsu/commit/297d1ef)) | ||
@@ -403,3 +415,3 @@ | ||
## [9.1.5](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.1.4...v9.1.5) (2020-05-21) | ||
## [9.1.5](https://github.com/wopian/kitsu/compare/v9.1.4...v9.1.5) (2020-05-21) | ||
@@ -409,3 +421,3 @@ | ||
* **release:** update documentation ([912f59d](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/912f59d)) | ||
* **release:** update documentation ([912f59d](https://github.com/wopian/kitsu/commit/912f59d)) | ||
@@ -415,3 +427,3 @@ | ||
* update sizelimit warning ([11959bf](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/11959bf)) | ||
* update sizelimit warning ([11959bf](https://github.com/wopian/kitsu/commit/11959bf)) | ||
@@ -422,3 +434,3 @@ | ||
## [9.1.4](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.1.3...v9.1.4) (2020-05-21) | ||
## [9.1.4](https://github.com/wopian/kitsu/compare/v9.1.3...v9.1.4) (2020-05-21) | ||
@@ -428,4 +440,4 @@ | ||
* **release:** update documentation ([c2b9e13](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/c2b9e13)) | ||
* **release:** update documentation ([e8b37f1](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/e8b37f1)) | ||
* **release:** update documentation ([c2b9e13](https://github.com/wopian/kitsu/commit/c2b9e13)) | ||
* **release:** update documentation ([e8b37f1](https://github.com/wopian/kitsu/commit/e8b37f1)) | ||
@@ -435,4 +447,4 @@ | ||
* **kitsu:** document 1.0/1.1/Extensions pagination strategies ([b54ede6](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/b54ede6)) | ||
* **kitsu:** enumerate resourceCase string values ([52c1c82](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/52c1c82)) | ||
* **kitsu:** document 1.0/1.1/Extensions pagination strategies ([b54ede6](https://github.com/wopian/kitsu/commit/b54ede6)) | ||
* **kitsu:** enumerate resourceCase string values ([52c1c82](https://github.com/wopian/kitsu/commit/52c1c82)) | ||
@@ -443,3 +455,3 @@ | ||
## [9.1.3](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.1.2...v9.1.3) (2020-05-21) | ||
## [9.1.3](https://github.com/wopian/kitsu/compare/v9.1.2...v9.1.3) (2020-05-21) | ||
@@ -449,3 +461,3 @@ | ||
* **release:** update documentation ([de730f2](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/de730f2)) | ||
* **release:** update documentation ([de730f2](https://github.com/wopian/kitsu/commit/de730f2)) | ||
@@ -455,3 +467,3 @@ | ||
* **kitsu:** add clearing of to-one/to-many relationships to api.patch examples ([113e60f](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/113e60f)) | ||
* **kitsu:** add clearing of to-one/to-many relationships to api.patch examples ([113e60f](https://github.com/wopian/kitsu/commit/113e60f)) | ||
@@ -462,3 +474,3 @@ | ||
## [9.1.2](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.1.1...v9.1.2) (2020-05-21) | ||
## [9.1.2](https://github.com/wopian/kitsu/compare/v9.1.1...v9.1.2) (2020-05-21) | ||
@@ -468,3 +480,3 @@ | ||
* **release:** update documentation ([20e7cc6](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/20e7cc6)) | ||
* **release:** update documentation ([20e7cc6](https://github.com/wopian/kitsu/commit/20e7cc6)) | ||
@@ -474,5 +486,5 @@ | ||
* **kitsu:** declare optional parameters in JSDoc syntax ([95eb9c1](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/95eb9c1)) | ||
* autogenerate typescript definitions ([6e1879f](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/6e1879f)) | ||
* update JSDoc Array syntax for better TypeScript usability ([8f147ab](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/8f147ab)) | ||
* **kitsu:** declare optional parameters in JSDoc syntax ([95eb9c1](https://github.com/wopian/kitsu/commit/95eb9c1)) | ||
* autogenerate typescript definitions ([6e1879f](https://github.com/wopian/kitsu/commit/6e1879f)) | ||
* update JSDoc Array syntax for better TypeScript usability ([8f147ab](https://github.com/wopian/kitsu/commit/8f147ab)) | ||
@@ -483,3 +495,3 @@ | ||
## [9.1.1](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.1.0...v9.1.1) (2020-05-21) | ||
## [9.1.1](https://github.com/wopian/kitsu/compare/v9.1.0...v9.1.1) (2020-05-21) | ||
@@ -489,3 +501,3 @@ | ||
* **kitsu-core:** throw error if type is missing during serialisation ([570ef11](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/570ef11)) | ||
* **kitsu-core:** throw error if type is missing during serialisation ([570ef11](https://github.com/wopian/kitsu/commit/570ef11)) | ||
@@ -495,3 +507,3 @@ | ||
* **release:** update documentation ([1c19a06](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/1c19a06)) | ||
* **release:** update documentation ([1c19a06](https://github.com/wopian/kitsu/commit/1c19a06)) | ||
@@ -502,3 +514,3 @@ | ||
# [9.1.0](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.0.7...v9.1.0) (2020-05-21) | ||
# [9.1.0](https://github.com/wopian/kitsu/compare/v9.0.7...v9.1.0) (2020-05-21) | ||
@@ -508,4 +520,4 @@ | ||
* **release:** update documentation ([d77384c](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/d77384c)) | ||
* increase package warning limit ([c0136dc](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/c0136dc)) | ||
* **release:** update documentation ([d77384c](https://github.com/wopian/kitsu/commit/d77384c)) | ||
* increase package warning limit ([c0136dc](https://github.com/wopian/kitsu/commit/c0136dc)) | ||
@@ -515,4 +527,4 @@ | ||
* correct errors in types ([9ad8fc0](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/9ad8fc0)) | ||
* **kitsu:** document usage of the bulk extension ([e37b7ad](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/e37b7ad)) | ||
* correct errors in types ([9ad8fc0](https://github.com/wopian/kitsu/commit/9ad8fc0)) | ||
* **kitsu:** document usage of the bulk extension ([e37b7ad](https://github.com/wopian/kitsu/commit/e37b7ad)) | ||
@@ -522,4 +534,4 @@ | ||
* **kitsu:** support arbitrary requests ([e8aacc5](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/e8aacc5)) | ||
* **kitsu:** support the bulk extension specification ([f793988](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/f793988)), closes [#336](https://github.com/wopian/kitsu/tree/master/packages/kitsu/issues/336) | ||
* **kitsu:** support arbitrary requests ([e8aacc5](https://github.com/wopian/kitsu/commit/e8aacc5)) | ||
* **kitsu:** support the bulk extension specification ([f793988](https://github.com/wopian/kitsu/commit/f793988)), closes [#336](https://github.com/wopian/kitsu/issues/336) | ||
@@ -530,3 +542,3 @@ | ||
## [9.0.7](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.0.6...v9.0.7) (2020-05-19) | ||
## [9.0.7](https://github.com/wopian/kitsu/compare/v9.0.6...v9.0.7) (2020-05-19) | ||
@@ -536,3 +548,3 @@ | ||
* **release:** update documentation ([523553e](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/523553e)) | ||
* **release:** update documentation ([523553e](https://github.com/wopian/kitsu/commit/523553e)) | ||
@@ -542,3 +554,3 @@ | ||
* **kitsu:** link to axios docs for axiosOptions and interceptors ([b678290](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/b678290)) | ||
* **kitsu:** link to axios docs for axiosOptions and interceptors ([b678290](https://github.com/wopian/kitsu/commit/b678290)) | ||
@@ -548,3 +560,3 @@ | ||
* Update MIGRATING.md ([c2fb17e](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/c2fb17e)) | ||
* Update MIGRATING.md ([c2fb17e](https://github.com/wopian/kitsu/commit/c2fb17e)) | ||
@@ -555,3 +567,3 @@ | ||
## [9.0.6](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.0.5...v9.0.6) (2020-05-07) | ||
## [9.0.6](https://github.com/wopian/kitsu/compare/v9.0.5...v9.0.6) (2020-05-07) | ||
@@ -561,3 +573,3 @@ | ||
* **release:** update documentation ([03fc40e](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/03fc40e)) | ||
* **release:** update documentation ([03fc40e](https://github.com/wopian/kitsu/commit/03fc40e)) | ||
@@ -567,7 +579,7 @@ | ||
* **kitsu:** add alias for delete to Quick Start in README ([c9ba1b6](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/c9ba1b6)) | ||
* **kitsu:** fix URL to more examples ([d3d46ce](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/d3d46ce)) | ||
* **kitsu:** remove node 12 notice ([6540e39](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/6540e39)) | ||
* **kitsu:** remove unused URL from README ([bafbeeb](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/bafbeeb)) | ||
* **kitsu:** update Quick Start in README ([f49064b](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/f49064b)) | ||
* **kitsu:** add alias for delete to Quick Start in README ([c9ba1b6](https://github.com/wopian/kitsu/commit/c9ba1b6)) | ||
* **kitsu:** fix URL to more examples ([d3d46ce](https://github.com/wopian/kitsu/commit/d3d46ce)) | ||
* **kitsu:** remove node 12 notice ([6540e39](https://github.com/wopian/kitsu/commit/6540e39)) | ||
* **kitsu:** remove unused URL from README ([bafbeeb](https://github.com/wopian/kitsu/commit/bafbeeb)) | ||
* **kitsu:** update Quick Start in README ([f49064b](https://github.com/wopian/kitsu/commit/f49064b)) | ||
@@ -578,3 +590,3 @@ | ||
## [9.0.5](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.0.4...v9.0.5) (2020-05-07) | ||
## [9.0.5](https://github.com/wopian/kitsu/compare/v9.0.4...v9.0.5) (2020-05-07) | ||
@@ -584,4 +596,4 @@ | ||
* **release:** update documentation ([2df72e7](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/2df72e7)) | ||
* trim CHANGELOG length ([af7db19](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/af7db19)) | ||
* **release:** update documentation ([2df72e7](https://github.com/wopian/kitsu/commit/2df72e7)) | ||
* trim CHANGELOG length ([af7db19](https://github.com/wopian/kitsu/commit/af7db19)) | ||
@@ -592,3 +604,3 @@ | ||
## [9.0.4](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.0.3...v9.0.4) (2020-05-07) | ||
## [9.0.4](https://github.com/wopian/kitsu/compare/v9.0.3...v9.0.4) (2020-05-07) | ||
@@ -598,3 +610,3 @@ | ||
* **release:** update documentation ([9561c63](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/9561c63)) | ||
* **release:** update documentation ([9561c63](https://github.com/wopian/kitsu/commit/9561c63)) | ||
@@ -605,3 +617,3 @@ | ||
## [9.0.3](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.0.2...v9.0.3) (2020-05-07) | ||
## [9.0.3](https://github.com/wopian/kitsu/compare/v9.0.2...v9.0.3) (2020-05-07) | ||
@@ -611,3 +623,3 @@ | ||
* **release:** update documentation ([95c3fbb](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/95c3fbb)) | ||
* **release:** update documentation ([95c3fbb](https://github.com/wopian/kitsu/commit/95c3fbb)) | ||
@@ -617,3 +629,3 @@ | ||
* **kitsu:** add JSON:API query parameters to Quick Start ([a5c501a](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/a5c501a)) | ||
* **kitsu:** add JSON:API query parameters to Quick Start ([a5c501a](https://github.com/wopian/kitsu/commit/a5c501a)) | ||
@@ -624,3 +636,3 @@ | ||
## [9.0.2](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.0.1...v9.0.2) (2020-05-07) | ||
## [9.0.2](https://github.com/wopian/kitsu/compare/v9.0.1...v9.0.2) (2020-05-07) | ||
@@ -630,3 +642,3 @@ | ||
* **release:** update documentation ([84d00c5](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/84d00c5)) | ||
* **release:** update documentation ([84d00c5](https://github.com/wopian/kitsu/commit/84d00c5)) | ||
@@ -637,3 +649,3 @@ | ||
## [9.0.1](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.0.0...v9.0.1) (2020-05-07) | ||
## [9.0.1](https://github.com/wopian/kitsu/compare/v9.0.0...v9.0.1) (2020-05-07) | ||
@@ -643,3 +655,3 @@ | ||
* **release:** update documentation ([03ec026](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/03ec026)) | ||
* **release:** update documentation ([03ec026](https://github.com/wopian/kitsu/commit/03ec026)) | ||
@@ -649,3 +661,3 @@ | ||
* **kitsu:** add migration guide link to README ([e434df2](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/e434df2)) | ||
* **kitsu:** add migration guide link to README ([e434df2](https://github.com/wopian/kitsu/commit/e434df2)) | ||
@@ -656,3 +668,3 @@ | ||
# [9.0.0](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v8.3.1...v9.0.0) (2020-05-07) | ||
# [9.0.0](https://github.com/wopian/kitsu/compare/v8.3.1...v9.0.0) (2020-05-07) | ||
@@ -662,3 +674,3 @@ | ||
* **kitsu:** update devdependency [@size-limit](https://github.com/size-limit)/preset-small-lib to ~4.5.0 ([#405](https://github.com/wopian/kitsu/tree/master/packages/kitsu/issues/405)) ([7e0072d](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/7e0072d)) | ||
* **kitsu:** update devdependency [@size-limit](https://github.com/size-limit)/preset-small-lib to ~4.5.0 ([#405](https://github.com/wopian/kitsu/issues/405)) ([7e0072d](https://github.com/wopian/kitsu/commit/7e0072d)) | ||
@@ -668,3 +680,3 @@ | ||
* **release:** update documentation ([08362a8](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/08362a8)) | ||
* **release:** update documentation ([08362a8](https://github.com/wopian/kitsu/commit/08362a8)) | ||
@@ -674,4 +686,4 @@ | ||
* **kitsu:** add 9.0.0 migration guide ([8f899c5](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/8f899c5)) | ||
* update README ([6a73433](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/6a73433)) | ||
* **kitsu:** add 9.0.0 migration guide ([8f899c5](https://github.com/wopian/kitsu/commit/8f899c5)) | ||
* update README ([6a73433](https://github.com/wopian/kitsu/commit/6a73433)) | ||
@@ -681,3 +693,3 @@ | ||
* **kitsu:** handle nested (relationship) routes using kitsu-core's splitModel ([4f641b9](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/4f641b9)) | ||
* **kitsu:** handle nested (relationship) routes using kitsu-core's splitModel ([4f641b9](https://github.com/wopian/kitsu/commit/4f641b9)) | ||
@@ -687,2 +699,2 @@ | ||
* **kitsu:** (internal) pass camel and plural options as arguments to serialise ([046b51a](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/046b51a)) | ||
* **kitsu:** (internal) pass camel and plural options as arguments to serialise ([046b51a](https://github.com/wopian/kitsu/commit/046b51a)) |
@@ -1,1 +0,1 @@ | ||
"use strict";var e=require("kitsu-core"),a=require("axios"),s=require("merge-options"),r=require("pluralize");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=t(a),l=t(s),h=t(r);module.exports=class{constructor(a={}){!1===a.camelCaseTypes?this.camel=e=>e:this.camel=e.camel,"none"===a.resourceCase?this.resCase=e=>e:"snake"===a.resourceCase?this.resCase=e.snake:this.resCase=e.kebab,!1===a.pluralize?this.plural=e=>e:this.plural=h.default,this.headers=l.default({Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json"},a.headers),this.axios=i.default.create(l.default({baseURL:a.baseURL||"https://kitsu.io/api/edge",timeout:a.timeout||3e4},a.axiosOptions)),this.fetch=this.get,this.update=this.patch,this.create=this.post,this.remove=this.delete,this.interceptors=this.axios.interceptors}async get(a,s={}){try{const r=l.default(this.headers,s.headers),t=l.default({},s.params),[i,h,o]=a.split("/");let p=this.plural(this.resCase(i));h&&(p+="/".concat(h)),o&&(p+="/".concat(this.resCase(o)));const{data:c}=await this.axios.get(p,{headers:r,params:t,paramsSerializer:a=>e.query(a)});return e.deserialise(c)}catch(a){throw e.error(a)}}async patch(a,s,r={}){try{const t=l.default(this.headers,r.headers),i=l.default({},r.params),[h,o]=e.splitModel(a,{resourceCase:this.resCase,pluralModel:this.plural}),p=e.serialise(h,s,"PATCH",{camelCaseTypes:this.camel,pluralTypes:this.plural}),c=null!=s&&s.id?"".concat(o,"/").concat(s.id):o,{data:d}=await this.axios.patch(c,p,{headers:t,params:i,paramsSerializer:a=>e.query(a)});return e.deserialise(d)}catch(a){throw e.error(a)}}async post(a,s,r={}){try{const t=l.default(this.headers,r.headers),i=l.default({},r.params),[h,o]=e.splitModel(a,{resourceCase:this.resCase,pluralModel:this.plural}),{data:p}=await this.axios.post(o,e.serialise(h,s,"POST",{camelCaseTypes:this.camel,pluralTypes:this.plural}),{headers:t,params:i,paramsSerializer:a=>e.query(a)});return e.deserialise(p)}catch(a){throw e.error(a)}}async delete(a,s,r={}){try{const t=l.default(this.headers,r.headers),i=l.default({},r.params),[h,o]=e.splitModel(a,{resourceCase:this.resCase,pluralModel:this.plural});let p,c;Array.isArray(s)?(p=o,c=s.map((e=>({id:e})))):(p="".concat(o,"/").concat(s),c={id:s});const{data:d}=await this.axios.delete(p,{data:e.serialise(h,c,"DELETE",{camelCaseTypes:this.camel,pluralTypes:this.plural}),headers:t,params:i,paramsSerializer:a=>e.query(a)});return d}catch(a){throw e.error(a)}}async self(a={}){try{const e=l.default(this.headers,a.headers),s=l.default(a.params,{filter:{self:!0}});return(await this.get("users",l.default({headers:e},{params:s}))).data[0]}catch(a){throw e.error(a)}}async request({body:a,method:s,params:r,type:t,url:i,headers:h}){try{var o;s=(null===(o=s)||void 0===o?void 0:o.toUpperCase())||"GET";const{data:p}=await this.axios.request({method:s,url:i,data:["GET","DELETE"].includes(s)?void 0:e.serialise(t,a,s,{camelCaseTypes:this.camel,pluralTypes:this.plural}),headers:l.default(this.headers,h),params:r,paramsSerializer:a=>e.query(a)});return e.deserialise(p)}catch(a){throw e.error(a)}}}; | ||
"use strict";var e=require("kitsu-core"),a=require("axios"),s=require("merge-options"),r=require("pluralize");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=t(a),l=t(s),h=t(r);module.exports=class{constructor(a={}){!1===a.camelCaseTypes?this.camel=e=>e:this.camel=e.camel,"none"===a.resourceCase?this.resCase=e=>e:"snake"===a.resourceCase?this.resCase=e.snake:this.resCase=e.kebab,!1===a.pluralize?this.plural=e=>e:this.plural=h.default,this.headers=l.default({Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json"},a.headers),this.axios=i.default.create(l.default({baseURL:a.baseURL||"https://kitsu.io/api/edge",timeout:a.timeout||3e4},a.axiosOptions)),this.fetch=this.get,this.update=this.patch,this.create=this.post,this.remove=this.delete,this.interceptors=this.axios.interceptors}async get(a,s={}){try{const r=l.default(this.headers,s.headers),t=l.default({},s.params),[i,h,p,d]=a.split("/");let u=this.plural(this.resCase(i));h&&(u+=`/${h}`),p&&(u+=`/${this.resCase(p)}`),d&&(u+=`/${this.resCase(d)}`);const{data:o}=await this.axios.get(u,{headers:r,params:t,paramsSerializer:a=>e.query(a)});return e.deserialise(o)}catch(a){throw e.error(a)}}async patch(a,s,r={}){try{const t=l.default(this.headers,r.headers),i=l.default({},r.params),[h,p]=e.splitModel(a,{resourceCase:this.resCase,pluralModel:this.plural}),d=e.serialise(h,s,"PATCH",{camelCaseTypes:this.camel,pluralTypes:this.plural}),u=null!=s&&s.id?`${p}/${s.id}`:p,{data:o}=await this.axios.patch(u,d,{headers:t,params:i,paramsSerializer:a=>e.query(a)});return e.deserialise(o)}catch(a){throw e.error(a)}}async post(a,s,r={}){try{const t=l.default(this.headers,r.headers),i=l.default({},r.params),[h,p]=e.splitModel(a,{resourceCase:this.resCase,pluralModel:this.plural}),{data:d}=await this.axios.post(p,e.serialise(h,s,"POST",{camelCaseTypes:this.camel,pluralTypes:this.plural}),{headers:t,params:i,paramsSerializer:a=>e.query(a)});return e.deserialise(d)}catch(a){throw e.error(a)}}async delete(a,s,r={}){try{const t=l.default(this.headers,r.headers),i=l.default({},r.params),[h,p]=e.splitModel(a,{resourceCase:this.resCase,pluralModel:this.plural});let d,u;Array.isArray(s)?(d=p,u=s.map((e=>({id:e})))):(d=`${p}/${s}`,u={id:s});const{data:o}=await this.axios.delete(d,{data:e.serialise(h,u,"DELETE",{camelCaseTypes:this.camel,pluralTypes:this.plural}),headers:t,params:i,paramsSerializer:a=>e.query(a)});return o}catch(a){throw e.error(a)}}async self(a={}){try{const e=l.default(this.headers,a.headers),s=l.default(a.params,{filter:{self:!0}});return(await this.get("users",l.default({headers:e},{params:s}))).data[0]}catch(a){throw e.error(a)}}async request({body:a,method:s,params:r,type:t,url:i,headers:h}){try{var p;s=(null===(p=s)||void 0===p?void 0:p.toUpperCase())||"GET";const{data:d}=await this.axios.request({method:s,url:i,data:["GET","DELETE"].includes(s)?void 0:e.serialise(t,a,s,{camelCaseTypes:this.camel,pluralTypes:this.plural}),headers:l.default(this.headers,h),params:r,paramsSerializer:a=>e.query(a)});return e.deserialise(d)}catch(a){throw e.error(a)}}}; |
{ | ||
"version": "10.0.0-alpha.10", | ||
"version": "10.0.0-alpha.11", | ||
"name": "kitsu", | ||
@@ -18,3 +18,3 @@ "description": "A simple, lightweight & framework agnostic JSON:API client using Axios", | ||
"homepage": "https://github.com/wopian/kitsu/tree/master/packages/kitsu#readme", | ||
"repository": "https://github.com/wopian/kitsu/tree/master/packages/kitsu", | ||
"repository": "https://github.com/wopian/kitsu", | ||
"bugs": { | ||
@@ -54,3 +54,3 @@ "url": "https://github.com/wopian/kitsu/issues" | ||
"axios": "^0.21.1", | ||
"kitsu-core": "^10.0.0-alpha.10", | ||
"kitsu-core": "^10.0.0-alpha.11", | ||
"merge-options": "^3.0.0", | ||
@@ -71,5 +71,5 @@ "pluralize": "^8.0.0" | ||
], | ||
"gitHead": "0951b65f0636a48e8318c837c330c9303e29ffa6", | ||
"gitHead": "394139c9b249b0453977460d9fc2783e16c133f4", | ||
"devDependencies": { | ||
"@size-limit/preset-small-lib": "~4.9.0" | ||
"@size-limit/preset-small-lib": "~4.11.0" | ||
}, | ||
@@ -76,0 +76,0 @@ "exports": { |
248
README.md
@@ -27,10 +27,10 @@ <h1 align=center>Kitsu</h1> | ||
# | ||
# | ||
## Features | ||
- JSON-API 1.0 compliant | ||
- Automatically links relationships to data | ||
- Works in Node & browsers | ||
- Uses the [Promise] API | ||
* JSON-API 1.0 compliant | ||
* Automatically links relationships to data | ||
* Works in Node & browsers | ||
* Uses the \[Promise] API | ||
@@ -120,11 +120,11 @@ ## Node / Browser Support | ||
See [CONTRIBUTING] | ||
See \[CONTRIBUTING] | ||
## Releases | ||
See [CHANGELOG] | ||
See \[CHANGELOG] | ||
## License | ||
All code released under [MIT] | ||
All code released under \[MIT] | ||
@@ -189,5 +189,5 @@ ## Quick Start | ||
[More Examples] | ||
\[More Examples] | ||
If you're working with [Kitsu.io]'s API, their [API docs][kitsu.io api docs] lists all available resources with their attributes & relationships | ||
If you're working with \[Kitsu.io]'s API, their \[API docs]\[kitsu.io api docs] lists all available resources with their attributes & relationships | ||
@@ -200,33 +200,33 @@ ## API | ||
- [Kitsu](#kitsu) | ||
- [Parameters](#parameters) | ||
- [Examples](#examples) | ||
- [plural](#plural) | ||
- [Examples](#examples-1) | ||
- [headers](#headers) | ||
- [Examples](#examples-2) | ||
- [interceptors](#interceptors) | ||
- [Examples](#examples-3) | ||
- [get](#get) | ||
- [Parameters](#parameters-1) | ||
- [Examples](#examples-4) | ||
- [patch](#patch) | ||
- [Parameters](#parameters-2) | ||
- [Examples](#examples-5) | ||
- [post](#post) | ||
- [Parameters](#parameters-3) | ||
- [Examples](#examples-6) | ||
- [delete](#delete) | ||
- [Parameters](#parameters-4) | ||
- [Examples](#examples-7) | ||
- [self](#self) | ||
- [Parameters](#parameters-5) | ||
- [Examples](#examples-8) | ||
- [request](#request) | ||
- [Parameters](#parameters-6) | ||
- [Examples](#examples-9) | ||
* [Kitsu](#kitsu) | ||
* [Parameters](#parameters) | ||
* [Examples](#examples) | ||
* [plural](#plural) | ||
* [Examples](#examples-1) | ||
* [headers](#headers) | ||
* [Examples](#examples-2) | ||
* [interceptors](#interceptors) | ||
* [Examples](#examples-3) | ||
* [get](#get) | ||
* [Parameters](#parameters-1) | ||
* [Examples](#examples-4) | ||
* [patch](#patch) | ||
* [Parameters](#parameters-2) | ||
* [Examples](#examples-5) | ||
* [post](#post) | ||
* [Parameters](#parameters-3) | ||
* [Examples](#examples-6) | ||
* [delete](#delete) | ||
* [Parameters](#parameters-4) | ||
* [Examples](#examples-7) | ||
* [self](#self) | ||
* [Parameters](#parameters-5) | ||
* [Examples](#examples-8) | ||
* [request](#request) | ||
* [Parameters](#parameters-6) | ||
* [Examples](#examples-9) | ||
### Kitsu | ||
[packages/kitsu/src/index.js:31-503](https://github.com/wopian/kitsu/blob/8a7d453339bbd80393c63cad5ae6fc758fb0eb4e/packages/kitsu/src/index.js#L31-L503 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:31-506](https://github.com/wopian/kitsu/blob/f66d077c8872a0f4c34ed46a48086ec32cdaf64e/packages/kitsu/src/index.js#L31-L506 "Source code on GitHub") | ||
@@ -237,11 +237,12 @@ Creates a new `kitsu` instance | ||
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Options (optional, default `{}`) | ||
- `options.baseURL` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Set the API endpoint (optional, default `https://kitsu.io/api/edge`) | ||
- `options.headers` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional headers to send with the requests | ||
- `options.camelCaseTypes` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** If enabled, `type` will be converted to camelCase from kebab-casae or snake_case (optional, default `true`) | ||
- `options.resourceCase` **(`"kebab"` \| `"snake"` \| `"none"`)** Case to convert camelCase to. `kebab` - `/library-entries`; `snake` - /library_entries`;`none`-`/libraryEntries\` (optional, default `kebab`) | ||
- `options.pluralize` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** If enabled, `/user` will become `/users` in the URL request and `type` will be pluralized in POST, PATCH and DELETE requests (optional, default `true`) | ||
- `options.timeout` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Set the request timeout in milliseconds (optional, default `30000`) | ||
- `options.axiosOptions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional options for the axios instance (see [axios/axios#request-config](https://github.com/axios/axios#request-config) for details) | ||
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Options (optional, default `{}`) | ||
* `options.baseURL` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Set the API endpoint (optional, default `https://kitsu.io/api/edge`) | ||
* `options.headers` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional headers to send with the requests | ||
* `options.camelCaseTypes` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** If enabled, `type` will be converted to camelCase from kebab-casae or snake_case (optional, default `true`) | ||
* `options.resourceCase` **(`"kebab"` | `"snake"` | `"none"`)** Case to convert camelCase to. `kebab` - `/library-entries`; `snake` - /library_entries` ; `none`-`/libraryEntries\` (optional, default `kebab`) | ||
* `options.pluralize` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** If enabled, `/user` will become `/users` in the URL request and `type` will be pluralized in POST, PATCH and DELETE requests (optional, default `true`) | ||
* `options.timeout` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Set the request timeout in milliseconds (optional, default `30000`) | ||
* `options.axiosOptions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional options for the axios instance (see [axios/axios#request-config](https://github.com/axios/axios#request-config) for details) | ||
#### Examples | ||
@@ -251,3 +252,2 @@ | ||
```javascript | ||
@@ -259,3 +259,2 @@ const api = new Kitsu() | ||
```javascript | ||
@@ -269,3 +268,2 @@ const api = new Kitsu({ | ||
```javascript | ||
@@ -282,8 +280,6 @@ const api = new Kitsu({ | ||
[packages/kitsu/src/index.js:53-54](https://github.com/wopian/kitsu/blob/8a7d453339bbd80393c63cad5ae6fc758fb0eb4e/packages/kitsu/src/index.js#L53-L54 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:53-54](https://github.com/wopian/kitsu/blob/f66d077c8872a0f4c34ed46a48086ec32cdaf64e/packages/kitsu/src/index.js#L53-L54 "Source code on GitHub") | ||
- **See: <https://www.npmjs.com/package/pluralize> for documentation | ||
** | ||
- **See: [Kitsu](#kitsu) constructor options for disabling pluralization | ||
** | ||
* **See**: <https://www.npmjs.com/package/pluralize> for documentation | ||
* **See**: [Kitsu](#kitsu) constructor options for disabling pluralization | ||
@@ -296,3 +292,2 @@ If pluralization is enabled (default, see Kitsu constructor docs) then pluralization rules can be added | ||
```javascript | ||
@@ -306,3 +301,3 @@ api.plural.plural('paper') //=> 'papers' | ||
[packages/kitsu/src/index.js:68-68](https://github.com/wopian/kitsu/blob/8a7d453339bbd80393c63cad5ae6fc758fb0eb4e/packages/kitsu/src/index.js#L68-L68 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:68-68](https://github.com/wopian/kitsu/blob/f66d077c8872a0f4c34ed46a48086ec32cdaf64e/packages/kitsu/src/index.js#L68-L68 "Source code on GitHub") | ||
@@ -315,3 +310,2 @@ Get the current headers or add additional headers | ||
```javascript | ||
@@ -323,3 +317,2 @@ api.headers | ||
```javascript | ||
@@ -331,3 +324,2 @@ api.headers['User-Agent'] | ||
```javascript | ||
@@ -341,6 +333,5 @@ api.headers['Authorization'] = 'Bearer 1234567890' | ||
[packages/kitsu/src/index.js:113-113](https://github.com/wopian/kitsu/blob/8a7d453339bbd80393c63cad5ae6fc758fb0eb4e/packages/kitsu/src/index.js#L113-L113 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:113-113](https://github.com/wopian/kitsu/blob/f66d077c8872a0f4c34ed46a48086ec32cdaf64e/packages/kitsu/src/index.js#L113-L113 "Source code on GitHub") | ||
- **See: <https://github.com/axios/axios#interceptors> for documentation | ||
** | ||
* **See**: <https://github.com/axios/axios#interceptors> for documentation | ||
@@ -355,3 +346,2 @@ Axios Interceptors (alias of `axios.interceptors`) | ||
```javascript | ||
@@ -370,3 +360,2 @@ // Add a request interceptor | ||
```javascript | ||
@@ -387,3 +376,2 @@ // Add a response interceptor | ||
```javascript | ||
@@ -396,3 +384,3 @@ const myInterceptor = api.interceptors.request.use(function () {...}) | ||
[packages/kitsu/src/index.js:210-230](https://github.com/wopian/kitsu/blob/8a7d453339bbd80393c63cad5ae6fc758fb0eb4e/packages/kitsu/src/index.js#L210-L230 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:210-231](https://github.com/wopian/kitsu/blob/f66d077c8872a0f4c34ed46a48086ec32cdaf64e/packages/kitsu/src/index.js#L210-L231 "Source code on GitHub") | ||
@@ -403,18 +391,21 @@ Fetch resources (alias `fetch`) | ||
- `model` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Resource to fetch data from. Expected formats are [`:resource`](https://jsonapi.org/format/#document-resource-objects), [`:resource/:id`](https://jsonapi.org/format/#document-resource-objects), [`:resource/:id/:relationship`](https://jsonapi.org/format/#document-resource-object-relationships) or [`:resource/:id/relationships/:relationship`](https://jsonapi.org/format/#document-resource-object-linkage) | ||
- `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional configuration (optional, default `{}`) | ||
- `config.headers` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional headers to send with the request | ||
- `config.params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** JSON:API request queries. JSON:API query parameters not listed are supported | ||
- `config.params.fields` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Return a sparse fieldset with only the included attributes/relationships - [JSON:API Sparse Fieldsets](http://jsonapi.org/format/#fetching-sparse-fieldsets) | ||
- `config.params.filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Filter dataset by attribute values - [JSON:API Filtering](http://jsonapi.org/format/#fetching-filtering) | ||
- `config.params.include` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Include relationship data - [JSON:API Includes](http://jsonapi.org/format/#fetching-includes) | ||
- `config.params.sort` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Sort dataset by one or more comma separated attributes (prepend `-` for descending order) - [JSON:API Sorting](http://jsonapi.org/format/#fetching-sorting) | ||
- `config.params.page` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** [JSON:API Pagination](http://jsonapi.org/format/#fetching-pagination). All pagination strategies are supported, even if they are not listed below. | ||
- `config.params.page.limit` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Number of resources to return in request (Offset-based) - **Note:** For Kitsu.io, max is `20` except on `libraryEntries` which has a max of `500` | ||
- `config.params.page.offset` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Number of resources to offset the dataset by (Offset-based) | ||
- `config.params.page.number` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Page of resources to return in request (Page-based) - **Note:** Not supported on Kitsu.io | ||
- `config.params.page.size` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Number of resources to return in request (Page-based and cursor-based) - **Note:** Not supported on Kitsu.io | ||
- `config.params.page.before` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Get the previous page of resources (Cursor-based) - **Note:** Not Supported on Kitsu.io | ||
- `config.params.page.after` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Get the next page of resources (Cursor-based) - **Note:** Not Supported on Kitsu.io | ||
* `model` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Resource to fetch data from. Expected formats are [`:resource`](https://jsonapi.org/format/#document-resource-objects), [`:resource/:id`](https://jsonapi.org/format/#document-resource-objects), [`:resource/:id/:relationship`](https://jsonapi.org/format/#document-resource-object-relationships) or [`:resource/:id/relationships/:relationship`](https://jsonapi.org/format/#document-resource-object-linkage) | ||
* `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional configuration (optional, default `{}`) | ||
* `config.headers` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional headers to send with the request | ||
* `config.params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** JSON:API request queries. JSON:API query parameters not listed are supported | ||
* `config.params.fields` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Return a sparse fieldset with only the included attributes/relationships - [JSON:API Sparse Fieldsets](http://jsonapi.org/format/#fetching-sparse-fieldsets) | ||
* `config.params.filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Filter dataset by attribute values - [JSON:API Filtering](http://jsonapi.org/format/#fetching-filtering) | ||
* `config.params.include` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Include relationship data - [JSON:API Includes](http://jsonapi.org/format/#fetching-includes) | ||
* `config.params.sort` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Sort dataset by one or more comma separated attributes (prepend `-` for descending order) - [JSON:API Sorting](http://jsonapi.org/format/#fetching-sorting) | ||
* `config.params.page` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** [JSON:API Pagination](http://jsonapi.org/format/#fetching-pagination). All pagination strategies are supported, even if they are not listed below. | ||
* `config.params.page.limit` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Number of resources to return in request (Offset-based) - **Note:** For Kitsu.io, max is `20` except on `libraryEntries` which has a max of `500` | ||
* `config.params.page.offset` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Number of resources to offset the dataset by (Offset-based) | ||
* `config.params.page.number` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Page of resources to return in request (Page-based) - **Note:** Not supported on Kitsu.io | ||
* `config.params.page.size` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Number of resources to return in request (Page-based and cursor-based) - **Note:** Not supported on Kitsu.io | ||
* `config.params.page.before` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Get the previous page of resources (Cursor-based) - **Note:** Not Supported on Kitsu.io | ||
* `config.params.page.after` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Get the next page of resources (Cursor-based) - **Note:** Not Supported on Kitsu.io | ||
##### Examples | ||
@@ -424,3 +415,2 @@ | ||
```javascript | ||
@@ -441,3 +431,2 @@ api.get('users', { | ||
```javascript | ||
@@ -453,3 +442,2 @@ api.get('anime', { | ||
```javascript | ||
@@ -465,3 +453,2 @@ api.get('anime/2', { | ||
```javascript | ||
@@ -478,3 +465,2 @@ api.get('anime', { | ||
```javascript | ||
@@ -486,3 +472,2 @@ api.get('anime/2/categories') | ||
```javascript | ||
@@ -503,3 +488,2 @@ // resource?filter[x][y]=value | ||
```javascript | ||
@@ -524,3 +508,2 @@ try { | ||
```javascript | ||
@@ -547,3 +530,3 @@ api.get('anime') | ||
[packages/kitsu/src/index.js:265-292](https://github.com/wopian/kitsu/blob/8a7d453339bbd80393c63cad5ae6fc758fb0eb4e/packages/kitsu/src/index.js#L265-L292 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:266-293](https://github.com/wopian/kitsu/blob/f66d077c8872a0f4c34ed46a48086ec32cdaf64e/packages/kitsu/src/index.js#L266-L293 "Source code on GitHub") | ||
@@ -554,8 +537,9 @@ Update a resource (alias `update`) | ||
- `model` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Resource to update data in. Expected formats are [`:resource`](https://jsonapi.org/format/#document-resource-objects), [`:resource/:id`](https://jsonapi.org/format/#document-resource-objects), [`:resource/:id/:relationship`](https://jsonapi.org/format/#document-resource-object-relationships) or [`:resource/:id/relationships/:relationship`](https://jsonapi.org/format/#document-resource-object-linkage) | ||
- `body` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>)** Data to send in the request | ||
- `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional configuration (optional, default `{}`) | ||
- `config.params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** JSON:API request queries. See [#get](#get) for documentation | ||
- `config.headers` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional headers to send with the request | ||
* `model` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Resource to update data in. Expected formats are [`:resource`](https://jsonapi.org/format/#document-resource-objects), [`:resource/:id`](https://jsonapi.org/format/#document-resource-objects), [`:resource/:id/:relationship`](https://jsonapi.org/format/#document-resource-object-relationships) or [`:resource/:id/relationships/:relationship`](https://jsonapi.org/format/#document-resource-object-linkage) | ||
* `body` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>)** Data to send in the request | ||
* `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional configuration (optional, default `{}`) | ||
* `config.params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** JSON:API request queries. See [#get](#get) for documentation | ||
* `config.headers` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional headers to send with the request | ||
##### Examples | ||
@@ -565,3 +549,2 @@ | ||
```javascript | ||
@@ -576,3 +559,2 @@ api.update('posts', { | ||
```javascript | ||
@@ -590,3 +572,2 @@ api.update('posts', { | ||
```javascript | ||
@@ -598,3 +579,2 @@ api.update('posts/1/relationships/uploads', null) | ||
```javascript | ||
@@ -606,3 +586,2 @@ api.update('posts/1/relationships/uploads', []) | ||
```javascript | ||
@@ -615,7 +594,7 @@ api.update('posts', [ | ||
Returns **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>)** JSON-parsed response | ||
Returns **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>)** JSON-parsed response | ||
#### post | ||
[packages/kitsu/src/index.js:322-347](https://github.com/wopian/kitsu/blob/8a7d453339bbd80393c63cad5ae6fc758fb0eb4e/packages/kitsu/src/index.js#L322-L347 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:323-348](https://github.com/wopian/kitsu/blob/f66d077c8872a0f4c34ed46a48086ec32cdaf64e/packages/kitsu/src/index.js#L323-L348 "Source code on GitHub") | ||
@@ -626,8 +605,9 @@ Create a new resource (alias `create`) | ||
- `model` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Resource to create. Expected formats are [`:resource`](https://jsonapi.org/format/#document-resource-objects), [`:resource/:id`](https://jsonapi.org/format/#document-resource-objects), [`:resource/:id/:relationship`](https://jsonapi.org/format/#document-resource-object-relationships) or [`:resource/:id/relationships/:relationship`](https://jsonapi.org/format/#document-resource-object-linkage) | ||
- `body` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>)** Data to send in the request | ||
- `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional configuration (optional, default `{}`) | ||
- `config.params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** JSON:API request queries. See [#get](#get) for documentation | ||
- `config.headers` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional headers to send with the request | ||
* `model` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Resource to create. Expected formats are [`:resource`](https://jsonapi.org/format/#document-resource-objects), [`:resource/:id`](https://jsonapi.org/format/#document-resource-objects), [`:resource/:id/:relationship`](https://jsonapi.org/format/#document-resource-object-relationships) or [`:resource/:id/relationships/:relationship`](https://jsonapi.org/format/#document-resource-object-linkage) | ||
* `body` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>)** Data to send in the request | ||
* `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional configuration (optional, default `{}`) | ||
* `config.params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** JSON:API request queries. See [#get](#get) for documentation | ||
* `config.headers` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional headers to send with the request | ||
##### Examples | ||
@@ -637,3 +617,2 @@ | ||
```javascript | ||
@@ -655,3 +634,2 @@ api.create('posts', { | ||
```javascript | ||
@@ -664,7 +642,7 @@ api.create('posts', [ | ||
Returns **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>)** JSON-parsed response | ||
Returns **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>)** JSON-parsed response | ||
#### delete | ||
[packages/kitsu/src/index.js:364-397](https://github.com/wopian/kitsu/blob/8a7d453339bbd80393c63cad5ae6fc758fb0eb4e/packages/kitsu/src/index.js#L364-L397 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:365-398](https://github.com/wopian/kitsu/blob/f66d077c8872a0f4c34ed46a48086ec32cdaf64e/packages/kitsu/src/index.js#L365-L398 "Source code on GitHub") | ||
@@ -675,8 +653,9 @@ Remove a resource (alias `remove`) | ||
- `model` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Resource to remove. Expected formats are [`:resource`](https://jsonapi.org/format/#document-resource-objects), [`:resource/:id/:relationship`](https://jsonapi.org/format/#document-resource-object-relationships) or [`:resource/:id/relationships/:relationship`](https://jsonapi.org/format/#document-resource-object-linkage) | ||
- `id` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) \| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)>)** Resource ID to remove. Pass an array of IDs to delete multiple resources (Bulk Extension) | ||
- `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional configuration (optional, default `{}`) | ||
- `config.params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** JSON:API request queries. See [#get](#get) for documentation | ||
- `config.headers` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional headers to send with the request | ||
* `model` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Resource to remove. Expected formats are [`:resource`](https://jsonapi.org/format/#document-resource-objects), [`:resource/:id/:relationship`](https://jsonapi.org/format/#document-resource-object-relationships) or [`:resource/:id/relationships/:relationship`](https://jsonapi.org/format/#document-resource-object-linkage) | ||
* `id` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) | [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)>)** Resource ID to remove. Pass an array of IDs to delete multiple resources (Bulk Extension) | ||
* `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional configuration (optional, default `{}`) | ||
* `config.params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** JSON:API request queries. See [#get](#get) for documentation | ||
* `config.headers` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional headers to send with the request | ||
##### Examples | ||
@@ -686,3 +665,2 @@ | ||
```javascript | ||
@@ -694,3 +672,2 @@ api.delete('posts', 123) | ||
```javascript | ||
@@ -700,7 +677,7 @@ api.delete('posts', [ 1, 2 ]) | ||
Returns **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>)** JSON-parsed response | ||
Returns **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>)** JSON-parsed response | ||
#### self | ||
[packages/kitsu/src/index.js:420-429](https://github.com/wopian/kitsu/blob/8a7d453339bbd80393c63cad5ae6fc758fb0eb4e/packages/kitsu/src/index.js#L420-L429 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:421-430](https://github.com/wopian/kitsu/blob/f66d077c8872a0f4c34ed46a48086ec32cdaf64e/packages/kitsu/src/index.js#L421-L430 "Source code on GitHub") | ||
@@ -713,6 +690,7 @@ Get the authenticated user's data | ||
- `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional configuration (optional, default `{}`) | ||
- `config.params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** JSON:API request queries. See [#get](#get) for documentation | ||
- `config.headers` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional headers to send with the request | ||
* `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional configuration (optional, default `{}`) | ||
* `config.params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** JSON:API request queries. See [#get](#get) for documentation | ||
* `config.headers` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional headers to send with the request | ||
##### Examples | ||
@@ -722,3 +700,2 @@ | ||
```javascript | ||
@@ -730,3 +707,2 @@ api.self() | ||
```javascript | ||
@@ -746,3 +722,3 @@ api.self({ | ||
[packages/kitsu/src/index.js:483-502](https://github.com/wopian/kitsu/blob/8a7d453339bbd80393c63cad5ae6fc758fb0eb4e/packages/kitsu/src/index.js#L483-L502 "Source code on GitHub") | ||
[packages/kitsu/src/index.js:484-505](https://github.com/wopian/kitsu/blob/f66d077c8872a0f4c34ed46a48086ec32cdaf64e/packages/kitsu/src/index.js#L484-L505 "Source code on GitHub") | ||
@@ -755,10 +731,11 @@ Send arbitrary requests | ||
- `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request configuration | ||
- `config.body` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>)?** Data to send in the request | ||
- `config.method` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Request method - `GET`, `PATCH`, `POST` or `DELETE` (defaults to `GET`, case-insensitive) | ||
- `config.params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** JSON:API request queries. See [#get](#get) for documentation | ||
- `config.type` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The resource type | ||
- `config.url` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The URL path of the resource | ||
- `config.headers` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional headers to send with the request | ||
* `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request configuration | ||
* `config.body` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>)?** Data to send in the request | ||
* `config.method` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Request method - `GET`, `PATCH`, `POST` or `DELETE` (defaults to `GET`, case-insensitive) | ||
* `config.params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** JSON:API request queries. See [#get](#get) for documentation | ||
* `config.type` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The resource type | ||
* `config.url` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The URL path of the resource | ||
* `config.headers` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional headers to send with the request | ||
##### Examples | ||
@@ -768,3 +745,2 @@ | ||
```javascript | ||
@@ -780,3 +756,2 @@ api.request({ | ||
```javascript | ||
@@ -793,3 +768,2 @@ api.request({ | ||
```javascript | ||
@@ -806,3 +780,2 @@ api.request({ | ||
```javascript | ||
@@ -819,3 +792,2 @@ api.request({ | ||
```javascript | ||
@@ -822,0 +794,0 @@ api.request({ |
@@ -46,15 +46,15 @@ /** | ||
fetch: (model: string, config?: { | ||
headers: any; | ||
params: { | ||
fields: any; | ||
filter: any; | ||
include: string; | ||
sort: string; | ||
page: { | ||
limit: number; | ||
offset: number; | ||
number: number; | ||
size: number; | ||
before: string; | ||
after: string; | ||
headers?: any; | ||
params?: { | ||
fields?: any; | ||
filter?: any; | ||
include?: string; | ||
sort?: string; | ||
page?: { | ||
limit?: number; | ||
offset?: number; | ||
number?: number; | ||
size?: number; | ||
before?: string; | ||
after?: string; | ||
}; | ||
@@ -64,12 +64,12 @@ }; | ||
update: (model: string, body: any | any[], config?: { | ||
params: any; | ||
headers: any; | ||
params?: any; | ||
headers?: any; | ||
}) => any | any[]; | ||
create: (model: string, body: any | any[], config?: { | ||
params: any; | ||
headers: any; | ||
params?: any; | ||
headers?: any; | ||
}) => any | any[]; | ||
remove: (model: string, id: string | number | number[], config?: { | ||
params: any; | ||
headers: any; | ||
params?: any; | ||
headers?: any; | ||
}) => any | any[]; | ||
@@ -206,15 +206,15 @@ /** | ||
get(model: string, config?: { | ||
headers: any; | ||
params: { | ||
fields: any; | ||
filter: any; | ||
include: string; | ||
sort: string; | ||
page: { | ||
limit: number; | ||
offset: number; | ||
number: number; | ||
size: number; | ||
before: string; | ||
after: string; | ||
headers?: any; | ||
params?: { | ||
fields?: any; | ||
filter?: any; | ||
include?: string; | ||
sort?: string; | ||
page?: { | ||
limit?: number; | ||
offset?: number; | ||
number?: number; | ||
size?: number; | ||
before?: string; | ||
after?: string; | ||
}; | ||
@@ -257,4 +257,4 @@ }; | ||
patch(model: string, body: any | any[], config?: { | ||
params: any; | ||
headers: any; | ||
params?: any; | ||
headers?: any; | ||
}): any | any[]; | ||
@@ -290,4 +290,4 @@ /** | ||
post(model: string, body: any | any[], config?: { | ||
params: any; | ||
headers: any; | ||
params?: any; | ||
headers?: any; | ||
}): any | any[]; | ||
@@ -310,4 +310,4 @@ /** | ||
delete(model: string, id: string | number | number[], config?: { | ||
params: any; | ||
headers: any; | ||
params?: any; | ||
headers?: any; | ||
}): any | any[]; | ||
@@ -336,4 +336,4 @@ /** | ||
self(config?: { | ||
params: any; | ||
headers: any; | ||
params?: any; | ||
headers?: any; | ||
}): any; | ||
@@ -395,7 +395,7 @@ /** | ||
type: string; | ||
body: any | any[]; | ||
method: string; | ||
params: any; | ||
headers: any; | ||
body?: any | any[]; | ||
method?: string; | ||
params?: any; | ||
headers?: any; | ||
}): any; | ||
} |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
72182
752
Updatedkitsu-core@^10.0.0-alpha.11