1455 Commits

Author SHA1 Message Date
arthurfiorette
320ab6b0a2
tag: v0.6.2 v0.6.2 2021-11-23 10:03:18 -03:00
arthurfiorette
30d1268902
fix: removed old types folder mention 2021-11-23 10:00:50 -03:00
arthurfiorette
097a1798c4
tag: v0.6.1 v0.6.1 2021-11-23 09:50:53 -03:00
arthurfiorette
e2de9288bd
build: emit declaration in dist folder
If it's in the types folder, when importing a subpath like `axios-cache-interceptor/dist/storage/memory`, the types cannot be inferred.
2021-11-23 09:50:46 -03:00
dependabot[bot]
c2c409787a
chore(deps-dev): bump @types/node from 16.11.8 to 16.11.9 (#57) 2021-11-22 18:08:26 +00:00
dependabot[bot]
022f79b16b
chore(deps-dev): bump @types/jest from 27.0.2 to 27.0.3 (#56) 2021-11-19 11:15:15 +00:00
dependabot[bot]
27b2df9838
chore(deps-dev): bump @types/node from 16.11.7 to 16.11.8 (#55) 2021-11-19 11:15:13 +00:00
dependabot[bot]
2bab74fffd
chore(deps-dev): bump typescript from 4.4.4 to 4.5.2 (#54) 2021-11-18 21:30:04 +00:00
Hazork
1e1627b5db docs: removed readme duplicated title 2021-11-15 11:47:32 -03:00
Hazork
bd98a16885 tag: v0.6.0 v0.6.0 2021-11-15 11:34:26 -03:00
Hazork
59704833f2 fix: compile to ES2020, instead of ES2021 2021-11-15 11:33:00 -03:00
Hazork
19d0e9b69e style: prettier and changelog config changes
For prettier always use plugins and the changelog not get spammed with commit comments.
2021-11-15 10:58:19 -03:00
Arthur Fiorette
48e33c5d5a
feat: etag and if-modified-since support (#53)
* feat(WIP): etag and if-modified-since support

* test: fixed test name

* fix: merge response headers

* test: add etag / last-modified tests

* test: add must-revalidate tests

* fix: handle expirationTime 0 as true.

* tests: refactored some tests

* test: added keepIfStale tests

* fix: remove axios error for 304 requests

* fix: possible infinite loop on validateStatus function

* tests: ignore code that is hard test from coverage

* fix: use Last-Modified header for modifiedSince

If-Modified-Since is never sent by a server, it's
a client only header. However Last-Modified is sent
by the server to indicate the last time the returned
version was modified (it might not be the last version
depending on cache configuration on intermediate
servers)

* test: use validateStatus in mock

This more closely match default axios adapter.

* fix: validateStatus handling all cases

* refactor: use cache.createdAt if the last-modified header isn't present

* test: etag with predefined value

* test: added more test cases

* fix: fixed logic in some tests

* docs: initial documentation

* fix: manual values work out of the box

This removes header requirement from server.

* docs: add details to etag and modifiedSince features

* fix: delete custom headers from response

* feat: accept all configurations from global axios

Merging global into local configuration enable user
to use global configuration for all options and remove
the need to check local and global values every time.

* fix: preserve original types from AxiosInstance

The only value axios needs is a URL, and in the second definition of the method, there is already a URL parameter, so it can be undefined.

* Fix: defaults modifiedSince back to false.

Avoids breaking changes.

* docs: fix etag examples

* docs: document internal headers

* refactor: ternary operator :)

* style: prettified code

* test: remove modifiedSince: false in tests since this is the default

* docs: fix headers examples

* docs: fixed example formatting

* tests: split tests into multiple files to test them faster

* docs: correct jsdoc empty object

Co-authored-by: Charly Koza <cka@f4-group.com>
2021-11-15 10:43:20 -03:00
Arthur Fiorette
b35ae3e574
feat: storage abstractions (#52)
* refactor: better support for different storages

* test: updated tests

* feat: export AxiosStorage

* style: fix linting
2021-11-11 16:25:51 -03:00
Hazork
76a8af7433 feat: immutable cache support 2021-11-11 14:26:27 -03:00
Arthur Fiorette
92b9ed7abf
feat: more headers supports, tests and must-revalidate fix (#51)
* feat: must-revalidate and headers enum
* test: added more tests
* test: test and code fixes
* test: more tests
2021-11-11 14:16:37 -03:00
dependabot[bot]
89c9ba442d
chore(deps-dev): bump @types/node from 16.11.6 to 16.11.7 (#48) 2021-11-09 11:06:07 +00:00
dependabot[bot]
c87cd7c764
chore(deps-dev): bump prettier-plugin-jsdoc from 0.3.24 to 0.3.30 (#47) 2021-11-08 12:58:29 +00:00
Arthur Fiorette
6a680c1768 tag: v0.5.1 v0.5.1 2021-11-05 10:53:13 -03:00
Arthur Fiorette
bf891bdd09 refactor: better typings for axios 0.24 2021-11-05 10:42:45 -03:00
Hazork
3ca29dcf15 tag: v0.5.0 v0.5.0 2021-10-28 11:43:55 -03:00
Hazork
0058cd5771 style: prettified code 2021-10-28 11:42:40 -03:00
Hazork
312ff64bfe merge: merged code 2021-10-28 11:41:25 -03:00
Hazork
a50c0b689d tag: v0.5.0 2021-10-28 11:40:49 -03:00
Hazork
b3f832cb07 merge: merged code 2021-10-28 11:40:37 -03:00
Hazork
dab4832b58 Merge branch 'main' of https://github.com/ArthurFiorette/axios-cache-interceptor 2021-10-28 11:40:22 -03:00
Hazork
99906e57b9 deps: bump axios to v0.24 2021-10-28 11:40:15 -03:00
dependabot[bot]
df14973df8
chore(deps-dev): bump @types/node from 16.11.4 to 16.11.6 (#46) 2021-10-28 14:31:17 +00:00
Hazork
28e3392808 tag: v0.4.1 v0.4.1 2021-10-25 16:11:45 -03:00
Hazork
6e6100b86a fix: fixed isCacheValid function and added tests 2021-10-25 15:58:04 -03:00
Hazork
6ec1b5722b tag: v0.4.1 2021-10-25 15:38:27 -03:00
Hazork
ede19c1f33 build: separate code and types build folder 2021-10-25 15:38:03 -03:00
Hazork
cc23204a79 build: emit consistent javascript bundles with ES2021 2021-10-25 15:36:05 -03:00
Hazork
f141b2e680 refactor: externalized cache eviction predicate 2021-10-25 15:30:55 -03:00
dependabot[bot]
95de9fccee
chore(deps-dev): bump @types/node from 16.11.3 to 16.11.4 (#44) 2021-10-25 18:01:00 +00:00
dependabot[bot]
26203cf47f
chore(deps-dev): bump @types/node from 16.11.1 to 16.11.3 (#43) 2021-10-24 22:10:29 +00:00
dependabot[bot]
74adb66865
chore(deps-dev): bump jest from 27.2.5 to 27.3.1 (#42) 2021-10-19 16:40:40 +00:00
dependabot[bot]
12ca3a28ae
chore(deps-dev): bump ts-jest from 27.0.6 to 27.0.7 (#40) 2021-10-19 16:36:43 +00:00
dependabot[bot]
842b26e885
chore(deps-dev): bump @types/node from 16.11.0 to 16.11.1 (#39) 2021-10-19 16:36:34 +00:00
dependabot[bot]
acac85875f
chore(deps-dev): bump @types/node from 16.10.9 to 16.11.0 (#37) 2021-10-17 20:08:14 +00:00
dependabot[bot]
881072d14b
chore(deps-dev): bump ts-jest from 27.0.5 to 27.0.6 (#38) 2021-10-17 20:08:06 +00:00
Hazork
b2ba65ef7b deps: latest @arthurfiorette/prettier-config 2021-10-14 09:48:54 -03:00
dependabot[bot]
5d51b1ea0f
chore(deps-dev): bump @types/node from 16.10.3 to 16.10.9 (#36) 2021-10-14 12:33:51 +00:00
dependabot[bot]
b9365f4207
chore(deps-dev): bump typescript from 4.4.3 to 4.4.4 (#34) 2021-10-14 12:29:49 +00:00
Hazork
87880cf8d0 tag: v0.4.0 v0.4.0 2021-10-12 20:08:35 -03:00
Hazork
6b790af2ff docs: correct suported axios version 2021-10-12 20:07:37 -03:00
Hazork
4c757d3615 docs: updated readme 2021-10-12 20:03:35 -03:00
Hazork
dd1fa41aa6 docs: updated minimal example 2021-10-12 20:02:39 -03:00
Hazork
3ed92c8cc8 style: prettified code 2021-10-12 19:58:31 -03:00
Hazork
b42d3f13d7 refactor: more type and naming refactors 2021-10-12 19:58:00 -03:00