88 Commits

Author SHA1 Message Date
arthurfiorette
78cf406a56
feat: added web bundle and babel 2021-12-08 20:25:36 -03:00
arthurfiorette
60ad91e676
feat!: removed createCache function 2021-12-08 20:01:22 -03:00
Hazork
1e1627b5db docs: removed readme duplicated title 2021-11-15 11:47:32 -03:00
Hazork
59704833f2 fix: compile to ES2020, instead of ES2021 2021-11-15 11:33:00 -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
Hazork
99906e57b9 deps: bump axios to v0.24 2021-10-28 11:40:15 -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
b42d3f13d7 refactor: more type and naming refactors 2021-10-12 19:58:00 -03:00
Hazork
1713bb0870 feat!: updated axios to v0.22.0 2021-10-12 19:17:01 -03:00
Hazork
861567af2e docs: updated readme 2021-10-12 12:26:07 -03:00
Hazork
9b9827cae1 docs: updated documentation 2021-10-12 12:21:50 -03:00
Hazork
6fa0e7b602 docs: table of contents 2021-10-09 14:23:40 -03:00
Hazork
d9614853da docs: correct tag names 2021-10-09 14:04:14 -03:00
Hazork
50de35d3ba style: prettified code 2021-10-09 13:57:06 -03:00
Hazork
ebe313fac6 deps!: updated axios to v0.22 2021-10-09 13:55:06 -03:00
Hazork
d96a9dc5f0 style: updated prettier config 2021-09-21 12:56:32 -03:00
Hazork
35ca874c65 docs: removed instable warning 2021-09-21 12:42:00 -03:00
Hazork
07731e4b35 docs: updated docs 2021-09-21 12:39:26 -03:00
Hazork
33b8dcd58b refactor!: updated all exports 2021-09-21 12:01:47 -03:00
Hazork
2d3cbda079 docs: initial docs 2021-09-20 16:50:06 -03:00
Hazork
b45fd54f69 docs: updated codecov badge token 2021-09-13 14:25:43 -03:00
Hazork
6972069e91 docs: fixed project name 🤣 2021-09-13 13:40:23 -03:00
Hazork
3f0e022b0e docs: changed # to h1 2021-09-13 12:26:49 -03:00
Hazork
d8afd8a9e9 docs: updated readme 2021-09-13 12:25:05 -03:00
Hazork
aa83c24e18 docs: updated readme example 2021-09-11 13:03:41 -03:00
Hazork
dc5608578f style: use @arthurfiorette/prettier-config 2021-09-05 15:27:14 -03:00
Hazork
a43dfaba48 docs: npm badge 2021-09-01 16:50:08 -03:00
Hazork
3465bc385b docs: updated author and readme 2021-09-01 16:45:21 -03:00
Hazork
33f7385b28 docs: updated readme 2021-09-01 16:38:35 -03:00
Hazork
be210b2924 docs: warning for production usage 2021-09-01 16:32:38 -03:00
Hazork
5d8b698ddb docs: fix typo in examples 2021-09-01 13:37:28 -03:00
Hazork
c1a4144a73 docs: updated readme again 2021-09-01 13:36:53 -03:00
Hazork
4a88c32e67 docs: updated readme 2021-09-01 13:35:45 -03:00
Hazork
5ee2b0493b feat(WIP): structured code 2021-09-01 13:30:26 -03:00
Hazork
f373f857af init: init project 2021-09-01 10:07:10 -03:00
Arthur Fiorette
e033ff08b0
Initial commit 2021-09-01 09:39:56 -03:00