docusaurus-plugin-openapi-docs 0.0.0-718 → 0.0.0-719
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
|
@@ -77,7 +77,7 @@ function pluginOpenAPIDocs(context, options) {
|
|
|
77
77
|
let docPath = docData ? (docData.path ? docData.path : "docs") : undefined;
|
|
78
78
|
async function generateApiDocs(options, pluginId) {
|
|
79
79
|
var _a, _b, _c, _d;
|
|
80
|
-
let { specPath, outputDir, template, markdownGenerators, downloadUrl, sidebarOptions, } = options;
|
|
80
|
+
let { specPath, outputDir, template, markdownGenerators, downloadUrl, sidebarOptions, disableCompression, } = options;
|
|
81
81
|
// Remove trailing slash before proceeding
|
|
82
82
|
outputDir = outputDir.replace(/\/$/, "");
|
|
83
83
|
// Override docPath if pluginId provided
|
|
@@ -232,9 +232,11 @@ custom_edit_url: null
|
|
|
232
232
|
// const deserialize = (s: any) => {
|
|
233
233
|
// return zlib.inflateSync(Buffer.from(s, "base64")).toString();
|
|
234
234
|
// };
|
|
235
|
-
|
|
236
|
-
.
|
|
237
|
-
.
|
|
235
|
+
disableCompression === true
|
|
236
|
+
? (item.json = JSON.stringify(item.api))
|
|
237
|
+
: (item.json = zlib_1.default
|
|
238
|
+
.deflateSync(JSON.stringify(item.api))
|
|
239
|
+
.toString("base64"));
|
|
238
240
|
let infoBasePath = `${outputDir}/${item.infoId}`;
|
|
239
241
|
if (docRouteBasePath) {
|
|
240
242
|
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-
|
|
4
|
+
"version": "0.0.0-719",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=14"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "394b993eef86d61d9e5494a91f34b7fb0ecb5cb3"
|
|
64
64
|
}
|
package/src/index.ts
CHANGED
|
@@ -119,6 +119,7 @@ export default function pluginOpenAPIDocs(
|
|
|
119
119
|
markdownGenerators,
|
|
120
120
|
downloadUrl,
|
|
121
121
|
sidebarOptions,
|
|
122
|
+
disableCompression,
|
|
122
123
|
} = options;
|
|
123
124
|
|
|
124
125
|
// Remove trailing slash before proceeding
|
|
@@ -319,9 +320,11 @@ custom_edit_url: null
|
|
|
319
320
|
// const deserialize = (s: any) => {
|
|
320
321
|
// return zlib.inflateSync(Buffer.from(s, "base64")).toString();
|
|
321
322
|
// };
|
|
322
|
-
|
|
323
|
-
.
|
|
324
|
-
.
|
|
323
|
+
disableCompression === true
|
|
324
|
+
? (item.json = JSON.stringify(item.api))
|
|
325
|
+
: (item.json = zlib
|
|
326
|
+
.deflateSync(JSON.stringify(item.api))
|
|
327
|
+
.toString("base64"));
|
|
325
328
|
let infoBasePath = `${outputDir}/${item.infoId}`;
|
|
326
329
|
if (docRouteBasePath) {
|
|
327
330
|
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(),
|