@scalar/fastify-api-reference 1.49.0 → 1.49.2

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.
@@ -0,0 +1,42 @@
1
+ import HttpProxy from '@fastify/http-proxy';
2
+ import Fastify from 'fastify';
3
+ import { describe, expect, it } from 'vitest';
4
+ import Scalar from './index.js';
5
+ describe('fastifyApiReference', () => {
6
+ it('returns 200 OK for the HTML', async () => {
7
+ // Origin
8
+ const origin = Fastify({
9
+ logger: false,
10
+ });
11
+ await origin.register(Scalar, {
12
+ routePrefix: '/documentation',
13
+ configuration: {
14
+ url: '/openapi.json',
15
+ },
16
+ });
17
+ const originAddress = await origin.listen({ port: 0 });
18
+ const originResponse = await fetch(`${originAddress}/documentation`);
19
+ expect(originResponse.status).toBe(200);
20
+ // Proxy
21
+ const proxy = Fastify({
22
+ logger: false,
23
+ });
24
+ await proxy.register(HttpProxy, {
25
+ upstream: originAddress,
26
+ prefix: '/proxy',
27
+ });
28
+ const proxyAddress = await proxy.listen({ port: 0 });
29
+ const proxyResponse = await fetch(`${proxyAddress}/proxy/documentation`);
30
+ expect(proxyResponse.status).toBe(200);
31
+ // Redirect
32
+ expect(proxyResponse.redirected).toBe(true);
33
+ const resolvedUrl = new URL(proxyResponse.url);
34
+ const resolvedPath = resolvedUrl.pathname;
35
+ expect(resolvedPath).toBe('/proxy/documentation/');
36
+ // JavaScript
37
+ const proxyResponseBody = await proxyResponse.text();
38
+ expect(proxyResponseBody).toContain('src="js/scalar.js"');
39
+ const assetResponse = await fetch(`${proxyAddress}${resolvedPath}js/scalar.js`);
40
+ expect(assetResponse.status).toBe(200);
41
+ });
42
+ });
package/dist/types.js CHANGED
@@ -1 +1 @@
1
- //# sourceMappingURL=types.js.map
1
+ export {};
@@ -1,18 +1,20 @@
1
- import fs from "node:fs";
2
- import path from "node:path";
3
- import { fileURLToPath } from "node:url";
4
- function getJavaScriptFile() {
5
- const dirname = path.dirname(fileURLToPath(import.meta.url));
6
- const filePath = [
7
- path.resolve(`${dirname}/js/standalone.js`),
8
- path.resolve(`${dirname}/../../dist/js/standalone.js`)
9
- ].find((file) => fs.existsSync(file));
10
- if (filePath === void 0) {
11
- throw new Error(`JavaScript file not found: ${path.resolve(`${dirname}/js/standalone.js`)}`);
12
- }
13
- return fs.readFileSync(filePath, "utf8");
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ /**
5
+ * Read the JavaScript file.
6
+ */
7
+ export function getJavaScriptFile() {
8
+ // Get the directory name
9
+ const dirname = path.dirname(fileURLToPath(import.meta.url));
10
+ // Find the JavaScript file
11
+ const filePath = [
12
+ path.resolve(`${dirname}/js/standalone.js`),
13
+ path.resolve(`${dirname}/../../dist/js/standalone.js`),
14
+ ].find((file) => fs.existsSync(file));
15
+ // Throw an error if the file is not found
16
+ if (filePath === undefined) {
17
+ throw new Error(`JavaScript file not found: ${path.resolve(`${dirname}/js/standalone.js`)}`);
18
+ }
19
+ return fs.readFileSync(filePath, 'utf8');
14
20
  }
15
- export {
16
- getJavaScriptFile
17
- };
18
- //# sourceMappingURL=getJavaScriptFile.js.map
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "openapi",
18
18
  "swagger"
19
19
  ],
20
- "version": "1.49.0",
20
+ "version": "1.49.2",
21
21
  "engines": {
22
22
  "node": ">=22"
23
23
  },
@@ -54,33 +54,27 @@
54
54
  "dependencies": {
55
55
  "fastify-plugin": "^4.5.1",
56
56
  "github-slugger": "2.0.0",
57
- "@scalar/core": "0.4.3",
58
- "@scalar/openapi-parser": "0.25.4",
59
- "@scalar/openapi-types": "0.6.0"
57
+ "@scalar/core": "0.4.4",
58
+ "@scalar/openapi-parser": "0.25.6",
59
+ "@scalar/openapi-types": "0.6.1"
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
65
  "fastify": "^4.0.0",
66
- "vite": "^7.3.1",
67
- "vitest": "4.0.16",
66
+ "vite": "8.0.0",
67
+ "vitest": "4.1.0",
68
68
  "yaml": "^2.8.0",
69
- "@scalar/api-reference": "1.49.0",
70
- "@scalar/build-tooling": "0.5.0"
69
+ "@scalar/api-reference": "1.49.2"
71
70
  },
72
71
  "scripts": {
73
- "build": "scalar-build-esbuild && pnpm copy:standalone",
72
+ "build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && pnpm copy:standalone",
74
73
  "copy:standalone": "shx mkdir -p ./dist/js && shx cp ../../packages/api-reference/dist/browser/standalone.js ./dist/js/standalone.js",
75
- "dev": "nodemon --exec \"vite-node playground/index.ts\" --ext ts --quiet --watch ./",
74
+ "dev": "tsx watch playground/index.ts",
76
75
  "docker:build": "docker build --build-arg BASE_IMAGE=scalar-base -t fastify-api-reference -f Dockerfile .",
77
76
  "docker:run": "docker run -p 5053:5053 fastify-api-reference",
78
- "format": "scalar-format",
79
- "format:check": "scalar-format-check",
80
- "lint:check": "scalar-lint-check",
81
- "lint:fix": "scalar-lint-fix",
82
77
  "test": "vitest",
83
- "types:build": "scalar-types-build",
84
- "types:check": "scalar-types-check"
78
+ "types:check": "tsc --noEmit"
85
79
  }
86
80
  }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/fastifyApiReference.ts"],
4
- "sourcesContent": ["import { getHtmlDocument } from '@scalar/core/libs/html-rendering'\nimport { normalize, toJson, toYaml } from '@scalar/openapi-parser'\nimport type { OpenAPI } from '@scalar/openapi-types'\nimport type { FastifyBaseLogger, FastifyTypeProviderDefault, RawServerDefault } from 'fastify'\nimport fp from 'fastify-plugin'\nimport { slug } from 'github-slugger'\n\nimport type { ApiReferenceConfiguration, FastifyApiReferenceHooksOptions, FastifyApiReferenceOptions } from './types'\nimport { getJavaScriptFile } from './utils/getJavaScriptFile'\n\n/**\n * Path to the bundled Scalar JavaScript file\n */\nconst RELATIVE_JAVASCRIPT_PATH = 'js/scalar.js'\n\n/**\n * This Schema is used to hide the route from the documentation.\n *\n * We don't know whether `@fastify/swagger` is registered, but it doesn't hurt to add a schema anyway.\n *\n * @see https://github.com/fastify/fastify-swagger#hide-a-route\n */\nconst schemaToHideRoute = {\n hide: true,\n}\n\nconst getRoutePrefix = (routePrefix?: string) => {\n const prefix = routePrefix ?? '/reference'\n\n // Remove trailing slash if present\n return prefix.endsWith('/') ? prefix.slice(0, -1) : prefix\n}\n\n/**\n * Get the endpoints for the OpenAPI specification.\n */\nconst getOpenApiDocumentEndpoints = (\n openApiDocumentEndpoints: FastifyApiReferenceOptions['openApiDocumentEndpoints'],\n) => {\n const { json = '/openapi.json', yaml = '/openapi.yaml' } = openApiDocumentEndpoints ?? {}\n return { json, yaml }\n}\n\n/**\n * Get the URL for the Scalar JavaScript file.\n */\nconst getJavaScriptUrl = (routePrefix?: string) =>\n `${getRoutePrefix(routePrefix)}/${RELATIVE_JAVASCRIPT_PATH}`.replace(/\\/\\//g, '/')\n\n/**\n * The default configuration for Fastify\n */\nconst DEFAULT_CONFIGURATION: Partial<ApiReferenceConfiguration> = {\n _integration: 'fastify',\n}\n\nconst fastifyApiReference = fp<\n FastifyApiReferenceOptions,\n RawServerDefault,\n FastifyTypeProviderDefault,\n FastifyBaseLogger\n>(\n (fastify, options, next) => {\n const { configuration: givenConfiguration } = options\n\n // Merge the defaults\n let configuration = {\n ...DEFAULT_CONFIGURATION,\n ...givenConfiguration,\n }\n\n const specSource = (() => {\n const { content, url } = configuration ?? {}\n if (content) {\n return {\n type: 'content' as const,\n get: () => {\n if (typeof content === 'function') {\n return content()\n }\n return content\n },\n }\n }\n if (url) {\n return {\n type: 'url' as const,\n get: () => url,\n }\n }\n\n // Even if @fastify/swagger is loaded, when the `decorator` option is set, the `swagger` function is not available.\n if (fastify.hasPlugin('@fastify/swagger') && typeof fastify.swagger === 'function') {\n return {\n type: 'swagger' as const,\n get: () => fastify.swagger(),\n }\n }\n\n return void 0\n })()\n\n // If no OpenAPI specification is passed and @fastify/swagger isn't loaded, show a warning.\n if (!specSource && !configuration.sources) {\n fastify.log.warn(\n \"[@scalar/fastify-api-reference] You didn't provide a `content`, `url`, `sources` or @fastify/swagger could not be found. Please provide one of these options.\",\n )\n\n return next()\n }\n\n // Read the JavaScript file once.\n const fileContent = getJavaScriptFile()\n\n const hooks: FastifyApiReferenceHooksOptions = {}\n if (options.hooks) {\n const additionalHooks: (keyof FastifyApiReferenceHooksOptions)[] = ['onRequest', 'preHandler']\n\n for (const hook of additionalHooks) {\n if (options.hooks[hook]) {\n hooks[hook] = options.hooks[hook]\n }\n }\n }\n\n const getSpecFilenameSlug = (spec: OpenAPI.Document) => {\n // Same GitHub Slugger and default file name as in `@scalar/api-reference`, when generating the download\n return slug(spec?.specification?.info?.title ?? 'spec')\n }\n\n // Only expose the endpoints if specSource is available\n if (specSource) {\n const openApiSpecUrlJson = `${getRoutePrefix(options.routePrefix)}${getOpenApiDocumentEndpoints(options.openApiDocumentEndpoints).json}`\n fastify.route({\n method: 'GET',\n url: openApiSpecUrlJson,\n schema: schemaToHideRoute,\n ...hooks,\n ...(options.logLevel && { logLevel: options.logLevel }),\n handler(_, reply) {\n const spec = normalize(specSource.get())\n const filename = getSpecFilenameSlug(spec)\n const json = JSON.parse(toJson(spec)) // parsing minifies the JSON\n\n return reply\n .header('Content-Type', 'application/json')\n .header('Content-Disposition', `filename=${filename}.json`)\n .header('Access-Control-Allow-Origin', '*')\n .header('Access-Control-Allow-Methods', '*')\n .send(json)\n },\n })\n\n const openApiSpecUrlYaml = `${getRoutePrefix(options.routePrefix)}${getOpenApiDocumentEndpoints(options.openApiDocumentEndpoints).yaml}`\n fastify.route({\n method: 'GET',\n url: openApiSpecUrlYaml,\n schema: schemaToHideRoute,\n ...hooks,\n ...(options.logLevel && { logLevel: options.logLevel }),\n handler(_, reply) {\n const spec = normalize(specSource.get())\n const filename = getSpecFilenameSlug(spec)\n const yaml = toYaml(spec)\n return reply\n .header('Content-Type', 'application/yaml')\n .header('Content-Disposition', `filename=${filename}.yaml`)\n .header('Access-Control-Allow-Origin', '*')\n .header('Access-Control-Allow-Methods', '*')\n .send(yaml)\n },\n })\n }\n\n // Redirect route without a trailing slash to force a trailing slash:\n // We need this so the request to the JS file is relative.\n\n // With ignoreTrailingSlash: true, fastify responds to both routes anyway.\n const ignoreTrailingSlash =\n // @ts-expect-error We're still on Fastify 4, this is introduced in Fastify 5\n fastify.initialConfig?.routerOptions?.ignoreTrailingSlash === true ||\n fastify.initialConfig?.ignoreTrailingSlash === true\n\n if (!ignoreTrailingSlash && getRoutePrefix(options.routePrefix)) {\n fastify.route({\n method: 'GET',\n url: getRoutePrefix(options.routePrefix),\n schema: schemaToHideRoute,\n ...hooks,\n ...(options.logLevel && { logLevel: options.logLevel }),\n handler(request, reply) {\n // we are in a route without a trailing slash so redirect directly to the one with a trailing slash\n const currentUrl = new URL(request.url, `${request.protocol}://${request.hostname}`)\n return reply.redirect(`${currentUrl.pathname}/`, 301)\n },\n })\n }\n\n // If no theme is passed, use the default theme.\n fastify.route({\n method: 'GET',\n url: `${getRoutePrefix(options.routePrefix)}/`,\n // We don't know whether @fastify/swagger is registered, but it doesn't hurt to add a schema anyway.\n schema: schemaToHideRoute,\n ...hooks,\n ...(options.logLevel && { logLevel: options.logLevel }),\n handler(request, reply) {\n // Redirect if it's the route without a slash\n const currentUrl = new URL(request.url, `${request.protocol}://${request.hostname}`)\n if (!currentUrl.pathname.endsWith('/')) {\n return reply.redirect(`${currentUrl.pathname}/`, 301)\n }\n\n /**\n * Regardless of where we source the spec from, provide it as a URL, to have the\n * download button point to the exposed endpoint.\n * If the URL is explicitly passed, defer to that URL instead.\n */\n if (specSource && specSource.type !== 'url') {\n configuration = {\n ...configuration,\n // Use a relative URL in case we're proxied\n url: `.${getOpenApiDocumentEndpoints(options.openApiDocumentEndpoints).json}`,\n }\n }\n\n // Respond with the HTML document\n return reply.header('Content-Type', 'text/html; charset=utf-8').send(\n getHtmlDocument({\n // We're using the bundled JS here by default, but the user can pass a CDN URL.\n cdn: RELATIVE_JAVASCRIPT_PATH,\n ...configuration,\n }),\n )\n },\n })\n\n fastify.route({\n method: 'GET',\n url: getJavaScriptUrl(options.routePrefix),\n // We don't know whether @fastify/swagger is registered, but it doesn't hurt to add a schema anyway.\n schema: schemaToHideRoute,\n ...hooks,\n ...(options.logLevel && { logLevel: options.logLevel }),\n handler(_, reply) {\n return reply.header('Content-Type', 'application/javascript; charset=utf-8').send(fileContent)\n },\n })\n\n next()\n },\n {\n name: '@scalar/fastify-api-reference',\n },\n)\n\nexport default fastifyApiReference\n"],
5
- "mappings": "AAAA,SAAS,uBAAuB;AAChC,SAAS,WAAW,QAAQ,cAAc;AAG1C,OAAO,QAAQ;AACf,SAAS,YAAY;AAGrB,SAAS,yBAAyB;AAKlC,MAAM,2BAA2B;AASjC,MAAM,oBAAoB;AAAA,EACxB,MAAM;AACR;AAEA,MAAM,iBAAiB,CAAC,gBAAyB;AAC/C,QAAM,SAAS,eAAe;AAG9B,SAAO,OAAO,SAAS,GAAG,IAAI,OAAO,MAAM,GAAG,EAAE,IAAI;AACtD;AAKA,MAAM,8BAA8B,CAClC,6BACG;AACH,QAAM,EAAE,OAAO,iBAAiB,OAAO,gBAAgB,IAAI,4BAA4B,CAAC;AACxF,SAAO,EAAE,MAAM,KAAK;AACtB;AAKA,MAAM,mBAAmB,CAAC,gBACxB,GAAG,eAAe,WAAW,CAAC,IAAI,wBAAwB,GAAG,QAAQ,SAAS,GAAG;AAKnF,MAAM,wBAA4D;AAAA,EAChE,cAAc;AAChB;AAEA,MAAM,sBAAsB;AAAA,EAM1B,CAAC,SAAS,SAAS,SAAS;AAC1B,UAAM,EAAE,eAAe,mBAAmB,IAAI;AAG9C,QAAI,gBAAgB;AAAA,MAClB,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAEA,UAAM,cAAc,MAAM;AACxB,YAAM,EAAE,SAAS,IAAI,IAAI,iBAAiB,CAAC;AAC3C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IACE,MAAM;AAAA,EACR;AACF;AAEA,IAAO,8BAAQ;",
6
- "names": []
7
- }
package/dist/index.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/index.ts"],
4
- "sourcesContent": ["export { default } from './fastifyApiReference'\nexport * from './types'\n"],
5
- "mappings": "AAAA,SAAS,WAAAA,gBAAe;AACxB,cAAc;",
6
- "names": ["default"]
7
- }
package/dist/types.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/utils/getJavaScriptFile.ts"],
4
- "sourcesContent": ["import fs from 'node:fs'\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\n/**\n * Read the JavaScript file.\n */\nexport function getJavaScriptFile() {\n // Get the directory name\n const dirname = path.dirname(fileURLToPath(import.meta.url))\n\n // Find the JavaScript file\n const filePath = [\n path.resolve(`${dirname}/js/standalone.js`),\n path.resolve(`${dirname}/../../dist/js/standalone.js`),\n ].find((file: string) => fs.existsSync(file))\n\n // Throw an error if the file is not found\n if (filePath === undefined) {\n throw new Error(`JavaScript file not found: ${path.resolve(`${dirname}/js/standalone.js`)}`)\n }\n\n return fs.readFileSync(filePath, 'utf8')\n}\n"],
5
- "mappings": "AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAKvB,SAAS,oBAAoB;AAElC,QAAM,UAAU,KAAK,QAAQ,cAAc,YAAY,GAAG,CAAC;AAG3D,QAAM,WAAW;AAAA,IACf,KAAK,QAAQ,GAAG,OAAO,mBAAmB;AAAA,IAC1C,KAAK,QAAQ,GAAG,OAAO,8BAA8B;AAAA,EACvD,EAAE,KAAK,CAAC,SAAiB,GAAG,WAAW,IAAI,CAAC;AAG5C,MAAI,aAAa,QAAW;AAC1B,UAAM,IAAI,MAAM,8BAA8B,KAAK,QAAQ,GAAG,OAAO,mBAAmB,CAAC,EAAE;AAAA,EAC7F;AAEA,SAAO,GAAG,aAAa,UAAU,MAAM;AACzC;",
6
- "names": []
7
- }