@scalar/fastify-api-reference 1.32.10 → 1.34.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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # @scalar/fastify-api-reference
2
2
 
3
+ ## 1.34.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [952bde2]
8
+ - Updated dependencies [2888e18]
9
+ - @scalar/openapi-parser@0.19.0
10
+
11
+ ## 1.33.0
12
+
13
+ ### Patch Changes
14
+
15
+ - 7031d9c: fix(api-reference): reference theme and style fixes
16
+ - Updated dependencies [ccf875a]
17
+ - Updated dependencies [c345d2c]
18
+ - @scalar/openapi-types@0.3.7
19
+ - @scalar/openapi-parser@0.18.3
20
+ - @scalar/core@0.3.11
21
+
3
22
  ## 1.32.10
4
23
 
5
24
  ### Patch Changes
@@ -3,7 +3,7 @@ import type { FastifyApiReferenceOptions } from './types.js';
3
3
  /**
4
4
  * The custom theme for Fastify
5
5
  */
6
- export declare const customTheme = "\n.light-mode {\n color-scheme: light;\n --scalar-color-1: #1c1e21;\n --scalar-color-2: #757575;\n --scalar-color-3: #8e8e8e;\n --scalar-color-disabled: #b4b1b1;\n --scalar-color-ghost: #a7a7a7;\n --scalar-color-accent: #2f8555;\n --scalar-background-1: #fff;\n --scalar-background-2: #f5f5f5;\n --scalar-background-3: #ededed;\n --scalar-background-4: rgba(0, 0, 0, 0.06);\n --scalar-background-accent: #2f85551f;\n\n --scalar-border-color: rgba(0, 0, 0, 0.1);\n --scalar-scrollbar-color: rgba(0, 0, 0, 0.18);\n --scalar-scrollbar-color-active: rgba(0, 0, 0, 0.36);\n --scalar-lifted-brightness: 1;\n --scalar-backdrop-brightness: 1;\n\n --scalar-shadow-1: 0 1px 3px 0 rgba(0, 0, 0, 0.11);\n --scalar-shadow-2: rgba(0, 0, 0, 0.08) 0px 13px 20px 0px,\n rgba(0, 0, 0, 0.08) 0px 3px 8px 0px, #eeeeed 0px 0 0 1px;\n\n --scalar-button-1: rgb(49 53 56);\n --scalar-button-1-color: #fff;\n --scalar-button-1-hover: rgb(28 31 33);\n\n --scalar-color-green: #007300;\n --scalar-color-red: #af272b;\n --scalar-color-yellow: #b38200;\n --scalar-color-blue: #3b8ba5;\n --scalar-color-orange: #fb892c;\n --scalar-color-purple: #5203d1;\n}\n\n.dark-mode {\n color-scheme: dark;\n --scalar-color-1: rgba(255, 255, 255, 0.9);\n --scalar-color-2: rgba(255, 255, 255, 0.62);\n --scalar-color-3: rgba(255, 255, 255, 0.44);\n --scalar-color-disabled: rgba(255, 255, 255, 0.34);\n --scalar-color-ghost: rgba(255, 255, 255, 0.26);\n --scalar-color-accent: #27c2a0;\n --scalar-background-1: #1b1b1d;\n --scalar-background-2: #242526;\n --scalar-background-3: #3b3b3b;\n --scalar-background-4: rgba(255, 255, 255, 0.06);\n --scalar-background-accent: #27c2a01f;\n\n --scalar-border-color: rgba(255, 255, 255, 0.1);\n --scalar-scrollbar-color: rgba(255, 255, 255, 0.24);\n --scalar-scrollbar-color-active: rgba(255, 255, 255, 0.48);\n --scalar-lifted-brightness: 1.45;\n --scalar-backdrop-brightness: 0.5;\n\n --scalar-shadow-1: 0 1px 3px 0 rgb(0, 0, 0, 0.1);\n --scalar-shadow-2: rgba(15, 15, 15, 0.2) 0px 3px 6px,\n rgba(15, 15, 15, 0.4) 0px 9px 24px, 0 0 0 1px rgba(255, 255, 255, 0.1);\n\n --scalar-button-1: #f6f6f6;\n --scalar-button-1-color: #000;\n --scalar-button-1-hover: #e7e7e7;\n\n --scalar-color-green: #26b226;\n --scalar-color-red: #fb565b;\n --scalar-color-yellow: #ffc426;\n --scalar-color-blue: #6ecfef;\n --scalar-color-orange: #ff8d4d;\n --scalar-color-purple: #b191f9;\n}\n";
6
+ export declare const customTheme = "";
7
7
  declare const fastifyApiReference: import("fastify").FastifyPluginCallback<FastifyApiReferenceOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger>;
8
8
  export default fastifyApiReference;
9
9
  //# sourceMappingURL=fastifyApiReference.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fastifyApiReference.d.ts","sourceRoot":"","sources":["../src/fastifyApiReference.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAI9F,OAAO,KAAK,EAAmC,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAyC1F;;GAEG;AACH,eAAO,MAAM,WAAW,s4EAwEvB,CAAA;AASD,QAAA,MAAM,mBAAmB,sIAoMxB,CAAA;AAED,eAAe,mBAAmB,CAAA"}
1
+ {"version":3,"file":"fastifyApiReference.d.ts","sourceRoot":"","sources":["../src/fastifyApiReference.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAI9F,OAAO,KAAK,EAAmC,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAyC1F;;GAEG;AACH,eAAO,MAAM,WAAW,KAAK,CAAA;AAS7B,QAAA,MAAM,mBAAmB,sIAoMxB,CAAA;AAED,eAAe,mBAAmB,CAAA"}
@@ -16,79 +16,7 @@ const getOpenApiDocumentEndpoints = (openApiDocumentEndpoints) => {
16
16
  return { json, yaml };
17
17
  };
18
18
  const getJavaScriptUrl = (routePrefix) => `${getRoutePrefix(routePrefix)}/${RELATIVE_JAVASCRIPT_PATH}`.replace(/\/\//g, "/");
19
- const customTheme = `
20
- .light-mode {
21
- color-scheme: light;
22
- --scalar-color-1: #1c1e21;
23
- --scalar-color-2: #757575;
24
- --scalar-color-3: #8e8e8e;
25
- --scalar-color-disabled: #b4b1b1;
26
- --scalar-color-ghost: #a7a7a7;
27
- --scalar-color-accent: #2f8555;
28
- --scalar-background-1: #fff;
29
- --scalar-background-2: #f5f5f5;
30
- --scalar-background-3: #ededed;
31
- --scalar-background-4: rgba(0, 0, 0, 0.06);
32
- --scalar-background-accent: #2f85551f;
33
-
34
- --scalar-border-color: rgba(0, 0, 0, 0.1);
35
- --scalar-scrollbar-color: rgba(0, 0, 0, 0.18);
36
- --scalar-scrollbar-color-active: rgba(0, 0, 0, 0.36);
37
- --scalar-lifted-brightness: 1;
38
- --scalar-backdrop-brightness: 1;
39
-
40
- --scalar-shadow-1: 0 1px 3px 0 rgba(0, 0, 0, 0.11);
41
- --scalar-shadow-2: rgba(0, 0, 0, 0.08) 0px 13px 20px 0px,
42
- rgba(0, 0, 0, 0.08) 0px 3px 8px 0px, #eeeeed 0px 0 0 1px;
43
-
44
- --scalar-button-1: rgb(49 53 56);
45
- --scalar-button-1-color: #fff;
46
- --scalar-button-1-hover: rgb(28 31 33);
47
-
48
- --scalar-color-green: #007300;
49
- --scalar-color-red: #af272b;
50
- --scalar-color-yellow: #b38200;
51
- --scalar-color-blue: #3b8ba5;
52
- --scalar-color-orange: #fb892c;
53
- --scalar-color-purple: #5203d1;
54
- }
55
-
56
- .dark-mode {
57
- color-scheme: dark;
58
- --scalar-color-1: rgba(255, 255, 255, 0.9);
59
- --scalar-color-2: rgba(255, 255, 255, 0.62);
60
- --scalar-color-3: rgba(255, 255, 255, 0.44);
61
- --scalar-color-disabled: rgba(255, 255, 255, 0.34);
62
- --scalar-color-ghost: rgba(255, 255, 255, 0.26);
63
- --scalar-color-accent: #27c2a0;
64
- --scalar-background-1: #1b1b1d;
65
- --scalar-background-2: #242526;
66
- --scalar-background-3: #3b3b3b;
67
- --scalar-background-4: rgba(255, 255, 255, 0.06);
68
- --scalar-background-accent: #27c2a01f;
69
-
70
- --scalar-border-color: rgba(255, 255, 255, 0.1);
71
- --scalar-scrollbar-color: rgba(255, 255, 255, 0.24);
72
- --scalar-scrollbar-color-active: rgba(255, 255, 255, 0.48);
73
- --scalar-lifted-brightness: 1.45;
74
- --scalar-backdrop-brightness: 0.5;
75
-
76
- --scalar-shadow-1: 0 1px 3px 0 rgb(0, 0, 0, 0.1);
77
- --scalar-shadow-2: rgba(15, 15, 15, 0.2) 0px 3px 6px,
78
- rgba(15, 15, 15, 0.4) 0px 9px 24px, 0 0 0 1px rgba(255, 255, 255, 0.1);
79
-
80
- --scalar-button-1: #f6f6f6;
81
- --scalar-button-1-color: #000;
82
- --scalar-button-1-hover: #e7e7e7;
83
-
84
- --scalar-color-green: #26b226;
85
- --scalar-color-red: #fb565b;
86
- --scalar-color-yellow: #ffc426;
87
- --scalar-color-blue: #6ecfef;
88
- --scalar-color-orange: #ff8d4d;
89
- --scalar-color-purple: #b191f9;
90
- }
91
- `;
19
+ const customTheme = ``;
92
20
  const DEFAULT_CONFIGURATION = {
93
21
  _integration: "fastify"
94
22
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/fastifyApiReference.ts"],
4
- "sourcesContent": ["import 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 { FastifyApiReferenceHooksOptions, FastifyApiReferenceOptions } from './types'\nimport { getJavaScriptFile } from './utils/getJavaScriptFile'\n\nimport { getHtmlDocument } from '@scalar/core/libs/html-rendering'\nimport { normalize, toJson, toYaml } from '@scalar/openapi-parser'\nimport type { ApiReferenceConfiguration } from './types'\n\n/**\n * Path to the bundled Scalar JavaScript file\n */\nconst RELATIVE_JAVASCRIPT_PATH = 'js/scalar.js'\n\n// This Schema is used to hide the route from the documentation.\n// https://github.com/fastify/fastify-swagger#hide-a-route\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 custom theme for Fastify\n */\nexport const customTheme = `\n.light-mode {\n color-scheme: light;\n --scalar-color-1: #1c1e21;\n --scalar-color-2: #757575;\n --scalar-color-3: #8e8e8e;\n --scalar-color-disabled: #b4b1b1;\n --scalar-color-ghost: #a7a7a7;\n --scalar-color-accent: #2f8555;\n --scalar-background-1: #fff;\n --scalar-background-2: #f5f5f5;\n --scalar-background-3: #ededed;\n --scalar-background-4: rgba(0, 0, 0, 0.06);\n --scalar-background-accent: #2f85551f;\n\n --scalar-border-color: rgba(0, 0, 0, 0.1);\n --scalar-scrollbar-color: rgba(0, 0, 0, 0.18);\n --scalar-scrollbar-color-active: rgba(0, 0, 0, 0.36);\n --scalar-lifted-brightness: 1;\n --scalar-backdrop-brightness: 1;\n\n --scalar-shadow-1: 0 1px 3px 0 rgba(0, 0, 0, 0.11);\n --scalar-shadow-2: rgba(0, 0, 0, 0.08) 0px 13px 20px 0px,\n rgba(0, 0, 0, 0.08) 0px 3px 8px 0px, #eeeeed 0px 0 0 1px;\n\n --scalar-button-1: rgb(49 53 56);\n --scalar-button-1-color: #fff;\n --scalar-button-1-hover: rgb(28 31 33);\n\n --scalar-color-green: #007300;\n --scalar-color-red: #af272b;\n --scalar-color-yellow: #b38200;\n --scalar-color-blue: #3b8ba5;\n --scalar-color-orange: #fb892c;\n --scalar-color-purple: #5203d1;\n}\n\n.dark-mode {\n color-scheme: dark;\n --scalar-color-1: rgba(255, 255, 255, 0.9);\n --scalar-color-2: rgba(255, 255, 255, 0.62);\n --scalar-color-3: rgba(255, 255, 255, 0.44);\n --scalar-color-disabled: rgba(255, 255, 255, 0.34);\n --scalar-color-ghost: rgba(255, 255, 255, 0.26);\n --scalar-color-accent: #27c2a0;\n --scalar-background-1: #1b1b1d;\n --scalar-background-2: #242526;\n --scalar-background-3: #3b3b3b;\n --scalar-background-4: rgba(255, 255, 255, 0.06);\n --scalar-background-accent: #27c2a01f;\n\n --scalar-border-color: rgba(255, 255, 255, 0.1);\n --scalar-scrollbar-color: rgba(255, 255, 255, 0.24);\n --scalar-scrollbar-color-active: rgba(255, 255, 255, 0.48);\n --scalar-lifted-brightness: 1.45;\n --scalar-backdrop-brightness: 0.5;\n\n --scalar-shadow-1: 0 1px 3px 0 rgb(0, 0, 0, 0.1);\n --scalar-shadow-2: rgba(15, 15, 15, 0.2) 0px 3px 6px,\n rgba(15, 15, 15, 0.4) 0px 9px 24px, 0 0 0 1px rgba(255, 255, 255, 0.1);\n\n --scalar-button-1: #f6f6f6;\n --scalar-button-1-color: #000;\n --scalar-button-1-hover: #e7e7e7;\n\n --scalar-color-green: #26b226;\n --scalar-color-red: #fb565b;\n --scalar-color-yellow: #ffc426;\n --scalar-color-blue: #6ecfef;\n --scalar-color-orange: #ff8d4d;\n --scalar-color-purple: #b191f9;\n}\n`\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 async (fastify, options) => {\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 if (fastify.hasPlugin('@fastify/swagger')) {\n return {\n type: 'swagger' as const,\n // @ts-ignore We know that @fastify/swagger is loaded.\n get: () => fastify.swagger() as OpenAPI.Document,\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) {\n fastify.log.warn(\n \"[@scalar/fastify-api-reference] You didn't provide a `content` or `url`, and @fastify/swagger could not be found. Please provide one of these options.\",\n )\n\n return\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 = async (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 const openApiSpecUrlJson = `${getRoutePrefix(options.routePrefix)}${getOpenApiDocumentEndpoints(options.openApiDocumentEndpoints).json}`\n fastify.route({\n method: 'GET',\n url: openApiSpecUrlJson,\n // @ts-ignore We don't know whether @fastify/swagger is loaded.\n schema: schemaToHideRoute,\n ...hooks,\n ...(options.logLevel && { logLevel: options.logLevel }),\n async handler(_, reply) {\n const spec = normalize(specSource.get())\n const filename: string = await 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 // @ts-ignore We don't know whether @fastify/swagger is loaded.\n schema: schemaToHideRoute,\n ...hooks,\n ...(options.logLevel && { logLevel: options.logLevel }),\n async handler(_, reply) {\n const spec = normalize(specSource.get())\n const filename: string = await 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 // 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, fastify registeres both routes anyway.\n const doesNotIgnoreTrailingSlash = fastify.initialConfig.ignoreTrailingSlash !== true\n\n if (doesNotIgnoreTrailingSlash && getRoutePrefix(options.routePrefix)) {\n fastify.route({\n method: 'GET',\n url: getRoutePrefix(options.routePrefix),\n // @ts-ignore We don't know whether @fastify/swagger is loaded.\n schema: schemaToHideRoute,\n ...hooks,\n ...(options.logLevel && { logLevel: options.logLevel }),\n handler(_, reply) {\n return reply.redirect(getRoutePrefix(options.routePrefix) + '/', 302)\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 // @ts-ignore We don't know whether @fastify/swagger is loaded.\n schema: schemaToHideRoute,\n ...hooks,\n ...(options.logLevel && { logLevel: options.logLevel }),\n handler(_, reply) {\n // Redirect if it's the route without a slash\n const currentUrl = new URL(_.url, `${_.protocol}://${_.hostname}`)\n\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.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 {\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 customTheme,\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 // @ts-ignore We don't know whether @fastify/swagger is loaded.\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 {\n name: '@scalar/fastify-api-reference',\n },\n)\n\nexport default fastifyApiReference\n"],
5
- "mappings": "AAEA,OAAO,QAAQ;AACf,SAAS,YAAY;AAGrB,SAAS,yBAAyB;AAElC,SAAS,uBAAuB;AAChC,SAAS,WAAW,QAAQ,cAAc;AAM1C,MAAM,2BAA2B;AAIjC,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;AAK5E,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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F,CAAC;AAED,YAAQ,MAAM;AAAA,MACZ,QAAQ;AAAA,MACR,KAAK,iBAAiB,QAAQ,WAAW;AAAA;AAAA;AAAA,MAGzC,QAAQ;AAAA,MACR,GAAG;AAAA,MACH,GAAI,QAAQ,YAAY,EAAE,UAAU,QAAQ,SAAS;AAAA,MACrD,QAAQ,GAAG,OAAO;AAChB,eAAO,MAAM,OAAO,gBAAgB,uCAAuC,EAAE,KAAK,WAAW;AAAA,MAC/F;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EACA;AAAA,IACE,MAAM;AAAA,EACR;AACF;AAEA,IAAO,8BAAQ;",
4
+ "sourcesContent": ["import 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 { FastifyApiReferenceHooksOptions, FastifyApiReferenceOptions } from './types'\nimport { getJavaScriptFile } from './utils/getJavaScriptFile'\n\nimport { getHtmlDocument } from '@scalar/core/libs/html-rendering'\nimport { normalize, toJson, toYaml } from '@scalar/openapi-parser'\nimport type { ApiReferenceConfiguration } from './types'\n\n/**\n * Path to the bundled Scalar JavaScript file\n */\nconst RELATIVE_JAVASCRIPT_PATH = 'js/scalar.js'\n\n// This Schema is used to hide the route from the documentation.\n// https://github.com/fastify/fastify-swagger#hide-a-route\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 custom theme for Fastify\n */\nexport const customTheme = ``\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 async (fastify, options) => {\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 if (fastify.hasPlugin('@fastify/swagger')) {\n return {\n type: 'swagger' as const,\n // @ts-ignore We know that @fastify/swagger is loaded.\n get: () => fastify.swagger() as OpenAPI.Document,\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) {\n fastify.log.warn(\n \"[@scalar/fastify-api-reference] You didn't provide a `content` or `url`, and @fastify/swagger could not be found. Please provide one of these options.\",\n )\n\n return\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 = async (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 const openApiSpecUrlJson = `${getRoutePrefix(options.routePrefix)}${getOpenApiDocumentEndpoints(options.openApiDocumentEndpoints).json}`\n fastify.route({\n method: 'GET',\n url: openApiSpecUrlJson,\n // @ts-ignore We don't know whether @fastify/swagger is loaded.\n schema: schemaToHideRoute,\n ...hooks,\n ...(options.logLevel && { logLevel: options.logLevel }),\n async handler(_, reply) {\n const spec = normalize(specSource.get())\n const filename: string = await 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 // @ts-ignore We don't know whether @fastify/swagger is loaded.\n schema: schemaToHideRoute,\n ...hooks,\n ...(options.logLevel && { logLevel: options.logLevel }),\n async handler(_, reply) {\n const spec = normalize(specSource.get())\n const filename: string = await 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 // 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, fastify registeres both routes anyway.\n const doesNotIgnoreTrailingSlash = fastify.initialConfig.ignoreTrailingSlash !== true\n\n if (doesNotIgnoreTrailingSlash && getRoutePrefix(options.routePrefix)) {\n fastify.route({\n method: 'GET',\n url: getRoutePrefix(options.routePrefix),\n // @ts-ignore We don't know whether @fastify/swagger is loaded.\n schema: schemaToHideRoute,\n ...hooks,\n ...(options.logLevel && { logLevel: options.logLevel }),\n handler(_, reply) {\n return reply.redirect(getRoutePrefix(options.routePrefix) + '/', 302)\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 // @ts-ignore We don't know whether @fastify/swagger is loaded.\n schema: schemaToHideRoute,\n ...hooks,\n ...(options.logLevel && { logLevel: options.logLevel }),\n handler(_, reply) {\n // Redirect if it's the route without a slash\n const currentUrl = new URL(_.url, `${_.protocol}://${_.hostname}`)\n\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.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 {\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 customTheme,\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 // @ts-ignore We don't know whether @fastify/swagger is loaded.\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 {\n name: '@scalar/fastify-api-reference',\n },\n)\n\nexport default fastifyApiReference\n"],
5
+ "mappings": "AAEA,OAAO,QAAQ;AACf,SAAS,YAAY;AAGrB,SAAS,yBAAyB;AAElC,SAAS,uBAAuB;AAChC,SAAS,WAAW,QAAQ,cAAc;AAM1C,MAAM,2B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