@mintlify/scraping 4.0.217 → 4.0.218

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/scraping",
3
- "version": "4.0.217",
3
+ "version": "4.0.218",
4
4
  "description": "Scrape documentation frameworks to Mintlify docs",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -77,5 +77,5 @@
77
77
  "typescript": "^5.5.3",
78
78
  "vitest": "^2.0.4"
79
79
  },
80
- "gitHead": "918aef931fb1aab2686b3443d15549b26f5c1db4"
80
+ "gitHead": "b7a76c366385b89be95303a477df88a2c2ce2b37"
81
81
  }
@@ -77,13 +77,18 @@ export type OpenApiPageGenerationResult<N, DN> = {
77
77
  };
78
78
 
79
79
  type MaybeOperationObjectWithExtensions = OperationObject & {
80
- [`x-hidden`]: boolean;
80
+ [`x-hidden`]?: boolean;
81
+ [`x-excluded`]?: boolean;
81
82
  };
82
83
 
83
84
  const isHiddenOperation = (operation: MaybeOperationObjectWithExtensions) => {
84
85
  return operation['x-hidden'];
85
86
  };
86
87
 
88
+ const isExcludedOperation = (operation: MaybeOperationObjectWithExtensions) => {
89
+ return operation['x-excluded'];
90
+ };
91
+
87
92
  export function processOpenApiPath<N, DN>(
88
93
  path: string,
89
94
  pathItemObject: OpenAPIV3.PathItemObject,
@@ -103,7 +108,7 @@ export function processOpenApiPath<N, DN>(
103
108
  Object.values(OpenAPIV3.HttpMethods).forEach((method) => {
104
109
  if (method in pathItemObject) {
105
110
  const operation = pathItemObject[method];
106
- if (isHiddenOperation(operation as MaybeOperationObjectWithExtensions)) {
111
+ if (isExcludedOperation(operation as MaybeOperationObjectWithExtensions)) {
107
112
  return;
108
113
  }
109
114
  const groupName = operation?.tags?.[0];
@@ -132,7 +137,6 @@ export function processOpenApiPath<N, DN>(
132
137
  ],
133
138
  openapiMetaTag
134
139
  );
135
- navGroup.push(filenameWithoutExtension);
136
140
  const page: DecoratedNavigationPage = {
137
141
  openapi: openapiMetaTag,
138
142
  href: resolve('/', filenameWithoutExtension),
@@ -140,7 +144,11 @@ export function processOpenApiPath<N, DN>(
140
144
  description,
141
145
  version: options.version,
142
146
  };
143
- decoratedNavGroup.push(page);
147
+
148
+ if (!isHiddenOperation(operation as MaybeOperationObjectWithExtensions)) {
149
+ navGroup.push(filenameWithoutExtension);
150
+ decoratedNavGroup.push(page);
151
+ }
144
152
  pagesAcc[filenameWithoutExtension] = page;
145
153
  const targetPath = options.outDirBasePath
146
154
  ? join(options.outDirBasePath, `${filenameWithoutExtension}.mdx`)
@@ -171,7 +179,7 @@ export function processOpenApiWebhook<N, DN>(
171
179
  Object.values(OpenAPIV3.HttpMethods).forEach((method) => {
172
180
  if (method in webhookObject) {
173
181
  const operation = webhookObject[method];
174
- if (isHiddenOperation(operation as MaybeOperationObjectWithExtensions)) {
182
+ if (isExcludedOperation(operation as MaybeOperationObjectWithExtensions)) {
175
183
  return;
176
184
  }
177
185
  const groupName = operation?.tags?.[0];
@@ -192,7 +200,6 @@ export function processOpenApiWebhook<N, DN>(
192
200
 
193
201
  const description = operation?.description;
194
202
 
195
- navGroup.push(filenameWithoutExtension);
196
203
  const page: DecoratedNavigationPage = {
197
204
  openapi: openapiMetaTag,
198
205
  href: resolve('/', filenameWithoutExtension),
@@ -200,7 +207,11 @@ export function processOpenApiWebhook<N, DN>(
200
207
  description,
201
208
  version: options.version,
202
209
  };
203
- decoratedNavGroup.push(page);
210
+
211
+ if (!isHiddenOperation(operation as MaybeOperationObjectWithExtensions)) {
212
+ navGroup.push(filenameWithoutExtension);
213
+ decoratedNavGroup.push(page);
214
+ }
204
215
  pagesAcc[filenameWithoutExtension] = page;
205
216
  const targetPath = options.outDirBasePath
206
217
  ? join(options.outDirBasePath, `${filenameWithoutExtension}.mdx`)