@mintlify/prebuild 1.0.413 → 1.0.415

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.
@@ -1,5 +1,5 @@
1
1
  import { openApiCheck } from '@mintlify/common';
2
- import { asyncApiCheck } from '@mintlify/common/asyncapi';
2
+ import { validateAsyncApi } from '@mintlify/common/asyncapi';
3
3
  import { readFile } from 'fs/promises';
4
4
  import yaml from 'js-yaml';
5
5
  import * as path from 'path';
@@ -31,31 +31,38 @@ export const categorizeFilePaths = async (contentDirectoryPath) => {
31
31
  case 'json':
32
32
  case 'yaml':
33
33
  case 'yml':
34
- try {
35
- // we need to read from the fs so we can store the original spec
36
- const str = await readFile(path.join(contentDirectoryPath, filename), 'utf8');
37
- const obj = yaml.load(str);
38
- const isOpenApi = await openApiCheck(obj);
39
- const isAsyncApi = await asyncApiCheck(obj);
40
- if (!isOpenApi && !isAsyncApi)
41
- break;
42
- const fileName = path.parse(filename).name;
43
- if (isOpenApi) {
44
- openApiFiles.push({
45
- filename: fileName,
46
- spec: obj,
47
- originalFileLocation: filename,
48
- });
34
+ const filePath = path.join(contentDirectoryPath, filename);
35
+ const str = await readFile(filePath, 'utf8');
36
+ const obj = yaml.load(str);
37
+ const isOpenApi = Object.keys(obj).includes('openapi');
38
+ const isAsyncApi = Object.keys(obj).includes('asyncapi');
39
+ const fileName = path.parse(filename).name;
40
+ if (isOpenApi) {
41
+ try {
42
+ const openApiDocument = await openApiCheck(obj);
43
+ if (openApiDocument) {
44
+ openApiFiles.push({
45
+ filename: fileName,
46
+ spec: openApiDocument,
47
+ originalFileLocation: filename,
48
+ });
49
+ }
49
50
  }
50
- if (isAsyncApi) {
51
- asyncApiFiles.push({
52
- filename: fileName,
53
- spec: obj,
54
- originalFileLocation: filename,
55
- });
51
+ catch { }
52
+ }
53
+ if (isAsyncApi) {
54
+ try {
55
+ const { document: asyncApiDocument } = await validateAsyncApi(str);
56
+ if (asyncApiDocument) {
57
+ asyncApiFiles.push({
58
+ filename: fileName,
59
+ spec: asyncApiDocument,
60
+ originalFileLocation: filename,
61
+ });
62
+ }
56
63
  }
64
+ catch { }
57
65
  }
58
- catch { }
59
66
  break;
60
67
  default:
61
68
  staticFilenames.push(filename);
@@ -332,6 +332,16 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
332
332
  content: string;
333
333
  dismissible?: boolean | undefined;
334
334
  } | undefined;
335
+ errors?: {
336
+ "404": {
337
+ redirect: boolean;
338
+ title?: string | undefined;
339
+ description?: string | undefined;
340
+ };
341
+ } | undefined;
342
+ contextual?: {
343
+ options: ("copy" | "view" | "chatgpt" | "claude")[];
344
+ } | undefined;
335
345
  } | {
336
346
  name: string;
337
347
  $schema: string;
@@ -646,6 +656,16 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
646
656
  content: string;
647
657
  dismissible?: boolean | undefined;
648
658
  } | undefined;
659
+ errors?: {
660
+ "404": {
661
+ redirect: boolean;
662
+ title?: string | undefined;
663
+ description?: string | undefined;
664
+ };
665
+ } | undefined;
666
+ contextual?: {
667
+ options: ("copy" | "view" | "chatgpt" | "claude")[];
668
+ } | undefined;
649
669
  } | {
650
670
  name: string;
651
671
  $schema: string;
@@ -960,6 +980,16 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
960
980
  content: string;
961
981
  dismissible?: boolean | undefined;
962
982
  } | undefined;
983
+ errors?: {
984
+ "404": {
985
+ redirect: boolean;
986
+ title?: string | undefined;
987
+ description?: string | undefined;
988
+ };
989
+ } | undefined;
990
+ contextual?: {
991
+ options: ("copy" | "view" | "chatgpt" | "claude")[];
992
+ } | undefined;
963
993
  } | {
964
994
  name: string;
965
995
  $schema: string;
@@ -1274,6 +1304,16 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
1274
1304
  content: string;
1275
1305
  dismissible?: boolean | undefined;
1276
1306
  } | undefined;
1307
+ errors?: {
1308
+ "404": {
1309
+ redirect: boolean;
1310
+ title?: string | undefined;
1311
+ description?: string | undefined;
1312
+ };
1313
+ } | undefined;
1314
+ contextual?: {
1315
+ options: ("copy" | "view" | "chatgpt" | "claude")[];
1316
+ } | undefined;
1277
1317
  } | {
1278
1318
  name: string;
1279
1319
  $schema: string;
@@ -1588,4 +1628,14 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
1588
1628
  content: string;
1589
1629
  dismissible?: boolean | undefined;
1590
1630
  } | undefined;
1631
+ errors?: {
1632
+ "404": {
1633
+ redirect: boolean;
1634
+ title?: string | undefined;
1635
+ description?: string | undefined;
1636
+ };
1637
+ } | undefined;
1638
+ contextual?: {
1639
+ options: ("copy" | "view" | "chatgpt" | "claude")[];
1640
+ } | undefined;
1591
1641
  }>;
@@ -324,6 +324,16 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
324
324
  content: string;
325
325
  dismissible?: boolean | undefined;
326
326
  } | undefined;
327
+ errors?: {
328
+ "404": {
329
+ redirect: boolean;
330
+ title?: string | undefined;
331
+ description?: string | undefined;
332
+ };
333
+ } | undefined;
334
+ contextual?: {
335
+ options: ("copy" | "view" | "chatgpt" | "claude")[];
336
+ } | undefined;
327
337
  } | {
328
338
  name: string;
329
339
  $schema: string;
@@ -638,6 +648,16 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
638
648
  content: string;
639
649
  dismissible?: boolean | undefined;
640
650
  } | undefined;
651
+ errors?: {
652
+ "404": {
653
+ redirect: boolean;
654
+ title?: string | undefined;
655
+ description?: string | undefined;
656
+ };
657
+ } | undefined;
658
+ contextual?: {
659
+ options: ("copy" | "view" | "chatgpt" | "claude")[];
660
+ } | undefined;
641
661
  } | {
642
662
  name: string;
643
663
  $schema: string;
@@ -952,6 +972,16 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
952
972
  content: string;
953
973
  dismissible?: boolean | undefined;
954
974
  } | undefined;
975
+ errors?: {
976
+ "404": {
977
+ redirect: boolean;
978
+ title?: string | undefined;
979
+ description?: string | undefined;
980
+ };
981
+ } | undefined;
982
+ contextual?: {
983
+ options: ("copy" | "view" | "chatgpt" | "claude")[];
984
+ } | undefined;
955
985
  } | {
956
986
  name: string;
957
987
  $schema: string;
@@ -1266,6 +1296,16 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
1266
1296
  content: string;
1267
1297
  dismissible?: boolean | undefined;
1268
1298
  } | undefined;
1299
+ errors?: {
1300
+ "404": {
1301
+ redirect: boolean;
1302
+ title?: string | undefined;
1303
+ description?: string | undefined;
1304
+ };
1305
+ } | undefined;
1306
+ contextual?: {
1307
+ options: ("copy" | "view" | "chatgpt" | "claude")[];
1308
+ } | undefined;
1269
1309
  } | {
1270
1310
  name: string;
1271
1311
  $schema: string;
@@ -1580,6 +1620,16 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
1580
1620
  content: string;
1581
1621
  dismissible?: boolean | undefined;
1582
1622
  } | undefined;
1623
+ errors?: {
1624
+ "404": {
1625
+ redirect: boolean;
1626
+ title?: string | undefined;
1627
+ description?: string | undefined;
1628
+ };
1629
+ } | undefined;
1630
+ contextual?: {
1631
+ options: ("copy" | "view" | "chatgpt" | "claude")[];
1632
+ } | undefined;
1583
1633
  }>;
1584
1634
  export declare const writeMdxFilesWithNoImports: (mdxFilesWithNoImports: {
1585
1635
  targetPath: string;