@speclynx/apidom-reference 2.12.4 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +56 -0
- package/dist/apidom-reference.browser.js +106 -13
- package/dist/apidom-reference.browser.min.js +1 -1
- package/package.json +26 -26
- package/src/resolve/resolvers/HTTPResolver.cjs +8 -1
- package/src/resolve/resolvers/HTTPResolver.mjs +7 -1
- package/src/resolve/resolvers/http-axios/cache/MemoryCache.cjs +44 -0
- package/src/resolve/resolvers/http-axios/cache/MemoryCache.mjs +40 -0
- package/src/resolve/resolvers/http-axios/index.cjs +34 -1
- package/src/resolve/resolvers/http-axios/index.mjs +34 -2
- package/types/apidom-reference.d.ts +10 -0
- package/types/resolve/resolvers/HTTPResolver.d.ts +9 -0
- package/types/resolve/resolvers/http-axios/cache/MemoryCache.d.ts +17 -0
- package/types/resolve/resolvers/http-axios/index.d.ts +12 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.13.0](https://github.com/speclynx/apidom/compare/v2.12.4...v2.13.0) (2026-02-28)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **reference:** add cache support for Axios resolver ([#117](https://github.com/speclynx/apidom/issues/117)) ([372c58d](https://github.com/speclynx/apidom/commit/372c58df1649c82092851ac6e0d89e53d8e9bbd8))
|
|
11
|
+
|
|
6
12
|
## [2.12.4](https://github.com/speclynx/apidom/compare/v2.12.3...v2.12.4) (2026-02-24)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @speclynx/apidom-reference
|
package/README.md
CHANGED
|
@@ -990,6 +990,62 @@ await resolve('https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/
|
|
|
990
990
|
});
|
|
991
991
|
```
|
|
992
992
|
|
|
993
|
+
###### Response caching support
|
|
994
|
+
|
|
995
|
+
HTTPResolverAxios plugin supports in-memory response caching. When enabled, responses are cached
|
|
996
|
+
by URL, and subsequent requests for the same URL are served from cache instead of making
|
|
997
|
+
a new HTTP request. Caching is disabled by default.
|
|
998
|
+
|
|
999
|
+
Enabling cache with default options:
|
|
1000
|
+
|
|
1001
|
+
```js
|
|
1002
|
+
import HTTPResolverAxios from '@speclynx/apidom-reference/resolve/resolvers/http-axios';
|
|
1003
|
+
|
|
1004
|
+
const resolver = new HTTPResolverAxios({
|
|
1005
|
+
cache: true,
|
|
1006
|
+
});
|
|
1007
|
+
```
|
|
1008
|
+
|
|
1009
|
+
Enabling cache with custom options:
|
|
1010
|
+
|
|
1011
|
+
```js
|
|
1012
|
+
import HTTPResolverAxios from '@speclynx/apidom-reference/resolve/resolvers/http-axios';
|
|
1013
|
+
|
|
1014
|
+
const resolver = new HTTPResolverAxios({
|
|
1015
|
+
cache: {
|
|
1016
|
+
maxEntries: 512, // maximum number of entries (default: 1024, false to disable)
|
|
1017
|
+
maxStaleAge: 600_000, // maximum age in ms before eviction (default: 3_600_000, false to disable)
|
|
1018
|
+
},
|
|
1019
|
+
});
|
|
1020
|
+
```
|
|
1021
|
+
|
|
1022
|
+
Caching can also be configured via `resolverOpts`:
|
|
1023
|
+
|
|
1024
|
+
```js
|
|
1025
|
+
import { resolve } from '@speclynx/apidom-reference';
|
|
1026
|
+
|
|
1027
|
+
// enable with defaults
|
|
1028
|
+
await resolve('https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.1/webhook-example.json', {
|
|
1029
|
+
resolve: {
|
|
1030
|
+
resolverOpts: {
|
|
1031
|
+
cache: true,
|
|
1032
|
+
},
|
|
1033
|
+
},
|
|
1034
|
+
});
|
|
1035
|
+
|
|
1036
|
+
// enable with custom options
|
|
1037
|
+
await resolve('https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.1/webhook-example.json', {
|
|
1038
|
+
resolve: {
|
|
1039
|
+
resolverOpts: {
|
|
1040
|
+
cache: {
|
|
1041
|
+
maxEntries: 512,
|
|
1042
|
+
maxStaleAge: 600_000,
|
|
1043
|
+
},
|
|
1044
|
+
},
|
|
1045
|
+
},
|
|
1046
|
+
});
|
|
1047
|
+
```
|
|
1048
|
+
|
|
993
1049
|
**File resolution on local filesystem path**:
|
|
994
1050
|
|
|
995
1051
|
```js
|