32 Commits

Author SHA1 Message Date
Arthur Fiorette
a7a4e31e57
fix: cloneData for concurrent requests (#921)
* code

* code

* reuse my biome config

* fix breaking change on 1.6.0

* lint
2024-10-18 11:09:15 -03:00
Arthur Fiorette
d72f8d00d3
refactor: better tests 2024-05-21 13:03:39 -03:00
Arthur Fiorette
ed99d775bb
feat: correct ESM and CJS support, move to microbundle. (#764) 2024-01-18 23:48:33 -03:00
Arthur Fiorette
ecbc27e466
style: linted code 2023-11-16 03:26:37 -03:00
Arthur Fiorette
286b2c0296
fix: rejected response deadlocks (#685) 2023-09-30 15:44:37 -03:00
arthurfiorette
ddcac5f58f
fix: correct config re throw 2023-07-30 00:05:15 -03:00
arthurfiorette
683dbe0f22
fix: support max-stale on header interpreter (#543) 2023-06-09 13:10:06 -03:00
Guilherme Mazoni
ee8b6b36a1
feat: staleIfError using stale-if-error directive (#506)
* Fix #506

* fix fmt
2023-02-24 11:25:39 -03:00
arthurfiorette
a5ebad3d14
fix: eslint warnings 2023-02-02 20:29:21 -03:00
arthurfiorette
002e065695
fix: double registration check and interceptors tests 2023-01-04 09:15:27 -03:00
arthurfiorette
7d82c5a46f
feat: cache takeover #437 2022-12-25 16:56:25 -03:00
arthurfiorette
0a00778065
fix: fixed bug when a pending request had it cached empty (#165) 2022-03-24 19:03:40 -03:00
arthurfiorette
0ba6025fb5
feat: debug mode & fixed tests 2022-01-23 16:13:22 -03:00
arthurfiorette
d14750ee63
refactor: moved header file 2022-01-19 07:48:33 -03:00
arthurfiorette
ed1e163472
chore: bundles exports everything and webpack bundles everything 2022-01-07 15:45:06 -03:00
arthurfiorette
4a0a99ff28
refactor: prevent confusion by renaming createCache to useCache 2021-12-30 13:54:23 -03:00
arthurfiorette
065b6eff74
refactor: deprecated useCache in favor of createCache (#95) 2021-12-27 14:25:55 -03:00
arthurfiorette
c3a0fea1bd
refactor: externalized createCacheData function 2021-12-11 10:42:32 -03:00
arthurfiorette
b9b4f7972f
fix: fixed tests 2021-12-08 20:26:10 -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
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
Hazork
b42d3f13d7 refactor: more type and naming refactors 2021-10-12 19:58:00 -03:00
Hazork
75deccf57d feat: preserve response status codes and use response.cached 2021-10-12 12:12:32 -03:00
Hazork
f8adcc4352 fix: force import type to help compilation tools 2021-09-26 16:24:33 -03:00
Hazork
47349df09f refactor: use the same object for both properties 2021-09-26 15:44:35 -03:00
Hazork
5b6d14f314 refactor: removed symbol support and more tests 2021-09-20 12:20:35 -03:00
Hazork
6075a0a960 fix: a bunch of tests 2021-09-19 19:29:05 -03:00
Hazork
84dc522b87 refactor: init request and response tests 2021-09-13 19:20:31 -03:00
Hazork
ee36bd57b0 refactor: more tests and fixes 2021-09-13 18:39:13 -03:00
Hazork
b45fd54f69 docs: updated codecov badge token 2021-09-13 14:25:43 -03:00
Hazork
bb552c8182 tests: added cache predicate tests 2021-09-13 14:20:45 -03:00
Hazork
2bbc9cb858 fix: fixed a log of bugs and added unit tests 2021-09-13 12:08:43 -03:00