@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/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "openapi",
18
18
  "swagger"
19
19
  ],
20
- "version": "1.64.0",
20
+ "version": "1.65.0",
21
21
  "engines": {
22
22
  "node": ">=22"
23
23
  },
@@ -54,23 +54,26 @@
54
54
  "dependencies": {
55
55
  "fastify-plugin": "^4.5.1",
56
56
  "github-slugger": "2.0.0",
57
- "@scalar/client-side-rendering": "0.3.5",
58
- "@scalar/openapi-parser": "0.28.11",
59
- "@scalar/openapi-types": "0.9.4"
57
+ "@scalar/client-side-rendering": "0.3.7",
58
+ "@scalar/openapi-types": "0.9.4",
59
+ "@scalar/openapi-parser": "0.28.13"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@fastify/basic-auth": "^5.1.1",
63
63
  "@fastify/http-proxy": "^9.5.0",
64
64
  "@fastify/swagger": "^8.10.1",
65
+ "@types/node": "^24.1.0",
65
66
  "fastify": "^4.0.0",
66
- "vite": "8.0.0",
67
- "vitest": "4.1.0",
68
- "yaml": "^2.8.3",
69
- "@scalar/helpers": "0.9.2",
70
- "@scalar/api-reference": "1.64.0"
67
+ "typescript": "^5.8.3",
68
+ "vite": "8.1.5",
69
+ "vite-plugin-dts": "^4.3.0",
70
+ "vitest": "4.1.10",
71
+ "yaml": "^2.9.0",
72
+ "@scalar/api-reference": "1.65.0",
73
+ "@scalar/helpers": "0.10.0"
71
74
  },
72
75
  "scripts": {
73
- "build": "pnpm types:check && vite build && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
76
+ "build": "pnpm types:check && vite build",
74
77
  "dev": "tsx watch playground/index.ts",
75
78
  "docker:build": "docker build --build-arg BASE_IMAGE=scalar-base -t fastify-api-reference -f Dockerfile .",
76
79
  "docker:run": "docker run -p 5053:5053 fastify-api-reference",
@@ -1,5 +0,0 @@
1
- import type { FastifyBaseLogger, FastifyTypeProviderDefault, RawServerDefault } from 'fastify';
2
- import type { FastifyApiReferenceOptions } from './types';
3
- declare const fastifyApiReference: import("fastify").FastifyPluginCallback<FastifyApiReferenceOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger>;
4
- export default fastifyApiReference;
5
- //# sourceMappingURL=fastifyApiReference.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fastifyApiReference.d.ts","sourceRoot":"","sources":["../src/fastifyApiReference.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAI7G,OAAO,KAAK,EAA8D,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAoDrH,QAAA,MAAM,mBAAmB,sIAyMxB,CAAA;AAED,eAAe,mBAAmB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,YAAY,EACV,yBAAyB,EACzB,+BAA+B,EAC/B,0BAA0B,GAC3B,MAAM,SAAS,CAAA"}
package/dist/types.d.ts DELETED
@@ -1,74 +0,0 @@
1
- import type { HtmlRenderingConfiguration } from '@scalar/client-side-rendering';
2
- import type { onRequestHookHandler, preHandlerHookHandler } from 'fastify';
3
- /**
4
- * The configuration for the Scalar API Reference for Fastify
5
- */
6
- export type ApiReferenceConfiguration = HtmlRenderingConfiguration;
7
- export type FastifyApiReferenceOptions = {
8
- /**
9
- * If you're prefixing Fastify with a path, you can set it here.
10
- * It'll be added to the JavaScript URL and the route.
11
- *
12
- * Example: `${publicPath}${routePrefix}/js/scalar.js`
13
- * @deprecated We don't use this anymore.
14
- */
15
- publicPath?: string;
16
- /**
17
- * Prefix the route with a path. This is where the API Reference will be available.
18
- *
19
- * @default '/reference'
20
- */
21
- routePrefix?: `/${string}`;
22
- /**
23
- * Set where the OpenAPI specification is exposed under `${routePrefix}`.
24
- *
25
- * The specification is always available on these endpoints, parsed by `@scalar/openapi-parser`.
26
- *
27
- * The specification is sourced from, in order of precedence:
28
- * - `configuration.spec.content`
29
- * - `configuration.spec.url` – fetched via `@scalar/openapi-parser/plugins/fetch-urls`
30
- * - `@fastify/swagger` – if `configuration.spec` is not provided
31
- *
32
- * These endpoints can be used to fetch the OpenAPI specification for your own programmatic use.
33
- *
34
- * @default{ json: '/openapi.json', yaml: '/openapi.yaml' }
35
- */
36
- openApiDocumentEndpoints?: {
37
- /**
38
- * Set where the OpenAPI specification is exposed under `${routePrefix}`, in JSON format.
39
- *
40
- * With the default value, the endpoint is: `${publicPath}${routePrefix}/openapi.json`
41
- *
42
- * @default '/openapi.json'
43
- */
44
- json?: `/${string}`;
45
- /**
46
- * Set where the OpenAPI specification is exposed under `${routePrefix}`, in YAML format.
47
- *
48
- * With the default value, the endpoint is: `${publicPath}${routePrefix}/openapi.yaml`
49
- *
50
- * @default '/openapi.yaml'
51
- */
52
- yaml?: `/${string}`;
53
- };
54
- /**
55
- * The universal configuration object for @scalar/api-reference.
56
- *
57
- * Read more: https://github.com/scalar/scalar
58
- */
59
- configuration?: Partial<ApiReferenceConfiguration>;
60
- /**
61
- * The hooks for the API Reference.
62
- */
63
- hooks?: FastifyApiReferenceHooksOptions;
64
- /**
65
- * The log level for all routes registered by this plugin.
66
- * Set to 'silent' to disable logging for these routes.
67
- */
68
- logLevel?: 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'silent';
69
- };
70
- export type FastifyApiReferenceHooksOptions = Partial<{
71
- onRequest?: onRequestHookHandler;
72
- preHandler?: preHandlerHookHandler;
73
- }>;
74
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAA;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAE1E;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,0BAA0B,CAAA;AAElE,MAAM,MAAM,0BAA0B,GAAG;IACvC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,IAAI,MAAM,EAAE,CAAA;IAC1B;;;;;;;;;;;;;OAaG;IACH,wBAAwB,CAAC,EAAE;QACzB;;;;;;WAMG;QACH,IAAI,CAAC,EAAE,IAAI,MAAM,EAAE,CAAA;QACnB;;;;;;WAMG;QACH,IAAI,CAAC,EAAE,IAAI,MAAM,EAAE,CAAA;KACpB,CAAA;IACD;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAA;IAClD;;OAEG;IACH,KAAK,CAAC,EAAE,+BAA+B,CAAA;IACvC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAA;CAC9E,CAAA;AAED,MAAM,MAAM,+BAA+B,GAAG,OAAO,CAAC;IACpD,SAAS,CAAC,EAAE,oBAAoB,CAAA;IAChC,UAAU,CAAC,EAAE,qBAAqB,CAAA;CACnC,CAAC,CAAA"}
@@ -1,15 +0,0 @@
1
- /**
2
- * Return the standalone build of `@scalar/api-reference` as a string.
3
- *
4
- * This implementation reads the script from disk and is what runs during
5
- * development (the playground executes the source directly via `tsx`) and in
6
- * tests, where `@scalar/api-reference` is available as a workspace dependency.
7
- *
8
- * For the published package, the Vite build replaces this module with the
9
- * script inlined as a string (see `vite.config.ts`). That is what makes the
10
- * plugin bundler-safe: the output is self-contained and no longer reads the
11
- * file at runtime, so it survives whatever bundler the consuming application
12
- * uses (for example when bundling a Fastify app into a Docker image).
13
- */
14
- export declare function getJavaScriptFile(): string;
15
- //# sourceMappingURL=getJavaScriptFile.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getJavaScriptFile.d.ts","sourceRoot":"","sources":["../../src/utils/getJavaScriptFile.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAY1C"}