@mintlify/prebuild 1.0.1532 → 1.0.1534

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.
@@ -106,10 +106,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
106
106
  openapi?: string | {
107
107
  source: string;
108
108
  directory?: string | undefined;
109
+ slug?: "summary" | "operationId" | undefined;
109
110
  overlays?: string[] | undefined;
110
111
  } | (string | {
111
112
  source: string;
112
113
  directory?: string | undefined;
114
+ slug?: "summary" | "operationId" | undefined;
113
115
  overlays?: string[] | undefined;
114
116
  })[] | undefined;
115
117
  asyncapi?: string | string[] | {
@@ -157,10 +159,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
157
159
  openapi?: string | {
158
160
  source: string;
159
161
  directory?: string | undefined;
162
+ slug?: "summary" | "operationId" | undefined;
160
163
  overlays?: string[] | undefined;
161
164
  } | (string | {
162
165
  source: string;
163
166
  directory?: string | undefined;
167
+ slug?: "summary" | "operationId" | undefined;
164
168
  overlays?: string[] | undefined;
165
169
  })[] | undefined;
166
170
  asyncapi?: string | string[] | {
@@ -208,10 +212,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
208
212
  openapi?: string | {
209
213
  source: string;
210
214
  directory?: string | undefined;
215
+ slug?: "summary" | "operationId" | undefined;
211
216
  overlays?: string[] | undefined;
212
217
  } | (string | {
213
218
  source: string;
214
219
  directory?: string | undefined;
220
+ slug?: "summary" | "operationId" | undefined;
215
221
  overlays?: string[] | undefined;
216
222
  })[] | undefined;
217
223
  playground?: {
@@ -590,10 +596,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
590
596
  openapi?: string | {
591
597
  source: string;
592
598
  directory?: string | undefined;
599
+ slug?: "summary" | "operationId" | undefined;
593
600
  overlays?: string[] | undefined;
594
601
  } | (string | {
595
602
  source: string;
596
603
  directory?: string | undefined;
604
+ slug?: "summary" | "operationId" | undefined;
597
605
  overlays?: string[] | undefined;
598
606
  })[] | undefined;
599
607
  asyncapi?: string | string[] | {
@@ -641,10 +649,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
641
649
  openapi?: string | {
642
650
  source: string;
643
651
  directory?: string | undefined;
652
+ slug?: "summary" | "operationId" | undefined;
644
653
  overlays?: string[] | undefined;
645
654
  } | (string | {
646
655
  source: string;
647
656
  directory?: string | undefined;
657
+ slug?: "summary" | "operationId" | undefined;
648
658
  overlays?: string[] | undefined;
649
659
  })[] | undefined;
650
660
  asyncapi?: string | string[] | {
@@ -692,10 +702,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
692
702
  openapi?: string | {
693
703
  source: string;
694
704
  directory?: string | undefined;
705
+ slug?: "summary" | "operationId" | undefined;
695
706
  overlays?: string[] | undefined;
696
707
  } | (string | {
697
708
  source: string;
698
709
  directory?: string | undefined;
710
+ slug?: "summary" | "operationId" | undefined;
699
711
  overlays?: string[] | undefined;
700
712
  })[] | undefined;
701
713
  playground?: {
@@ -1073,10 +1085,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
1073
1085
  openapi?: string | {
1074
1086
  source: string;
1075
1087
  directory?: string | undefined;
1088
+ slug?: "summary" | "operationId" | undefined;
1076
1089
  overlays?: string[] | undefined;
1077
1090
  } | (string | {
1078
1091
  source: string;
1079
1092
  directory?: string | undefined;
1093
+ slug?: "summary" | "operationId" | undefined;
1080
1094
  overlays?: string[] | undefined;
1081
1095
  })[] | undefined;
1082
1096
  asyncapi?: string | string[] | {
@@ -1124,10 +1138,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
1124
1138
  openapi?: string | {
1125
1139
  source: string;
1126
1140
  directory?: string | undefined;
1141
+ slug?: "summary" | "operationId" | undefined;
1127
1142
  overlays?: string[] | undefined;
1128
1143
  } | (string | {
1129
1144
  source: string;
1130
1145
  directory?: string | undefined;
1146
+ slug?: "summary" | "operationId" | undefined;
1131
1147
  overlays?: string[] | undefined;
1132
1148
  })[] | undefined;
1133
1149
  asyncapi?: string | string[] | {
@@ -1175,10 +1191,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
1175
1191
  openapi?: string | {
1176
1192
  source: string;
1177
1193
  directory?: string | undefined;
1194
+ slug?: "summary" | "operationId" | undefined;
1178
1195
  overlays?: string[] | undefined;
1179
1196
  } | (string | {
1180
1197
  source: string;
1181
1198
  directory?: string | undefined;
1199
+ slug?: "summary" | "operationId" | undefined;
1182
1200
  overlays?: string[] | undefined;
1183
1201
  })[] | undefined;
1184
1202
  playground?: {
@@ -1556,10 +1574,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
1556
1574
  openapi?: string | {
1557
1575
  source: string;
1558
1576
  directory?: string | undefined;
1577
+ slug?: "summary" | "operationId" | undefined;
1559
1578
  overlays?: string[] | undefined;
1560
1579
  } | (string | {
1561
1580
  source: string;
1562
1581
  directory?: string | undefined;
1582
+ slug?: "summary" | "operationId" | undefined;
1563
1583
  overlays?: string[] | undefined;
1564
1584
  })[] | undefined;
1565
1585
  asyncapi?: string | string[] | {
@@ -1607,10 +1627,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
1607
1627
  openapi?: string | {
1608
1628
  source: string;
1609
1629
  directory?: string | undefined;
1630
+ slug?: "summary" | "operationId" | undefined;
1610
1631
  overlays?: string[] | undefined;
1611
1632
  } | (string | {
1612
1633
  source: string;
1613
1634
  directory?: string | undefined;
1635
+ slug?: "summary" | "operationId" | undefined;
1614
1636
  overlays?: string[] | undefined;
1615
1637
  })[] | undefined;
1616
1638
  asyncapi?: string | string[] | {
@@ -1658,10 +1680,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
1658
1680
  openapi?: string | {
1659
1681
  source: string;
1660
1682
  directory?: string | undefined;
1683
+ slug?: "summary" | "operationId" | undefined;
1661
1684
  overlays?: string[] | undefined;
1662
1685
  } | (string | {
1663
1686
  source: string;
1664
1687
  directory?: string | undefined;
1688
+ slug?: "summary" | "operationId" | undefined;
1665
1689
  overlays?: string[] | undefined;
1666
1690
  })[] | undefined;
1667
1691
  playground?: {
@@ -2045,10 +2069,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
2045
2069
  openapi?: string | {
2046
2070
  source: string;
2047
2071
  directory?: string | undefined;
2072
+ slug?: "summary" | "operationId" | undefined;
2048
2073
  overlays?: string[] | undefined;
2049
2074
  } | (string | {
2050
2075
  source: string;
2051
2076
  directory?: string | undefined;
2077
+ slug?: "summary" | "operationId" | undefined;
2052
2078
  overlays?: string[] | undefined;
2053
2079
  })[] | undefined;
2054
2080
  asyncapi?: string | string[] | {
@@ -2096,10 +2122,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
2096
2122
  openapi?: string | {
2097
2123
  source: string;
2098
2124
  directory?: string | undefined;
2125
+ slug?: "summary" | "operationId" | undefined;
2099
2126
  overlays?: string[] | undefined;
2100
2127
  } | (string | {
2101
2128
  source: string;
2102
2129
  directory?: string | undefined;
2130
+ slug?: "summary" | "operationId" | undefined;
2103
2131
  overlays?: string[] | undefined;
2104
2132
  })[] | undefined;
2105
2133
  asyncapi?: string | string[] | {
@@ -2147,10 +2175,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
2147
2175
  openapi?: string | {
2148
2176
  source: string;
2149
2177
  directory?: string | undefined;
2178
+ slug?: "summary" | "operationId" | undefined;
2150
2179
  overlays?: string[] | undefined;
2151
2180
  } | (string | {
2152
2181
  source: string;
2153
2182
  directory?: string | undefined;
2183
+ slug?: "summary" | "operationId" | undefined;
2154
2184
  overlays?: string[] | undefined;
2155
2185
  })[] | undefined;
2156
2186
  playground?: {
@@ -2528,10 +2558,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
2528
2558
  openapi?: string | {
2529
2559
  source: string;
2530
2560
  directory?: string | undefined;
2561
+ slug?: "summary" | "operationId" | undefined;
2531
2562
  overlays?: string[] | undefined;
2532
2563
  } | (string | {
2533
2564
  source: string;
2534
2565
  directory?: string | undefined;
2566
+ slug?: "summary" | "operationId" | undefined;
2535
2567
  overlays?: string[] | undefined;
2536
2568
  })[] | undefined;
2537
2569
  asyncapi?: string | string[] | {
@@ -2579,10 +2611,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
2579
2611
  openapi?: string | {
2580
2612
  source: string;
2581
2613
  directory?: string | undefined;
2614
+ slug?: "summary" | "operationId" | undefined;
2582
2615
  overlays?: string[] | undefined;
2583
2616
  } | (string | {
2584
2617
  source: string;
2585
2618
  directory?: string | undefined;
2619
+ slug?: "summary" | "operationId" | undefined;
2586
2620
  overlays?: string[] | undefined;
2587
2621
  })[] | undefined;
2588
2622
  asyncapi?: string | string[] | {
@@ -2630,10 +2664,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
2630
2664
  openapi?: string | {
2631
2665
  source: string;
2632
2666
  directory?: string | undefined;
2667
+ slug?: "summary" | "operationId" | undefined;
2633
2668
  overlays?: string[] | undefined;
2634
2669
  } | (string | {
2635
2670
  source: string;
2636
2671
  directory?: string | undefined;
2672
+ slug?: "summary" | "operationId" | undefined;
2637
2673
  overlays?: string[] | undefined;
2638
2674
  })[] | undefined;
2639
2675
  playground?: {
@@ -3011,10 +3047,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
3011
3047
  openapi?: string | {
3012
3048
  source: string;
3013
3049
  directory?: string | undefined;
3050
+ slug?: "summary" | "operationId" | undefined;
3014
3051
  overlays?: string[] | undefined;
3015
3052
  } | (string | {
3016
3053
  source: string;
3017
3054
  directory?: string | undefined;
3055
+ slug?: "summary" | "operationId" | undefined;
3018
3056
  overlays?: string[] | undefined;
3019
3057
  })[] | undefined;
3020
3058
  asyncapi?: string | string[] | {
@@ -3062,10 +3100,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
3062
3100
  openapi?: string | {
3063
3101
  source: string;
3064
3102
  directory?: string | undefined;
3103
+ slug?: "summary" | "operationId" | undefined;
3065
3104
  overlays?: string[] | undefined;
3066
3105
  } | (string | {
3067
3106
  source: string;
3068
3107
  directory?: string | undefined;
3108
+ slug?: "summary" | "operationId" | undefined;
3069
3109
  overlays?: string[] | undefined;
3070
3110
  })[] | undefined;
3071
3111
  asyncapi?: string | string[] | {
@@ -3113,10 +3153,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
3113
3153
  openapi?: string | {
3114
3154
  source: string;
3115
3155
  directory?: string | undefined;
3156
+ slug?: "summary" | "operationId" | undefined;
3116
3157
  overlays?: string[] | undefined;
3117
3158
  } | (string | {
3118
3159
  source: string;
3119
3160
  directory?: string | undefined;
3161
+ slug?: "summary" | "operationId" | undefined;
3120
3162
  overlays?: string[] | undefined;
3121
3163
  })[] | undefined;
3122
3164
  playground?: {
@@ -3494,10 +3536,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
3494
3536
  openapi?: string | {
3495
3537
  source: string;
3496
3538
  directory?: string | undefined;
3539
+ slug?: "summary" | "operationId" | undefined;
3497
3540
  overlays?: string[] | undefined;
3498
3541
  } | (string | {
3499
3542
  source: string;
3500
3543
  directory?: string | undefined;
3544
+ slug?: "summary" | "operationId" | undefined;
3501
3545
  overlays?: string[] | undefined;
3502
3546
  })[] | undefined;
3503
3547
  asyncapi?: string | string[] | {
@@ -3545,10 +3589,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
3545
3589
  openapi?: string | {
3546
3590
  source: string;
3547
3591
  directory?: string | undefined;
3592
+ slug?: "summary" | "operationId" | undefined;
3548
3593
  overlays?: string[] | undefined;
3549
3594
  } | (string | {
3550
3595
  source: string;
3551
3596
  directory?: string | undefined;
3597
+ slug?: "summary" | "operationId" | undefined;
3552
3598
  overlays?: string[] | undefined;
3553
3599
  })[] | undefined;
3554
3600
  asyncapi?: string | string[] | {
@@ -3596,10 +3642,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
3596
3642
  openapi?: string | {
3597
3643
  source: string;
3598
3644
  directory?: string | undefined;
3645
+ slug?: "summary" | "operationId" | undefined;
3599
3646
  overlays?: string[] | undefined;
3600
3647
  } | (string | {
3601
3648
  source: string;
3602
3649
  directory?: string | undefined;
3650
+ slug?: "summary" | "operationId" | undefined;
3603
3651
  overlays?: string[] | undefined;
3604
3652
  })[] | undefined;
3605
3653
  playground?: {
@@ -3977,10 +4025,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
3977
4025
  openapi?: string | {
3978
4026
  source: string;
3979
4027
  directory?: string | undefined;
4028
+ slug?: "summary" | "operationId" | undefined;
3980
4029
  overlays?: string[] | undefined;
3981
4030
  } | (string | {
3982
4031
  source: string;
3983
4032
  directory?: string | undefined;
4033
+ slug?: "summary" | "operationId" | undefined;
3984
4034
  overlays?: string[] | undefined;
3985
4035
  })[] | undefined;
3986
4036
  asyncapi?: string | string[] | {
@@ -4028,10 +4078,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
4028
4078
  openapi?: string | {
4029
4079
  source: string;
4030
4080
  directory?: string | undefined;
4081
+ slug?: "summary" | "operationId" | undefined;
4031
4082
  overlays?: string[] | undefined;
4032
4083
  } | (string | {
4033
4084
  source: string;
4034
4085
  directory?: string | undefined;
4086
+ slug?: "summary" | "operationId" | undefined;
4035
4087
  overlays?: string[] | undefined;
4036
4088
  })[] | undefined;
4037
4089
  asyncapi?: string | string[] | {
@@ -4079,10 +4131,12 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
4079
4131
  openapi?: string | {
4080
4132
  source: string;
4081
4133
  directory?: string | undefined;
4134
+ slug?: "summary" | "operationId" | undefined;
4082
4135
  overlays?: string[] | undefined;
4083
4136
  } | (string | {
4084
4137
  source: string;
4085
4138
  directory?: string | undefined;
4139
+ slug?: "summary" | "operationId" | undefined;
4086
4140
  overlays?: string[] | undefined;
4087
4141
  })[] | undefined;
4088
4142
  playground?: {
@@ -37,6 +37,7 @@ export const generateOpenApiFromDocsConfig = async (navigation, openApiFiles, pa
37
37
  async function processOpenApiInNav(nav) {
38
38
  let outputDir = DEFAULT_OUTPUT_DIR;
39
39
  let openapi;
40
+ let slug;
40
41
  if ('openapi' in nav) {
41
42
  if (typeof nav.openapi === 'string') {
42
43
  openapi = nav.openapi;
@@ -50,11 +51,13 @@ export const generateOpenApiFromDocsConfig = async (navigation, openApiFiles, pa
50
51
  else if (firstEntry != undefined) {
51
52
  openapi = firstEntry.source;
52
53
  outputDir = firstEntry.directory ?? DEFAULT_OUTPUT_DIR;
54
+ slug = firstEntry.slug;
53
55
  }
54
56
  }
55
57
  else if (typeof nav.openapi === 'object' && 'source' in nav.openapi) {
56
58
  openapi = nav.openapi.source;
57
59
  outputDir = nav.openapi.directory ?? DEFAULT_OUTPUT_DIR;
60
+ slug = nav.openapi.slug;
58
61
  }
59
62
  }
60
63
  if (openapi) {
@@ -85,6 +88,7 @@ export const generateOpenApiFromDocsConfig = async (navigation, openApiFiles, pa
85
88
  writeFiles,
86
89
  outDir: outputDir,
87
90
  outDirBasePath: path.join(targetDir ?? '', 'src', '_props'),
91
+ slug,
88
92
  mountPath: resolveMountPath(openApiFile.originalFileLocation, outputDir, mountPaths),
89
93
  overwrite,
90
94
  localSchema,
@@ -115,52 +119,58 @@ export const generateOpenApiFromDocsConfig = async (navigation, openApiFiles, pa
115
119
  return null;
116
120
  }
117
121
  function extractOpenApiFromNav(nav) {
122
+ const none = { source: undefined, directory: undefined, slug: undefined };
118
123
  if ('openapi' in nav && nav.openapi !== null) {
119
124
  const openapiProp = nav.openapi;
120
125
  if (typeof openapiProp === 'string') {
121
- return { source: openapiProp, directory: undefined };
126
+ return { ...none, source: openapiProp };
122
127
  }
123
128
  else if (Array.isArray(openapiProp) && openapiProp.length > 0) {
124
129
  const firstEntry = openapiProp[0];
125
130
  if (typeof firstEntry === 'string') {
126
- return { source: firstEntry, directory: undefined };
131
+ return { ...none, source: firstEntry };
127
132
  }
128
133
  if (firstEntry != undefined) {
129
- return { source: firstEntry.source, directory: firstEntry.directory };
134
+ return {
135
+ source: firstEntry.source,
136
+ directory: firstEntry.directory,
137
+ slug: firstEntry.slug,
138
+ };
130
139
  }
131
- return { source: undefined, directory: undefined };
140
+ return none;
132
141
  }
133
142
  else if (typeof openapiProp === 'object' &&
134
143
  'source' in openapiProp &&
135
144
  typeof openapiProp.source === 'string') {
136
- const directory = 'directory' in openapiProp && typeof openapiProp.directory === 'string'
137
- ? openapiProp.directory
138
- : undefined;
139
145
  return {
140
146
  source: openapiProp.source,
141
- directory,
147
+ directory: 'directory' in openapiProp && typeof openapiProp.directory === 'string'
148
+ ? openapiProp.directory
149
+ : undefined,
150
+ slug: 'slug' in openapiProp ? openapiProp.slug : undefined,
142
151
  };
143
152
  }
144
153
  }
145
- return { source: undefined, directory: undefined };
154
+ return none;
146
155
  }
147
156
  const skipBulkForNode = new Set();
148
157
  const skipBulkForNodeId = new Set();
149
158
  let numNodes = 0;
150
- async function processNav(nav, inheritedOpenApi, inheritedDirectory, openApiOwner) {
159
+ async function processNav(nav, inheritedOpenApi, inheritedDirectory, openApiOwner, inheritedSlug) {
151
160
  const nodeId = numNodes++;
152
161
  const extracted = extractOpenApiFromNav(nav);
153
162
  const currentOpenApi = extracted.source ?? inheritedOpenApi;
154
163
  const currentDirectory = extracted.source
155
164
  ? extracted.directory
156
165
  : (extracted.directory ?? inheritedDirectory);
166
+ const currentSlug = extracted.source ? extracted.slug : (extracted.slug ?? inheritedSlug);
157
167
  const currentOpenApiOwner = extracted.source ? nodeId : openApiOwner;
158
168
  let newNav = nav;
159
169
  if ('pages' in newNav) {
160
170
  const processedPages = await Promise.all(newNav.pages.map(async (page) => {
161
171
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
162
172
  if (typeof page === 'object' && page !== null && 'group' in page) {
163
- return processNav(page, currentOpenApi, currentDirectory, currentOpenApiOwner);
173
+ return processNav(page, currentOpenApi, currentDirectory, currentOpenApiOwner, currentSlug);
164
174
  }
165
175
  if (typeof page !== 'string') {
166
176
  return page;
@@ -213,6 +223,7 @@ export const generateOpenApiFromDocsConfig = async (navigation, openApiFiles, pa
213
223
  writeFiles,
214
224
  outDir: currentDirectory ?? DEFAULT_OUTPUT_DIR,
215
225
  outDirBasePath: path.join(targetDir ?? '', 'src', '_props'),
226
+ slug: currentSlug,
216
227
  mountPath: resolveMountPath(openApiFile.originalFileLocation, currentDirectory, mountPaths),
217
228
  overwrite,
218
229
  localSchema,
@@ -238,6 +249,7 @@ export const generateOpenApiFromDocsConfig = async (navigation, openApiFiles, pa
238
249
  writeFiles,
239
250
  outDir: currentDirectory ?? DEFAULT_OUTPUT_DIR,
240
251
  outDirBasePath: path.join(targetDir ?? '', 'src', '_props'),
252
+ slug: currentSlug,
241
253
  mountPath: resolveMountPath(openApiFile.originalFileLocation, currentDirectory, mountPaths),
242
254
  overwrite,
243
255
  localSchema,
@@ -266,7 +278,7 @@ export const generateOpenApiFromDocsConfig = async (navigation, openApiFiles, pa
266
278
  const items = newNav[division];
267
279
  newNav = {
268
280
  ...newNav,
269
- [division]: await Promise.all(items.map((item) => processNav(item, currentOpenApi, currentDirectory, currentOpenApiOwner))),
281
+ [division]: await Promise.all(items.map((item) => processNav(item, currentOpenApi, currentDirectory, currentOpenApiOwner, currentSlug))),
270
282
  };
271
283
  }
272
284
  }