docusaurus-plugin-openapi-docs 0.0.0-beta.724 → 0.0.0-beta.727
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/lib/index.js +6 -4
- package/lib/options.js +1 -0
- package/lib/types.d.ts +1 -0
- package/package.json +2 -2
- package/src/index.ts +6 -3
- package/src/options.ts +1 -0
- package/src/types.ts +1 -0
package/lib/index.js
CHANGED
|
@@ -78,7 +78,7 @@ function pluginOpenAPIDocs(context, options) {
|
|
|
78
78
|
let docPath = docData ? (docData.path ? docData.path : "docs") : undefined;
|
|
79
79
|
async function generateApiDocs(options, pluginId) {
|
|
80
80
|
var _a, _b, _c, _d;
|
|
81
|
-
let { specPath, outputDir, template, markdownGenerators, downloadUrl, sidebarOptions, } = options;
|
|
81
|
+
let { specPath, outputDir, template, markdownGenerators, downloadUrl, sidebarOptions, disableCompression, } = options;
|
|
82
82
|
// Remove trailing slash before proceeding
|
|
83
83
|
outputDir = outputDir.replace(/\/$/, "");
|
|
84
84
|
// Override docPath if pluginId provided
|
|
@@ -235,9 +235,11 @@ custom_edit_url: null
|
|
|
235
235
|
// const deserialize = (s: any) => {
|
|
236
236
|
// return zlib.inflateSync(Buffer.from(s, "base64")).toString();
|
|
237
237
|
// };
|
|
238
|
-
|
|
239
|
-
.
|
|
240
|
-
.
|
|
238
|
+
disableCompression === true
|
|
239
|
+
? (item.json = JSON.stringify(item.api))
|
|
240
|
+
: (item.json = zlib_1.default
|
|
241
|
+
.deflateSync(JSON.stringify(item.api))
|
|
242
|
+
.toString("base64"));
|
|
241
243
|
let infoBasePath = `${outputDir}/${item.infoId}`;
|
|
242
244
|
if (docRouteBasePath) {
|
|
243
245
|
infoBasePath = `${docRouteBasePath}/${outputDir
|
package/lib/options.js
CHANGED
|
@@ -36,6 +36,7 @@ exports.OptionsSchema = utils_validation_1.Joi.object({
|
|
|
36
36
|
sidebarOptions: sidebarOptions,
|
|
37
37
|
markdownGenerators: markdownGenerators,
|
|
38
38
|
showSchemas: utils_validation_1.Joi.boolean(),
|
|
39
|
+
disableCompression: utils_validation_1.Joi.boolean(),
|
|
39
40
|
version: utils_validation_1.Joi.string().when("versions", {
|
|
40
41
|
is: utils_validation_1.Joi.exist(),
|
|
41
42
|
then: utils_validation_1.Joi.required(),
|
package/lib/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-plugin-openapi-docs",
|
|
3
3
|
"description": "OpenAPI plugin for Docusaurus.",
|
|
4
|
-
"version": "0.0.0-beta.
|
|
4
|
+
"version": "0.0.0-beta.727",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=14"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "3269c28557138d879701d00fe96c054c708155cc"
|
|
66
66
|
}
|
package/src/index.ts
CHANGED
|
@@ -120,6 +120,7 @@ export default function pluginOpenAPIDocs(
|
|
|
120
120
|
markdownGenerators,
|
|
121
121
|
downloadUrl,
|
|
122
122
|
sidebarOptions,
|
|
123
|
+
disableCompression,
|
|
123
124
|
} = options;
|
|
124
125
|
|
|
125
126
|
// Remove trailing slash before proceeding
|
|
@@ -325,9 +326,11 @@ custom_edit_url: null
|
|
|
325
326
|
// const deserialize = (s: any) => {
|
|
326
327
|
// return zlib.inflateSync(Buffer.from(s, "base64")).toString();
|
|
327
328
|
// };
|
|
328
|
-
|
|
329
|
-
.
|
|
330
|
-
.
|
|
329
|
+
disableCompression === true
|
|
330
|
+
? (item.json = JSON.stringify(item.api))
|
|
331
|
+
: (item.json = zlib
|
|
332
|
+
.deflateSync(JSON.stringify(item.api))
|
|
333
|
+
.toString("base64"));
|
|
331
334
|
let infoBasePath = `${outputDir}/${item.infoId}`;
|
|
332
335
|
if (docRouteBasePath) {
|
|
333
336
|
infoBasePath = `${docRouteBasePath}/${outputDir
|
package/src/options.ts
CHANGED
|
@@ -39,6 +39,7 @@ export const OptionsSchema = Joi.object({
|
|
|
39
39
|
sidebarOptions: sidebarOptions,
|
|
40
40
|
markdownGenerators: markdownGenerators,
|
|
41
41
|
showSchemas: Joi.boolean(),
|
|
42
|
+
disableCompression: Joi.boolean(),
|
|
42
43
|
version: Joi.string().when("versions", {
|
|
43
44
|
is: Joi.exist(),
|
|
44
45
|
then: Joi.required(),
|