@mintlify/scraping 4.0.370 → 4.0.372

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.370",
3
+ "version": "4.0.372",
4
4
  "description": "Scrape documentation frameworks to Mintlify docs",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -38,7 +38,7 @@
38
38
  "format:check": "prettier . --check"
39
39
  },
40
40
  "dependencies": {
41
- "@mintlify/common": "1.0.511",
41
+ "@mintlify/common": "1.0.513",
42
42
  "@mintlify/openapi-parser": "^0.0.7",
43
43
  "fs-extra": "^11.1.1",
44
44
  "hast-util-to-mdast": "^10.1.0",
@@ -61,7 +61,7 @@
61
61
  "@mintlify/models": "0.0.224",
62
62
  "@mintlify/prettier-config": "1.0.4",
63
63
  "@mintlify/ts-config": "2.0.2",
64
- "@mintlify/validation": "0.1.453",
64
+ "@mintlify/validation": "0.1.455",
65
65
  "@trivago/prettier-plugin-sort-imports": "^4.2.1",
66
66
  "@tsconfig/recommended": "1.x",
67
67
  "@types/hast": "^3.0.4",
@@ -77,5 +77,5 @@
77
77
  "typescript": "^5.5.3",
78
78
  "vitest": "^2.0.4"
79
79
  },
80
- "gitHead": "b2ca742d8f38891a6d63012ccbac27748c03fa64"
80
+ "gitHead": "99ed9166c5b20fdd66497b05b6e86e06da80908f"
81
81
  }
@@ -27,9 +27,6 @@ export type OpenApiExtensions = {
27
27
  'x-mint'?: XMint;
28
28
  'x-excluded'?: boolean;
29
29
  'x-hidden'?: boolean;
30
- 'x-private'?: string;
31
- 'x-for-clients'?: string[];
32
- 'x-for-feature-flags'?: string[];
33
30
  };
34
31
 
35
32
  export const getOpenApiDefinition = async (
@@ -163,7 +160,7 @@ export function processOpenApiPath<N, DN>(
163
160
  return;
164
161
  }
165
162
  const xMint = operation?.['x-mint'];
166
- const xAuthGroups = getXCustomTagsAllowlist({
163
+ const xMintGroups = getXMintGroups({
167
164
  pathObject: pathItemObject,
168
165
  operationObject: operation,
169
166
  });
@@ -211,12 +208,12 @@ export function processOpenApiPath<N, DN>(
211
208
  );
212
209
 
213
210
  let xMintMetadata = xMint?.metadata;
214
- if (xAuthGroups.length > 0) {
211
+ if (xMintGroups.length > 0) {
215
212
  xMintMetadata = {
216
213
  ...xMintMetadata,
217
214
  groups: [
218
215
  ...(Array.isArray(xMintMetadata?.groups) ? xMintMetadata.groups : []),
219
- ...xAuthGroups,
216
+ ...xMintGroups,
220
217
  ],
221
218
  };
222
219
  }
@@ -352,7 +349,7 @@ export function processOpenApiWebhook<N, DN>(
352
349
  });
353
350
  }
354
351
 
355
- export const getXCustomTagsAllowlist = ({
352
+ export const getXMintGroups = ({
356
353
  pathObject,
357
354
  operationObject,
358
355
  }: {
@@ -360,40 +357,25 @@ export const getXCustomTagsAllowlist = ({
360
357
  operationObject: OpenAPIV3.OperationObject<OpenApiExtensions> | undefined;
361
358
  }): string[] => {
362
359
  const allowedGroups: string[] = [];
363
- if ('x-private' in pathObject && typeof pathObject['x-private'] === 'string') {
364
- allowedGroups.push(pathObject['x-private']);
365
- }
366
-
367
- if (
368
- operationObject &&
369
- 'x-private' in operationObject &&
370
- typeof operationObject['x-private'] === 'string'
371
- ) {
372
- allowedGroups.push(operationObject['x-private']);
373
- }
374
-
375
- if ('x-for-clients' in pathObject && Array.isArray(pathObject['x-for-clients'])) {
376
- allowedGroups.push(...pathObject['x-for-clients']);
377
- }
378
-
379
360
  if (
380
- operationObject &&
381
- 'x-for-clients' in operationObject &&
382
- Array.isArray(operationObject['x-for-clients'])
361
+ 'x-mint' in pathObject &&
362
+ pathObject['x-mint'] &&
363
+ typeof pathObject['x-mint'] === 'object' &&
364
+ 'groups' in pathObject['x-mint'] &&
365
+ Array.isArray(pathObject['x-mint'].groups)
383
366
  ) {
384
- allowedGroups.push(...operationObject['x-for-clients']);
385
- }
386
-
387
- if ('x-for-feature-flags' in pathObject && Array.isArray(pathObject['x-for-feature-flags'])) {
388
- allowedGroups.push(...pathObject['x-for-feature-flags']);
367
+ allowedGroups.push(...pathObject['x-mint'].groups);
389
368
  }
390
369
 
391
370
  if (
392
371
  operationObject &&
393
- 'x-for-feature-flags' in operationObject &&
394
- Array.isArray(operationObject['x-for-feature-flags'])
372
+ 'x-mint' in operationObject &&
373
+ operationObject['x-mint'] &&
374
+ typeof operationObject['x-mint'] === 'object' &&
375
+ 'groups' in operationObject['x-mint'] &&
376
+ Array.isArray(operationObject['x-mint'].groups)
395
377
  ) {
396
- allowedGroups.push(...operationObject['x-for-feature-flags']);
378
+ allowedGroups.push(...operationObject['x-mint'].groups);
397
379
  }
398
380
 
399
381
  return allowedGroups;