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 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
- item.json = zlib_1.default
239
- .deflateSync(JSON.stringify(item.api))
240
- .toString("base64");
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
@@ -26,6 +26,7 @@ export interface APIOptions {
26
26
  proxy?: string;
27
27
  markdownGenerators?: MarkdownGenerator;
28
28
  showSchemas?: boolean;
29
+ disableCompression?: boolean;
29
30
  }
30
31
  export interface MarkdownGenerator {
31
32
  createApiPageMD?: (pageData: ApiPageMetadata) => string;
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.724",
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": "76903beba80972a5bcd88c74a33dc5e4bbbaa631"
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
- item.json = zlib
329
- .deflateSync(JSON.stringify(item.api))
330
- .toString("base64");
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(),
package/src/types.ts CHANGED
@@ -47,6 +47,7 @@ export interface APIOptions {
47
47
  proxy?: string;
48
48
  markdownGenerators?: MarkdownGenerator;
49
49
  showSchemas?: boolean;
50
+ disableCompression?: boolean;
50
51
  }
51
52
 
52
53
  export interface MarkdownGenerator {