@scalar/fastify-api-reference 1.52.2 → 1.52.4
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/fastifyApiReference.d.ts.map +1 -1
- package/dist/fastifyApiReference.js +6 -4
- package/dist/js/standalone.js +210 -202
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastifyApiReference.d.ts","sourceRoot":"","sources":["../src/fastifyApiReference.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAI9F,OAAO,KAAK,EAA8D,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAiDrH,QAAA,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"fastifyApiReference.d.ts","sourceRoot":"","sources":["../src/fastifyApiReference.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAI9F,OAAO,KAAK,EAA8D,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAiDrH,QAAA,MAAM,mBAAmB,sIAwMxB,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="@fastify/swagger" />
|
|
2
|
-
import {
|
|
2
|
+
import { renderApiReference } from '@scalar/client-side-rendering';
|
|
3
3
|
import { normalize, toJson, toYaml } from '@scalar/openapi-parser';
|
|
4
4
|
import fp from 'fastify-plugin';
|
|
5
5
|
import { slug } from 'github-slugger';
|
|
@@ -184,10 +184,12 @@ const fastifyApiReference = fp((fastify, options, next) => {
|
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
186
|
// Respond with the HTML document
|
|
187
|
-
|
|
187
|
+
const { cdn, pageTitle, ...config } = configuration;
|
|
188
|
+
return reply.header('Content-Type', 'text/html; charset=utf-8').send(renderApiReference({
|
|
189
|
+
config,
|
|
188
190
|
// We're using the bundled JS here by default, but the user can pass a CDN URL.
|
|
189
|
-
cdn: RELATIVE_JAVASCRIPT_PATH,
|
|
190
|
-
|
|
191
|
+
cdn: cdn ?? RELATIVE_JAVASCRIPT_PATH,
|
|
192
|
+
pageTitle,
|
|
191
193
|
}));
|
|
192
194
|
},
|
|
193
195
|
});
|