43 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
183f086704 Address PR feedback: Add configurable waitingTimeout and improve implementation
- Add waitingTimeout property to CacheProperties for configurable timeout
- Extract timeout logic to waiting-timeout.ts utility function
- Store request ID outside timeout callback to allow earlier GC
- Add unref() to timeout in Node.js to prevent keeping process alive
- Fix timeout logic to handle axios default timeout of 0
- Only create timeout when explicitly configured or config.timeout > 0

Changes address comments 2598940999, 2598944866, and 2598947753.

Co-authored-by: arthurfiorette <47537704+arthurfiorette@users.noreply.github.com>
2025-12-08 15:12:46 +00:00
Arthur Fiorette
ff5589f9fb
fix: typing issues with axios >= 11.7.8 (#953) 2025-03-17 23:49:55 -03:00
Arthur Fiorette
1178d334dc
feat: location and Cache-Control: private 2025-03-17 23:21:18 -03:00
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
ed99d775bb
feat: correct ESM and CJS support, move to microbundle. (#764) 2024-01-18 23:48:33 -03:00
Arthur Fiorette
f96b55dc54
fix: type incompatibility 2023-12-26 15:46:40 -03:00
Arthur Fiorette
ecbc27e466
style: linted code 2023-11-16 03:26:37 -03:00
Arthur Fiorette
37e2f1e85a
chore: migrated to biomejs.dev 2023-11-16 03:26:20 -03:00
Arthur Fiorette
892649c92f
fix: override and hydrate globally (#694) 2023-10-23 12:51:23 -03:00
Arthur Fiorette
16e51e788b
feat: prefer noop over undefined when debugging 2023-09-30 15:03:21 -03:00
Denis Rossati
0199ad6b97
feat: turn most types into interfaces (#615)
* Turn most types into interfaces

* Turn 'CacheAxiosResponse' into a interface

* Update docs

* Change docs to be more didactic
2023-07-30 00:22:16 -03:00
arthurfiorette
a9e8998026 style: formatted code 2023-03-19 17:17:41 -03:00
arthurfiorette
174ea35ab0 feat: cache predicate defaults follows RFC 7231 2023-03-19 17:13:32 -03:00
arthurfiorette
d6b41e802f
feat: incresed tsdoc documentation a lot 2023-02-17 13:16:06 -03:00
arthurfiorette
384c6b59ee
feat: hydrate option #469 2023-02-17 12:09:00 -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
268fccb935
feat: override cache option 2022-06-05 11:26:00 -03:00
arthurfiorette
623ae22053
refactor: updated some minor things 2022-05-07 15:08:52 -03:00
arthurfiorette
119fa32f18
feat!: updated default caching options 2022-03-14 10:07:30 -03:00
arthurfiorette
0ba6025fb5
feat: debug mode & fixed tests 2022-01-23 16:13:22 -03:00
arthurfiorette
edb32bdea3
feat: add staleIfError support 2022-01-18 12:06:20 -03:00
arthurfiorette
6d9683a410
build: optimize umd builds with tslib 2022-01-15 13:02:57 -03:00
arthurfiorette
e391f5664c
refactor: Header as const and renaming... 2022-01-15 12:22:12 -03:00
Arthur Fiorette
4734c5f7a8
build: Yarn v2 and ESM & CJS bundles (#114) 2022-01-13 18:57:50 -03:00
arthurfiorette
38a5ecd365
refactor: simplified cachePredicate 2022-01-09 17:27:51 -03:00
arthurfiorette
e11e3466f1
fix: removed deprecated code 2022-01-09 13:35:11 -03:00
arthurfiorette
37431a9d34
refactor!: removed isAxiosCacheInterceptor function 2022-01-08 12:57:19 -03:00
arthurfiorette
cd2f14c446
refactor: removed classes to decrease bundle size 2022-01-08 12:27:52 -03:00
arthurfiorette
ed1e163472
chore: bundles exports everything and webpack bundles everything 2022-01-07 15:45:06 -03:00
arthurfiorette
ce2f5976bc
fix: proper generic usage to type deep properties 2022-01-04 15:27:30 -03:00
arthurfiorette
567c1b2477
refactor: allow storages not return promises 2022-01-04 15:15:27 -03:00
arthurfiorette
bafe1de98c
refactor: modified and simplified storages 2022-01-02 20:30:00 -03:00
arthurfiorette
c32c452190
feat: added isAxiosCacheInterceptor function 2021-12-31 10:05:21 -03:00
arthurfiorette
4a0a99ff28
refactor: prevent confusion by renaming createCache to useCache 2021-12-30 13:54:23 -03:00
arthurfiorette
27de6292be
style: formatted code 2021-12-27 18:48:26 -03:00
arthurfiorette
065b6eff74
refactor: deprecated useCache in favor of createCache (#95) 2021-12-27 14:25:55 -03:00
arthurfiorette
b4ad24de48
refactor: made some methods static and public 2021-12-11 10:42:26 -03:00
arthurfiorette
1615f284b3
chore: CacheOptions at the top of the file 2021-12-09 17:50:31 -03:00
arthurfiorette
60ad91e676
feat!: removed createCache function 2021-12-08 20:01:22 -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
b42d3f13d7 refactor: more type and naming refactors 2021-10-12 19:58:00 -03:00