@mintlify/scraping 4.0.924 → 4.0.926
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.
|
|
3
|
+
"version": "4.0.926",
|
|
4
4
|
"description": "Scrape documentation frameworks to Mintlify docs",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0"
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"typescript": "5.5.3",
|
|
80
80
|
"vitest": "2.1.9"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "85b09731ac479fa1c19868509b7f48e567933e6e"
|
|
83
83
|
}
|
package/src/openapi/common.ts
CHANGED
|
@@ -120,6 +120,7 @@ export type GenerateOpenApiPagesOptions = {
|
|
|
120
120
|
writeFiles?: boolean;
|
|
121
121
|
outDir?: string;
|
|
122
122
|
outDirBasePath?: string;
|
|
123
|
+
mountPath?: string;
|
|
123
124
|
overwrite?: boolean;
|
|
124
125
|
localSchema?: boolean;
|
|
125
126
|
writeFile?: (filename: string, content: string) => void | Promise<void>;
|
|
@@ -157,11 +158,13 @@ export function processOpenApiPath<N, DN>(
|
|
|
157
158
|
options: GenerateOpenApiPagesOptions,
|
|
158
159
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
159
160
|
findNavGroup: (nav: any, groupName?: string) => any
|
|
160
|
-
) {
|
|
161
|
+
): string[] {
|
|
161
162
|
const openApiFilePathFromRoot = options.openApiFilePath
|
|
162
163
|
? optionallyAddLeadingSlash(options.openApiFilePath)
|
|
163
164
|
: undefined;
|
|
164
165
|
|
|
166
|
+
const generatedSlugs: string[] = [];
|
|
167
|
+
|
|
165
168
|
Object.values(OpenAPIV3.HttpMethods).forEach((method) => {
|
|
166
169
|
if (method in pathItemObject) {
|
|
167
170
|
const operation = pathItemObject[method];
|
|
@@ -191,7 +194,7 @@ export function processOpenApiPath<N, DN>(
|
|
|
191
194
|
const slug = optionallyRemoveLeadingSlash(xMint.href);
|
|
192
195
|
title = posix.parse(slug).name;
|
|
193
196
|
folder = posix.parse(slug).dir;
|
|
194
|
-
base = posix.join(folder, title);
|
|
197
|
+
base = posix.join(options.mountPath ?? '', folder, title);
|
|
195
198
|
}
|
|
196
199
|
|
|
197
200
|
const navGroup = findNavGroup(nav, groupName);
|
|
@@ -249,6 +252,7 @@ export function processOpenApiPath<N, DN>(
|
|
|
249
252
|
decoratedNavGroup.push(page);
|
|
250
253
|
}
|
|
251
254
|
pagesAcc[filenameWithoutExtension] = page;
|
|
255
|
+
generatedSlugs.push(filenameWithoutExtension);
|
|
252
256
|
|
|
253
257
|
if (!options.writeFiles) {
|
|
254
258
|
registerXMintContent(filenameWithoutExtension, xMint?.content);
|
|
@@ -273,6 +277,8 @@ export function processOpenApiPath<N, DN>(
|
|
|
273
277
|
}
|
|
274
278
|
}
|
|
275
279
|
});
|
|
280
|
+
|
|
281
|
+
return generatedSlugs;
|
|
276
282
|
}
|
|
277
283
|
|
|
278
284
|
export function processOpenApiWebhook<N, DN>(
|
|
@@ -286,11 +292,13 @@ export function processOpenApiWebhook<N, DN>(
|
|
|
286
292
|
options: GenerateOpenApiPagesOptions,
|
|
287
293
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
288
294
|
findNavGroup: (nav: any, groupName?: string) => any
|
|
289
|
-
) {
|
|
295
|
+
): string[] {
|
|
290
296
|
const openApiFilePathFromRoot = options.openApiFilePath
|
|
291
297
|
? optionallyAddLeadingSlash(options.openApiFilePath)
|
|
292
298
|
: undefined;
|
|
293
299
|
|
|
300
|
+
const generatedSlugs: string[] = [];
|
|
301
|
+
|
|
294
302
|
Object.values(OpenAPIV3.HttpMethods).forEach((method) => {
|
|
295
303
|
if (method in webhookObject) {
|
|
296
304
|
const operation = webhookObject[method];
|
|
@@ -315,7 +323,7 @@ export function processOpenApiWebhook<N, DN>(
|
|
|
315
323
|
const slug = optionallyRemoveLeadingSlash(xMint.href);
|
|
316
324
|
title = posix.parse(slug).name;
|
|
317
325
|
folder = posix.parse(slug).dir;
|
|
318
|
-
base = posix.join(folder, title);
|
|
326
|
+
base = posix.join(options.mountPath ?? '', folder, title);
|
|
319
327
|
}
|
|
320
328
|
|
|
321
329
|
const navGroup = findNavGroup(nav, groupName);
|
|
@@ -344,6 +352,7 @@ export function processOpenApiWebhook<N, DN>(
|
|
|
344
352
|
decoratedNavGroup.push(page);
|
|
345
353
|
}
|
|
346
354
|
pagesAcc[filenameWithoutExtension] = page;
|
|
355
|
+
generatedSlugs.push(filenameWithoutExtension);
|
|
347
356
|
|
|
348
357
|
if (!options.writeFiles) {
|
|
349
358
|
registerXMintContent(filenameWithoutExtension, xMint?.content);
|
|
@@ -368,6 +377,8 @@ export function processOpenApiWebhook<N, DN>(
|
|
|
368
377
|
}
|
|
369
378
|
}
|
|
370
379
|
});
|
|
380
|
+
|
|
381
|
+
return generatedSlugs;
|
|
371
382
|
}
|
|
372
383
|
|
|
373
384
|
export const getXMintGroups = ({
|