@mintlify/prebuild 1.0.1284 → 1.0.1286

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,4 +1,4 @@
1
- import { AsyncAPIFile } from '@mintlify/common';
1
+ import { AsyncAPIFile, type OverlayRegistry } from '@mintlify/common';
2
2
  import type { OpenApiFile } from '@mintlify/models';
3
3
  import type { Root } from 'mdast';
4
4
  import type { PageScan } from '../categorizeFilePaths.js';
@@ -23,8 +23,9 @@ type UpdateArgs = {
23
23
  lazyPages?: boolean;
24
24
  pageScans?: Map<string, PageScan>;
25
25
  fileImportsMap?: Map<string, Set<string>>;
26
+ overlayRegistry?: OverlayRegistry;
26
27
  };
27
- export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFiles, asyncApiFiles, contentFilenames, snippets, snippetV2Filenames, docsConfigPath, localSchema, groups, mintIgnore, disableOpenApi, disablePrefetch, strict, invalidSpecFiles, allowSourceRefs, lazyPages, pageScans, fileImportsMap, }: UpdateArgs) => Promise<{
28
+ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFiles, asyncApiFiles, contentFilenames, snippets, snippetV2Filenames, docsConfigPath, localSchema, groups, mintIgnore, disableOpenApi, disablePrefetch, strict, invalidSpecFiles, allowSourceRefs, lazyPages, pageScans, fileImportsMap, overlayRegistry, }: UpdateArgs) => Promise<{
28
29
  name: string;
29
30
  $schema: string;
30
31
  theme: "mint";
@@ -88,10 +89,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
88
89
  sdk?: undefined;
89
90
  root?: string | undefined;
90
91
  }, "sdk"> & {
91
- openapi?: string | string[] | {
92
+ openapi?: string | {
92
93
  source: string;
93
94
  directory?: string | undefined;
94
- } | undefined;
95
+ overlays?: string[] | undefined;
96
+ } | (string | {
97
+ source: string;
98
+ directory?: string | undefined;
99
+ overlays?: string[] | undefined;
100
+ })[] | undefined;
95
101
  asyncapi?: string | string[] | {
96
102
  source: string;
97
103
  directory?: string | undefined;
@@ -123,10 +129,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
123
129
  sdk?: undefined;
124
130
  root?: string | undefined;
125
131
  }, "sdk"> & {
126
- openapi?: string | string[] | {
132
+ openapi?: string | {
127
133
  source: string;
128
134
  directory?: string | undefined;
129
- } | undefined;
135
+ overlays?: string[] | undefined;
136
+ } | (string | {
137
+ source: string;
138
+ directory?: string | undefined;
139
+ overlays?: string[] | undefined;
140
+ })[] | undefined;
130
141
  asyncapi?: string | string[] | {
131
142
  source: string;
132
143
  directory?: string | undefined;
@@ -167,10 +178,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
167
178
  post?: string[] | undefined;
168
179
  } | undefined;
169
180
  url?: "full" | undefined;
170
- openapi?: string | string[] | {
181
+ openapi?: string | {
171
182
  source: string;
172
183
  directory?: string | undefined;
173
- } | undefined;
184
+ overlays?: string[] | undefined;
185
+ } | (string | {
186
+ source: string;
187
+ directory?: string | undefined;
188
+ overlays?: string[] | undefined;
189
+ })[] | undefined;
174
190
  playground?: {
175
191
  display?: "auth" | "simple" | "none" | "interactive" | undefined;
176
192
  proxy?: boolean | undefined;
@@ -507,10 +523,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
507
523
  sdk?: undefined;
508
524
  root?: string | undefined;
509
525
  }, "sdk"> & {
510
- openapi?: string | string[] | {
526
+ openapi?: string | {
511
527
  source: string;
512
528
  directory?: string | undefined;
513
- } | undefined;
529
+ overlays?: string[] | undefined;
530
+ } | (string | {
531
+ source: string;
532
+ directory?: string | undefined;
533
+ overlays?: string[] | undefined;
534
+ })[] | undefined;
514
535
  asyncapi?: string | string[] | {
515
536
  source: string;
516
537
  directory?: string | undefined;
@@ -542,10 +563,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
542
563
  sdk?: undefined;
543
564
  root?: string | undefined;
544
565
  }, "sdk"> & {
545
- openapi?: string | string[] | {
566
+ openapi?: string | {
546
567
  source: string;
547
568
  directory?: string | undefined;
548
- } | undefined;
569
+ overlays?: string[] | undefined;
570
+ } | (string | {
571
+ source: string;
572
+ directory?: string | undefined;
573
+ overlays?: string[] | undefined;
574
+ })[] | undefined;
549
575
  asyncapi?: string | string[] | {
550
576
  source: string;
551
577
  directory?: string | undefined;
@@ -586,10 +612,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
586
612
  post?: string[] | undefined;
587
613
  } | undefined;
588
614
  url?: "full" | undefined;
589
- openapi?: string | string[] | {
615
+ openapi?: string | {
590
616
  source: string;
591
617
  directory?: string | undefined;
592
- } | undefined;
618
+ overlays?: string[] | undefined;
619
+ } | (string | {
620
+ source: string;
621
+ directory?: string | undefined;
622
+ overlays?: string[] | undefined;
623
+ })[] | undefined;
593
624
  playground?: {
594
625
  display?: "auth" | "simple" | "none" | "interactive" | undefined;
595
626
  proxy?: boolean | undefined;
@@ -926,10 +957,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
926
957
  sdk?: undefined;
927
958
  root?: string | undefined;
928
959
  }, "sdk"> & {
929
- openapi?: string | string[] | {
960
+ openapi?: string | {
930
961
  source: string;
931
962
  directory?: string | undefined;
932
- } | undefined;
963
+ overlays?: string[] | undefined;
964
+ } | (string | {
965
+ source: string;
966
+ directory?: string | undefined;
967
+ overlays?: string[] | undefined;
968
+ })[] | undefined;
933
969
  asyncapi?: string | string[] | {
934
970
  source: string;
935
971
  directory?: string | undefined;
@@ -961,10 +997,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
961
997
  sdk?: undefined;
962
998
  root?: string | undefined;
963
999
  }, "sdk"> & {
964
- openapi?: string | string[] | {
1000
+ openapi?: string | {
965
1001
  source: string;
966
1002
  directory?: string | undefined;
967
- } | undefined;
1003
+ overlays?: string[] | undefined;
1004
+ } | (string | {
1005
+ source: string;
1006
+ directory?: string | undefined;
1007
+ overlays?: string[] | undefined;
1008
+ })[] | undefined;
968
1009
  asyncapi?: string | string[] | {
969
1010
  source: string;
970
1011
  directory?: string | undefined;
@@ -1005,10 +1046,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
1005
1046
  post?: string[] | undefined;
1006
1047
  } | undefined;
1007
1048
  url?: "full" | undefined;
1008
- openapi?: string | string[] | {
1049
+ openapi?: string | {
1009
1050
  source: string;
1010
1051
  directory?: string | undefined;
1011
- } | undefined;
1052
+ overlays?: string[] | undefined;
1053
+ } | (string | {
1054
+ source: string;
1055
+ directory?: string | undefined;
1056
+ overlays?: string[] | undefined;
1057
+ })[] | undefined;
1012
1058
  playground?: {
1013
1059
  display?: "auth" | "simple" | "none" | "interactive" | undefined;
1014
1060
  proxy?: boolean | undefined;
@@ -1345,10 +1391,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
1345
1391
  sdk?: undefined;
1346
1392
  root?: string | undefined;
1347
1393
  }, "sdk"> & {
1348
- openapi?: string | string[] | {
1394
+ openapi?: string | {
1349
1395
  source: string;
1350
1396
  directory?: string | undefined;
1351
- } | undefined;
1397
+ overlays?: string[] | undefined;
1398
+ } | (string | {
1399
+ source: string;
1400
+ directory?: string | undefined;
1401
+ overlays?: string[] | undefined;
1402
+ })[] | undefined;
1352
1403
  asyncapi?: string | string[] | {
1353
1404
  source: string;
1354
1405
  directory?: string | undefined;
@@ -1380,10 +1431,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
1380
1431
  sdk?: undefined;
1381
1432
  root?: string | undefined;
1382
1433
  }, "sdk"> & {
1383
- openapi?: string | string[] | {
1434
+ openapi?: string | {
1384
1435
  source: string;
1385
1436
  directory?: string | undefined;
1386
- } | undefined;
1437
+ overlays?: string[] | undefined;
1438
+ } | (string | {
1439
+ source: string;
1440
+ directory?: string | undefined;
1441
+ overlays?: string[] | undefined;
1442
+ })[] | undefined;
1387
1443
  asyncapi?: string | string[] | {
1388
1444
  source: string;
1389
1445
  directory?: string | undefined;
@@ -1424,10 +1480,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
1424
1480
  post?: string[] | undefined;
1425
1481
  } | undefined;
1426
1482
  url?: "full" | undefined;
1427
- openapi?: string | string[] | {
1483
+ openapi?: string | {
1428
1484
  source: string;
1429
1485
  directory?: string | undefined;
1430
- } | undefined;
1486
+ overlays?: string[] | undefined;
1487
+ } | (string | {
1488
+ source: string;
1489
+ directory?: string | undefined;
1490
+ overlays?: string[] | undefined;
1491
+ })[] | undefined;
1431
1492
  playground?: {
1432
1493
  display?: "auth" | "simple" | "none" | "interactive" | undefined;
1433
1494
  proxy?: boolean | undefined;
@@ -1770,10 +1831,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
1770
1831
  sdk?: undefined;
1771
1832
  root?: string | undefined;
1772
1833
  }, "sdk"> & {
1773
- openapi?: string | string[] | {
1834
+ openapi?: string | {
1774
1835
  source: string;
1775
1836
  directory?: string | undefined;
1776
- } | undefined;
1837
+ overlays?: string[] | undefined;
1838
+ } | (string | {
1839
+ source: string;
1840
+ directory?: string | undefined;
1841
+ overlays?: string[] | undefined;
1842
+ })[] | undefined;
1777
1843
  asyncapi?: string | string[] | {
1778
1844
  source: string;
1779
1845
  directory?: string | undefined;
@@ -1805,10 +1871,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
1805
1871
  sdk?: undefined;
1806
1872
  root?: string | undefined;
1807
1873
  }, "sdk"> & {
1808
- openapi?: string | string[] | {
1874
+ openapi?: string | {
1809
1875
  source: string;
1810
1876
  directory?: string | undefined;
1811
- } | undefined;
1877
+ overlays?: string[] | undefined;
1878
+ } | (string | {
1879
+ source: string;
1880
+ directory?: string | undefined;
1881
+ overlays?: string[] | undefined;
1882
+ })[] | undefined;
1812
1883
  asyncapi?: string | string[] | {
1813
1884
  source: string;
1814
1885
  directory?: string | undefined;
@@ -1849,10 +1920,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
1849
1920
  post?: string[] | undefined;
1850
1921
  } | undefined;
1851
1922
  url?: "full" | undefined;
1852
- openapi?: string | string[] | {
1923
+ openapi?: string | {
1853
1924
  source: string;
1854
1925
  directory?: string | undefined;
1855
- } | undefined;
1926
+ overlays?: string[] | undefined;
1927
+ } | (string | {
1928
+ source: string;
1929
+ directory?: string | undefined;
1930
+ overlays?: string[] | undefined;
1931
+ })[] | undefined;
1856
1932
  playground?: {
1857
1933
  display?: "auth" | "simple" | "none" | "interactive" | undefined;
1858
1934
  proxy?: boolean | undefined;
@@ -2189,10 +2265,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
2189
2265
  sdk?: undefined;
2190
2266
  root?: string | undefined;
2191
2267
  }, "sdk"> & {
2192
- openapi?: string | string[] | {
2268
+ openapi?: string | {
2193
2269
  source: string;
2194
2270
  directory?: string | undefined;
2195
- } | undefined;
2271
+ overlays?: string[] | undefined;
2272
+ } | (string | {
2273
+ source: string;
2274
+ directory?: string | undefined;
2275
+ overlays?: string[] | undefined;
2276
+ })[] | undefined;
2196
2277
  asyncapi?: string | string[] | {
2197
2278
  source: string;
2198
2279
  directory?: string | undefined;
@@ -2224,10 +2305,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
2224
2305
  sdk?: undefined;
2225
2306
  root?: string | undefined;
2226
2307
  }, "sdk"> & {
2227
- openapi?: string | string[] | {
2308
+ openapi?: string | {
2228
2309
  source: string;
2229
2310
  directory?: string | undefined;
2230
- } | undefined;
2311
+ overlays?: string[] | undefined;
2312
+ } | (string | {
2313
+ source: string;
2314
+ directory?: string | undefined;
2315
+ overlays?: string[] | undefined;
2316
+ })[] | undefined;
2231
2317
  asyncapi?: string | string[] | {
2232
2318
  source: string;
2233
2319
  directory?: string | undefined;
@@ -2268,10 +2354,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
2268
2354
  post?: string[] | undefined;
2269
2355
  } | undefined;
2270
2356
  url?: "full" | undefined;
2271
- openapi?: string | string[] | {
2357
+ openapi?: string | {
2272
2358
  source: string;
2273
2359
  directory?: string | undefined;
2274
- } | undefined;
2360
+ overlays?: string[] | undefined;
2361
+ } | (string | {
2362
+ source: string;
2363
+ directory?: string | undefined;
2364
+ overlays?: string[] | undefined;
2365
+ })[] | undefined;
2275
2366
  playground?: {
2276
2367
  display?: "auth" | "simple" | "none" | "interactive" | undefined;
2277
2368
  proxy?: boolean | undefined;
@@ -2608,10 +2699,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
2608
2699
  sdk?: undefined;
2609
2700
  root?: string | undefined;
2610
2701
  }, "sdk"> & {
2611
- openapi?: string | string[] | {
2702
+ openapi?: string | {
2612
2703
  source: string;
2613
2704
  directory?: string | undefined;
2614
- } | undefined;
2705
+ overlays?: string[] | undefined;
2706
+ } | (string | {
2707
+ source: string;
2708
+ directory?: string | undefined;
2709
+ overlays?: string[] | undefined;
2710
+ })[] | undefined;
2615
2711
  asyncapi?: string | string[] | {
2616
2712
  source: string;
2617
2713
  directory?: string | undefined;
@@ -2643,10 +2739,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
2643
2739
  sdk?: undefined;
2644
2740
  root?: string | undefined;
2645
2741
  }, "sdk"> & {
2646
- openapi?: string | string[] | {
2742
+ openapi?: string | {
2647
2743
  source: string;
2648
2744
  directory?: string | undefined;
2649
- } | undefined;
2745
+ overlays?: string[] | undefined;
2746
+ } | (string | {
2747
+ source: string;
2748
+ directory?: string | undefined;
2749
+ overlays?: string[] | undefined;
2750
+ })[] | undefined;
2650
2751
  asyncapi?: string | string[] | {
2651
2752
  source: string;
2652
2753
  directory?: string | undefined;
@@ -2687,10 +2788,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
2687
2788
  post?: string[] | undefined;
2688
2789
  } | undefined;
2689
2790
  url?: "full" | undefined;
2690
- openapi?: string | string[] | {
2791
+ openapi?: string | {
2691
2792
  source: string;
2692
2793
  directory?: string | undefined;
2693
- } | undefined;
2794
+ overlays?: string[] | undefined;
2795
+ } | (string | {
2796
+ source: string;
2797
+ directory?: string | undefined;
2798
+ overlays?: string[] | undefined;
2799
+ })[] | undefined;
2694
2800
  playground?: {
2695
2801
  display?: "auth" | "simple" | "none" | "interactive" | undefined;
2696
2802
  proxy?: boolean | undefined;
@@ -3027,10 +3133,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
3027
3133
  sdk?: undefined;
3028
3134
  root?: string | undefined;
3029
3135
  }, "sdk"> & {
3030
- openapi?: string | string[] | {
3136
+ openapi?: string | {
3031
3137
  source: string;
3032
3138
  directory?: string | undefined;
3033
- } | undefined;
3139
+ overlays?: string[] | undefined;
3140
+ } | (string | {
3141
+ source: string;
3142
+ directory?: string | undefined;
3143
+ overlays?: string[] | undefined;
3144
+ })[] | undefined;
3034
3145
  asyncapi?: string | string[] | {
3035
3146
  source: string;
3036
3147
  directory?: string | undefined;
@@ -3062,10 +3173,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
3062
3173
  sdk?: undefined;
3063
3174
  root?: string | undefined;
3064
3175
  }, "sdk"> & {
3065
- openapi?: string | string[] | {
3176
+ openapi?: string | {
3066
3177
  source: string;
3067
3178
  directory?: string | undefined;
3068
- } | undefined;
3179
+ overlays?: string[] | undefined;
3180
+ } | (string | {
3181
+ source: string;
3182
+ directory?: string | undefined;
3183
+ overlays?: string[] | undefined;
3184
+ })[] | undefined;
3069
3185
  asyncapi?: string | string[] | {
3070
3186
  source: string;
3071
3187
  directory?: string | undefined;
@@ -3106,10 +3222,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
3106
3222
  post?: string[] | undefined;
3107
3223
  } | undefined;
3108
3224
  url?: "full" | undefined;
3109
- openapi?: string | string[] | {
3225
+ openapi?: string | {
3110
3226
  source: string;
3111
3227
  directory?: string | undefined;
3112
- } | undefined;
3228
+ overlays?: string[] | undefined;
3229
+ } | (string | {
3230
+ source: string;
3231
+ directory?: string | undefined;
3232
+ overlays?: string[] | undefined;
3233
+ })[] | undefined;
3113
3234
  playground?: {
3114
3235
  display?: "auth" | "simple" | "none" | "interactive" | undefined;
3115
3236
  proxy?: boolean | undefined;
@@ -3446,10 +3567,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
3446
3567
  sdk?: undefined;
3447
3568
  root?: string | undefined;
3448
3569
  }, "sdk"> & {
3449
- openapi?: string | string[] | {
3570
+ openapi?: string | {
3450
3571
  source: string;
3451
3572
  directory?: string | undefined;
3452
- } | undefined;
3573
+ overlays?: string[] | undefined;
3574
+ } | (string | {
3575
+ source: string;
3576
+ directory?: string | undefined;
3577
+ overlays?: string[] | undefined;
3578
+ })[] | undefined;
3453
3579
  asyncapi?: string | string[] | {
3454
3580
  source: string;
3455
3581
  directory?: string | undefined;
@@ -3481,10 +3607,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
3481
3607
  sdk?: undefined;
3482
3608
  root?: string | undefined;
3483
3609
  }, "sdk"> & {
3484
- openapi?: string | string[] | {
3610
+ openapi?: string | {
3485
3611
  source: string;
3486
3612
  directory?: string | undefined;
3487
- } | undefined;
3613
+ overlays?: string[] | undefined;
3614
+ } | (string | {
3615
+ source: string;
3616
+ directory?: string | undefined;
3617
+ overlays?: string[] | undefined;
3618
+ })[] | undefined;
3488
3619
  asyncapi?: string | string[] | {
3489
3620
  source: string;
3490
3621
  directory?: string | undefined;
@@ -3525,10 +3656,15 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
3525
3656
  post?: string[] | undefined;
3526
3657
  } | undefined;
3527
3658
  url?: "full" | undefined;
3528
- openapi?: string | string[] | {
3659
+ openapi?: string | {
3529
3660
  source: string;
3530
3661
  directory?: string | undefined;
3531
- } | undefined;
3662
+ overlays?: string[] | undefined;
3663
+ } | (string | {
3664
+ source: string;
3665
+ directory?: string | undefined;
3666
+ overlays?: string[] | undefined;
3667
+ })[] | undefined;
3532
3668
  playground?: {
3533
3669
  display?: "auth" | "simple" | "none" | "interactive" | undefined;
3534
3670
  proxy?: boolean | undefined;
@@ -58,7 +58,7 @@ const filterToImportClosure = (snippetV2Filenames, rootFilenames, fileImportsMap
58
58
  }
59
59
  return snippetV2Filenames.filter((filename) => needed.has(filename.toLowerCase()));
60
60
  };
61
- export const update = async ({ contentDirectoryPath, staticFilenames, openApiFiles, asyncApiFiles, contentFilenames, snippets, snippetV2Filenames, docsConfigPath, localSchema, groups, mintIgnore, disableOpenApi, disablePrefetch, strict, invalidSpecFiles, allowSourceRefs, lazyPages, pageScans, fileImportsMap, }) => {
61
+ export const update = async ({ contentDirectoryPath, staticFilenames, openApiFiles, asyncApiFiles, contentFilenames, snippets, snippetV2Filenames, docsConfigPath, localSchema, groups, mintIgnore, disableOpenApi, disablePrefetch, strict, invalidSpecFiles, allowSourceRefs, lazyPages, pageScans, fileImportsMap, overlayRegistry, }) => {
62
62
  const mintConfigResult = await updateMintConfigFile(contentDirectoryPath, openApiFiles, localSchema, strict, invalidSpecFiles);
63
63
  // we used the original mint config without openapi pages injected
64
64
  // because we will do it in `updateDocsConfigFile`, this will avoid duplicated openapi pages
@@ -73,6 +73,7 @@ export const update = async ({ contentDirectoryPath, staticFilenames, openApiFil
73
73
  strict,
74
74
  invalidSpecFiles,
75
75
  allowSourceRefs,
76
+ overlayRegistry,
76
77
  });
77
78
  let contentFilenamesToParse = contentFilenames;
78
79
  if (lazyPages) {
@@ -1,5 +1,6 @@
1
+ import { type OverlayRegistry } from '@mintlify/common';
1
2
  import type { ConfigType, MintConfig, OpenApiFile } from '@mintlify/models';
2
3
  import { DocsConfig } from '@mintlify/validation';
3
4
  type ConfigInput<T extends ConfigType> = T extends 'docs' ? DocsConfig : MintConfig;
4
- export declare const getOpenApiFilesFromConfig: <T extends ConfigType>(type: T, config: ConfigInput<T>, localSchema?: boolean) => Promise<OpenApiFile[]>;
5
+ export declare const getOpenApiFilesFromConfig: <T extends ConfigType>(type: T, config: ConfigInput<T>, localSchema?: boolean, overlayRegistry?: OverlayRegistry, fetchRemoteDocument?: (url: string) => Promise<unknown>) => Promise<OpenApiFile[]>;
5
6
  export {};
@@ -1,5 +1,6 @@
1
- import { getOpenApiDocumentFromUrl, isAllowedLocalSchemaUrl } from '@mintlify/common';
2
- export const getOpenApiFilesFromConfig = async (type, config, localSchema) => {
1
+ import { getOpenApiDocumentFromUrl, isAllowedLocalSchemaUrl, resolveOverlaysForSpec, } from '@mintlify/common';
2
+ import { extractOpenApiEntries } from '@mintlify/validation';
3
+ export const getOpenApiFilesFromConfig = async (type, config, localSchema, overlayRegistry, fetchRemoteDocument) => {
3
4
  let openapi;
4
5
  if (type === 'docs') {
5
6
  openapi = config.api?.openapi;
@@ -10,28 +11,19 @@ export const getOpenApiFilesFromConfig = async (type, config, localSchema) => {
10
11
  const openApiFiles = [];
11
12
  // Download OpenApi file if url is provided
12
13
  async function addOpenApiFileFromUrl(openapi) {
13
- const specFromUrl = await getOpenApiDocumentFromUrl(openapi);
14
+ const overlays = overlayRegistry
15
+ ? await resolveOverlaysForSpec(overlayRegistry, openapi)
16
+ : undefined;
17
+ const specFromUrl = await getOpenApiDocumentFromUrl(openapi, { overlays, fetchRemoteDocument });
14
18
  openApiFiles.push({
15
19
  filename: openapi,
16
20
  spec: specFromUrl,
17
21
  originalFileLocation: openapi,
18
22
  });
19
23
  }
20
- if (openapi) {
21
- if (typeof openapi === 'string' && isAllowedLocalSchemaUrl(openapi, localSchema)) {
22
- await addOpenApiFileFromUrl(openapi);
23
- }
24
- else if (Array.isArray(openapi)) {
25
- for (const openapiUrl of openapi) {
26
- if (typeof openapiUrl === 'string' && isAllowedLocalSchemaUrl(openapiUrl, localSchema)) {
27
- await addOpenApiFileFromUrl(openapiUrl);
28
- }
29
- }
30
- }
31
- else if (typeof openapi === 'object' &&
32
- 'source' in openapi &&
33
- isAllowedLocalSchemaUrl(openapi.source, localSchema)) {
34
- await addOpenApiFileFromUrl(openapi.source);
24
+ for (const entry of extractOpenApiEntries(openapi)) {
25
+ if (isAllowedLocalSchemaUrl(entry.source, localSchema)) {
26
+ await addOpenApiFileFromUrl(entry.source);
35
27
  }
36
28
  }
37
29
  return openApiFiles;