@scalar/fastify-api-reference 1.64.0 → 1.65.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 +8 -0
- package/dist/index.d.ts +86 -3
- package/dist/index.js +1 -1
- package/package.json +13 -10
- package/dist/fastifyApiReference.d.ts +0 -5
- package/dist/fastifyApiReference.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/types.d.ts +0 -74
- package/dist/types.d.ts.map +0 -1
- package/dist/utils/getJavaScriptFile.d.ts +0 -15
- package/dist/utils/getJavaScriptFile.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @scalar/fastify-api-reference
|
|
2
2
|
|
|
3
|
+
## 1.65.0
|
|
4
|
+
|
|
5
|
+
## 1.64.1
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- [#9835](https://github.com/scalar/scalar/pull/9835): Fix the published type declarations so they resolve under `moduleResolution: node16`/`nodenext` again. Since `1.62.1` the `.d.ts` files re-exported relative modules without a file extension (`export { default } from './fastifyApiReference'`), which ESM resolution rejects with TS2834 — so the plugin's types silently degraded to `any` for those consumers. The declarations are now emitted as a single self-contained `index.d.ts` (matching the Next.js integration), which resolves under every module resolution setting.
|
|
10
|
+
|
|
3
11
|
## 1.64.0
|
|
4
12
|
|
|
5
13
|
## 1.63.0
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,86 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { FastifyBaseLogger } from 'fastify';
|
|
2
|
+
import { FastifyPluginCallback } from 'fastify';
|
|
3
|
+
import { FastifyTypeProviderDefault } from 'fastify';
|
|
4
|
+
import { HtmlRenderingConfiguration } from '@scalar/client-side-rendering';
|
|
5
|
+
import { onRequestHookHandler } from 'fastify';
|
|
6
|
+
import { preHandlerHookHandler } from 'fastify';
|
|
7
|
+
import { RawServerDefault } from 'fastify';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The configuration for the Scalar API Reference for Fastify
|
|
11
|
+
*/
|
|
12
|
+
export declare type ApiReferenceConfiguration = HtmlRenderingConfiguration;
|
|
13
|
+
|
|
14
|
+
declare const fastifyApiReference: FastifyPluginCallback<FastifyApiReferenceOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger>;
|
|
15
|
+
export default fastifyApiReference;
|
|
16
|
+
|
|
17
|
+
export declare type FastifyApiReferenceHooksOptions = Partial<{
|
|
18
|
+
onRequest?: onRequestHookHandler;
|
|
19
|
+
preHandler?: preHandlerHookHandler;
|
|
20
|
+
}>;
|
|
21
|
+
|
|
22
|
+
export declare type FastifyApiReferenceOptions = {
|
|
23
|
+
/**
|
|
24
|
+
* If you're prefixing Fastify with a path, you can set it here.
|
|
25
|
+
* It'll be added to the JavaScript URL and the route.
|
|
26
|
+
*
|
|
27
|
+
* Example: `${publicPath}${routePrefix}/js/scalar.js`
|
|
28
|
+
* @deprecated We don't use this anymore.
|
|
29
|
+
*/
|
|
30
|
+
publicPath?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Prefix the route with a path. This is where the API Reference will be available.
|
|
33
|
+
*
|
|
34
|
+
* @default '/reference'
|
|
35
|
+
*/
|
|
36
|
+
routePrefix?: `/${string}`;
|
|
37
|
+
/**
|
|
38
|
+
* Set where the OpenAPI specification is exposed under `${routePrefix}`.
|
|
39
|
+
*
|
|
40
|
+
* The specification is always available on these endpoints, parsed by `@scalar/openapi-parser`.
|
|
41
|
+
*
|
|
42
|
+
* The specification is sourced from, in order of precedence:
|
|
43
|
+
* - `configuration.spec.content`
|
|
44
|
+
* - `configuration.spec.url` – fetched via `@scalar/openapi-parser/plugins/fetch-urls`
|
|
45
|
+
* - `@fastify/swagger` – if `configuration.spec` is not provided
|
|
46
|
+
*
|
|
47
|
+
* These endpoints can be used to fetch the OpenAPI specification for your own programmatic use.
|
|
48
|
+
*
|
|
49
|
+
* @default{ json: '/openapi.json', yaml: '/openapi.yaml' }
|
|
50
|
+
*/
|
|
51
|
+
openApiDocumentEndpoints?: {
|
|
52
|
+
/**
|
|
53
|
+
* Set where the OpenAPI specification is exposed under `${routePrefix}`, in JSON format.
|
|
54
|
+
*
|
|
55
|
+
* With the default value, the endpoint is: `${publicPath}${routePrefix}/openapi.json`
|
|
56
|
+
*
|
|
57
|
+
* @default '/openapi.json'
|
|
58
|
+
*/
|
|
59
|
+
json?: `/${string}`;
|
|
60
|
+
/**
|
|
61
|
+
* Set where the OpenAPI specification is exposed under `${routePrefix}`, in YAML format.
|
|
62
|
+
*
|
|
63
|
+
* With the default value, the endpoint is: `${publicPath}${routePrefix}/openapi.yaml`
|
|
64
|
+
*
|
|
65
|
+
* @default '/openapi.yaml'
|
|
66
|
+
*/
|
|
67
|
+
yaml?: `/${string}`;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* The universal configuration object for @scalar/api-reference.
|
|
71
|
+
*
|
|
72
|
+
* Read more: https://github.com/scalar/scalar
|
|
73
|
+
*/
|
|
74
|
+
configuration?: Partial<ApiReferenceConfiguration>;
|
|
75
|
+
/**
|
|
76
|
+
* The hooks for the API Reference.
|
|
77
|
+
*/
|
|
78
|
+
hooks?: FastifyApiReferenceHooksOptions;
|
|
79
|
+
/**
|
|
80
|
+
* The log level for all routes registered by this plugin.
|
|
81
|
+
* Set to 'silent' to disable logging for these routes.
|
|
82
|
+
*/
|
|
83
|
+
logLevel?: 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'silent';
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export { }
|