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