@mintlify/validation 0.1.847 → 0.1.849

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.
Files changed (27) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.js +2 -0
  3. package/dist/mint-config/collectOpenApiOverlays.d.ts +13 -0
  4. package/dist/mint-config/collectOpenApiOverlays.js +73 -0
  5. package/dist/mint-config/schemas/v2/index.d.ts +1280 -330
  6. package/dist/mint-config/schemas/v2/properties/api.d.ts +30 -5
  7. package/dist/mint-config/schemas/v2/properties/navigation/divisionNav.d.ts +30 -5
  8. package/dist/mint-config/schemas/v2/properties/navigation/groups.d.ts +14 -4
  9. package/dist/mint-config/schemas/v2/properties/navigation/index.d.ts +56 -16
  10. package/dist/mint-config/schemas/v2/properties/navigation/pages.d.ts +14 -4
  11. package/dist/mint-config/schemas/v2/properties/reusable/openapi.d.ts +26 -1
  12. package/dist/mint-config/schemas/v2/properties/reusable/openapi.js +23 -2
  13. package/dist/mint-config/schemas/v2/themes/almond.d.ts +128 -33
  14. package/dist/mint-config/schemas/v2/themes/aspen.d.ts +128 -33
  15. package/dist/mint-config/schemas/v2/themes/linden.d.ts +128 -33
  16. package/dist/mint-config/schemas/v2/themes/luma.d.ts +128 -33
  17. package/dist/mint-config/schemas/v2/themes/maple.d.ts +128 -33
  18. package/dist/mint-config/schemas/v2/themes/mint.d.ts +128 -33
  19. package/dist/mint-config/schemas/v2/themes/palm.d.ts +128 -33
  20. package/dist/mint-config/schemas/v2/themes/reusable/index.d.ts +86 -21
  21. package/dist/mint-config/schemas/v2/themes/sequoia.d.ts +128 -33
  22. package/dist/mint-config/schemas/v2/themes/willow.d.ts +128 -33
  23. package/dist/mint-config/validateConfig.d.ts +378 -108
  24. package/dist/openapi/overlay.d.ts +555 -0
  25. package/dist/openapi/overlay.js +118 -0
  26. package/dist/tsconfig.build.tsbuildinfo +1 -1
  27. package/package.json +3 -3
@@ -1,14 +1,29 @@
1
1
  import { z } from 'zod';
2
2
  export declare const apiSchema: z.ZodObject<{
3
- openapi: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">, z.ZodObject<{
3
+ openapi: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
4
4
  source: z.ZodEffects<z.ZodString, string, string>;
5
5
  directory: z.ZodOptional<z.ZodString>;
6
+ overlays: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
6
7
  }, "strict", z.ZodTypeAny, {
7
8
  source: string;
8
9
  directory?: string | undefined;
10
+ overlays?: string[] | undefined;
9
11
  }, {
10
12
  source: string;
11
13
  directory?: string | undefined;
14
+ overlays?: string[] | undefined;
15
+ }>]>, "many">, z.ZodObject<{
16
+ source: z.ZodEffects<z.ZodString, string, string>;
17
+ directory: z.ZodOptional<z.ZodString>;
18
+ overlays: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
19
+ }, "strict", z.ZodTypeAny, {
20
+ source: string;
21
+ directory?: string | undefined;
22
+ overlays?: string[] | undefined;
23
+ }, {
24
+ source: string;
25
+ directory?: string | undefined;
26
+ overlays?: string[] | undefined;
12
27
  }>]>>;
13
28
  asyncapi: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">, z.ZodObject<{
14
29
  source: z.ZodEffects<z.ZodString, string, string>;
@@ -91,10 +106,15 @@ export declare const apiSchema: z.ZodObject<{
91
106
  post?: string[] | undefined;
92
107
  } | undefined;
93
108
  url?: "full" | undefined;
94
- openapi?: string | string[] | {
109
+ openapi?: string | {
95
110
  source: string;
96
111
  directory?: string | undefined;
97
- } | undefined;
112
+ overlays?: string[] | undefined;
113
+ } | (string | {
114
+ source: string;
115
+ directory?: string | undefined;
116
+ overlays?: string[] | undefined;
117
+ })[] | undefined;
98
118
  playground?: {
99
119
  display?: "auth" | "simple" | "none" | "interactive" | undefined;
100
120
  proxy?: boolean | undefined;
@@ -123,10 +143,15 @@ export declare const apiSchema: z.ZodObject<{
123
143
  post?: string[] | undefined;
124
144
  } | undefined;
125
145
  url?: "full" | undefined;
126
- openapi?: string | string[] | {
146
+ openapi?: string | {
127
147
  source: string;
128
148
  directory?: string | undefined;
129
- } | undefined;
149
+ overlays?: string[] | undefined;
150
+ } | (string | {
151
+ source: string;
152
+ directory?: string | undefined;
153
+ overlays?: string[] | undefined;
154
+ })[] | undefined;
130
155
  playground?: {
131
156
  display?: "auth" | "simple" | "none" | "interactive" | undefined;
132
157
  proxy?: boolean | undefined;
@@ -12,15 +12,30 @@ import { BaseTabSchema } from './tabs.js';
12
12
  import { BaseVersionSchema } from './version.js';
13
13
  type NavigationType = 'default' | 'decorated';
14
14
  declare const SomeApiSchema: z.ZodObject<{
15
- openapi: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">, z.ZodObject<{
15
+ openapi: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
16
16
  source: z.ZodEffects<z.ZodString, string, string>;
17
17
  directory: z.ZodOptional<z.ZodString>;
18
+ overlays: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
18
19
  }, "strict", z.ZodTypeAny, {
19
20
  source: string;
20
21
  directory?: string | undefined;
22
+ overlays?: string[] | undefined;
21
23
  }, {
22
24
  source: string;
23
25
  directory?: string | undefined;
26
+ overlays?: string[] | undefined;
27
+ }>]>, "many">, z.ZodObject<{
28
+ source: z.ZodEffects<z.ZodString, string, string>;
29
+ directory: z.ZodOptional<z.ZodString>;
30
+ overlays: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
31
+ }, "strict", z.ZodTypeAny, {
32
+ source: string;
33
+ directory?: string | undefined;
34
+ overlays?: string[] | undefined;
35
+ }, {
36
+ source: string;
37
+ directory?: string | undefined;
38
+ overlays?: string[] | undefined;
24
39
  }>]>>;
25
40
  asyncapi: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">, z.ZodObject<{
26
41
  source: z.ZodEffects<z.ZodString, string, string>;
@@ -33,19 +48,29 @@ declare const SomeApiSchema: z.ZodObject<{
33
48
  directory?: string | undefined;
34
49
  }>]>>;
35
50
  }, "strip", z.ZodTypeAny, {
36
- openapi?: string | string[] | {
51
+ openapi?: string | {
37
52
  source: string;
38
53
  directory?: string | undefined;
39
- } | undefined;
54
+ overlays?: string[] | undefined;
55
+ } | (string | {
56
+ source: string;
57
+ directory?: string | undefined;
58
+ overlays?: string[] | undefined;
59
+ })[] | undefined;
40
60
  asyncapi?: string | string[] | {
41
61
  source: string;
42
62
  directory?: string | undefined;
43
63
  } | undefined;
44
64
  }, {
45
- openapi?: string | string[] | {
65
+ openapi?: string | {
46
66
  source: string;
47
67
  directory?: string | undefined;
48
- } | undefined;
68
+ overlays?: string[] | undefined;
69
+ } | (string | {
70
+ source: string;
71
+ directory?: string | undefined;
72
+ overlays?: string[] | undefined;
73
+ })[] | undefined;
49
74
  asyncapi?: string | string[] | {
50
75
  source: string;
51
76
  directory?: string | undefined;
@@ -88,10 +88,15 @@ export declare const groupsSchema: z.ZodArray<z.ZodType<Omit<{
88
88
  sdk?: undefined;
89
89
  root?: string | undefined;
90
90
  }, "sdk"> & {
91
- openapi?: string | string[] | {
91
+ openapi?: string | {
92
92
  source: string;
93
93
  directory?: string | undefined;
94
- } | undefined;
94
+ overlays?: string[] | undefined;
95
+ } | (string | {
96
+ source: string;
97
+ directory?: string | undefined;
98
+ overlays?: string[] | undefined;
99
+ })[] | undefined;
95
100
  asyncapi?: string | string[] | {
96
101
  source: string;
97
102
  directory?: string | undefined;
@@ -117,10 +122,15 @@ export declare const groupsSchema: z.ZodArray<z.ZodType<Omit<{
117
122
  sdk?: undefined;
118
123
  root?: string | undefined;
119
124
  }, "sdk"> & {
120
- openapi?: string | string[] | {
125
+ openapi?: string | {
121
126
  source: string;
122
127
  directory?: string | undefined;
123
- } | undefined;
128
+ overlays?: string[] | undefined;
129
+ } | (string | {
130
+ source: string;
131
+ directory?: string | undefined;
132
+ overlays?: string[] | undefined;
133
+ })[] | undefined;
124
134
  asyncapi?: string | string[] | {
125
135
  source: string;
126
136
  directory?: string | undefined;
@@ -145,10 +145,15 @@ export declare const navigationSchema: z.ZodUnion<[z.ZodObject<{
145
145
  sdk?: undefined;
146
146
  root?: string | undefined;
147
147
  }, "sdk"> & {
148
- openapi?: string | string[] | {
148
+ openapi?: string | {
149
149
  source: string;
150
150
  directory?: string | undefined;
151
- } | undefined;
151
+ overlays?: string[] | undefined;
152
+ } | (string | {
153
+ source: string;
154
+ directory?: string | undefined;
155
+ overlays?: string[] | undefined;
156
+ })[] | undefined;
152
157
  asyncapi?: string | string[] | {
153
158
  source: string;
154
159
  directory?: string | undefined;
@@ -174,10 +179,15 @@ export declare const navigationSchema: z.ZodUnion<[z.ZodObject<{
174
179
  sdk?: undefined;
175
180
  root?: string | undefined;
176
181
  }, "sdk"> & {
177
- openapi?: string | string[] | {
182
+ openapi?: string | {
178
183
  source: string;
179
184
  directory?: string | undefined;
180
- } | undefined;
185
+ overlays?: string[] | undefined;
186
+ } | (string | {
187
+ source: string;
188
+ directory?: string | undefined;
189
+ overlays?: string[] | undefined;
190
+ })[] | undefined;
181
191
  asyncapi?: string | string[] | {
182
192
  source: string;
183
193
  directory?: string | undefined;
@@ -205,10 +215,15 @@ export declare const navigationSchema: z.ZodUnion<[z.ZodObject<{
205
215
  sdk?: undefined;
206
216
  root?: string | undefined;
207
217
  }, "sdk"> & {
208
- openapi?: string | string[] | {
218
+ openapi?: string | {
209
219
  source: string;
210
220
  directory?: string | undefined;
211
- } | undefined;
221
+ overlays?: string[] | undefined;
222
+ } | (string | {
223
+ source: string;
224
+ directory?: string | undefined;
225
+ overlays?: string[] | undefined;
226
+ })[] | undefined;
212
227
  asyncapi?: string | string[] | {
213
228
  source: string;
214
229
  directory?: string | undefined;
@@ -240,10 +255,15 @@ export declare const navigationSchema: z.ZodUnion<[z.ZodObject<{
240
255
  sdk?: undefined;
241
256
  root?: string | undefined;
242
257
  }, "sdk"> & {
243
- openapi?: string | string[] | {
258
+ openapi?: string | {
244
259
  source: string;
245
260
  directory?: string | undefined;
246
- } | undefined;
261
+ overlays?: string[] | undefined;
262
+ } | (string | {
263
+ source: string;
264
+ directory?: string | undefined;
265
+ overlays?: string[] | undefined;
266
+ })[] | undefined;
247
267
  asyncapi?: string | string[] | {
248
268
  source: string;
249
269
  directory?: string | undefined;
@@ -280,10 +300,15 @@ export declare const navigationSchema: z.ZodUnion<[z.ZodObject<{
280
300
  sdk?: undefined;
281
301
  root?: string | undefined;
282
302
  }, "sdk"> & {
283
- openapi?: string | string[] | {
303
+ openapi?: string | {
284
304
  source: string;
285
305
  directory?: string | undefined;
286
- } | undefined;
306
+ overlays?: string[] | undefined;
307
+ } | (string | {
308
+ source: string;
309
+ directory?: string | undefined;
310
+ overlays?: string[] | undefined;
311
+ })[] | undefined;
287
312
  asyncapi?: string | string[] | {
288
313
  source: string;
289
314
  directory?: string | undefined;
@@ -309,10 +334,15 @@ export declare const navigationSchema: z.ZodUnion<[z.ZodObject<{
309
334
  sdk?: undefined;
310
335
  root?: string | undefined;
311
336
  }, "sdk"> & {
312
- openapi?: string | string[] | {
337
+ openapi?: string | {
313
338
  source: string;
314
339
  directory?: string | undefined;
315
- } | undefined;
340
+ overlays?: string[] | undefined;
341
+ } | (string | {
342
+ source: string;
343
+ directory?: string | undefined;
344
+ overlays?: string[] | undefined;
345
+ })[] | undefined;
316
346
  asyncapi?: string | string[] | {
317
347
  source: string;
318
348
  directory?: string | undefined;
@@ -340,10 +370,15 @@ export declare const navigationSchema: z.ZodUnion<[z.ZodObject<{
340
370
  sdk?: undefined;
341
371
  root?: string | undefined;
342
372
  }, "sdk"> & {
343
- openapi?: string | string[] | {
373
+ openapi?: string | {
344
374
  source: string;
345
375
  directory?: string | undefined;
346
- } | undefined;
376
+ overlays?: string[] | undefined;
377
+ } | (string | {
378
+ source: string;
379
+ directory?: string | undefined;
380
+ overlays?: string[] | undefined;
381
+ })[] | undefined;
347
382
  asyncapi?: string | string[] | {
348
383
  source: string;
349
384
  directory?: string | undefined;
@@ -375,10 +410,15 @@ export declare const navigationSchema: z.ZodUnion<[z.ZodObject<{
375
410
  sdk?: undefined;
376
411
  root?: string | undefined;
377
412
  }, "sdk"> & {
378
- openapi?: string | string[] | {
413
+ openapi?: string | {
379
414
  source: string;
380
415
  directory?: string | undefined;
381
- } | undefined;
416
+ overlays?: string[] | undefined;
417
+ } | (string | {
418
+ source: string;
419
+ directory?: string | undefined;
420
+ overlays?: string[] | undefined;
421
+ })[] | undefined;
382
422
  asyncapi?: string | string[] | {
383
423
  source: string;
384
424
  directory?: string | undefined;
@@ -21,10 +21,15 @@ export declare const pagesSchema: z.ZodArray<z.ZodType<string | (Omit<{
21
21
  sdk?: undefined;
22
22
  root?: string | undefined;
23
23
  }, "sdk"> & {
24
- openapi?: string | string[] | {
24
+ openapi?: string | {
25
25
  source: string;
26
26
  directory?: string | undefined;
27
- } | undefined;
27
+ overlays?: string[] | undefined;
28
+ } | (string | {
29
+ source: string;
30
+ directory?: string | undefined;
31
+ overlays?: string[] | undefined;
32
+ })[] | undefined;
28
33
  asyncapi?: string | string[] | {
29
34
  source: string;
30
35
  directory?: string | undefined;
@@ -50,10 +55,15 @@ export declare const pagesSchema: z.ZodArray<z.ZodType<string | (Omit<{
50
55
  sdk?: undefined;
51
56
  root?: string | undefined;
52
57
  }, "sdk"> & {
53
- openapi?: string | string[] | {
58
+ openapi?: string | {
54
59
  source: string;
55
60
  directory?: string | undefined;
56
- } | undefined;
61
+ overlays?: string[] | undefined;
62
+ } | (string | {
63
+ source: string;
64
+ directory?: string | undefined;
65
+ overlays?: string[] | undefined;
66
+ })[] | undefined;
57
67
  asyncapi?: string | string[] | {
58
68
  source: string;
59
69
  directory?: string | undefined;
@@ -3,22 +3,47 @@ export declare const openapiStringSchema: z.ZodEffects<z.ZodString, string, stri
3
3
  export declare const openapiObjSchema: z.ZodObject<{
4
4
  source: z.ZodEffects<z.ZodString, string, string>;
5
5
  directory: z.ZodOptional<z.ZodString>;
6
+ overlays: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
6
7
  }, "strict", z.ZodTypeAny, {
7
8
  source: string;
8
9
  directory?: string | undefined;
10
+ overlays?: string[] | undefined;
9
11
  }, {
10
12
  source: string;
11
13
  directory?: string | undefined;
14
+ overlays?: string[] | undefined;
12
15
  }>;
13
- export declare const openApiSchema: z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">, z.ZodObject<{
16
+ export declare const openApiSchema: z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
14
17
  source: z.ZodEffects<z.ZodString, string, string>;
15
18
  directory: z.ZodOptional<z.ZodString>;
19
+ overlays: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
16
20
  }, "strict", z.ZodTypeAny, {
17
21
  source: string;
18
22
  directory?: string | undefined;
23
+ overlays?: string[] | undefined;
19
24
  }, {
20
25
  source: string;
21
26
  directory?: string | undefined;
27
+ overlays?: string[] | undefined;
28
+ }>]>, "many">, z.ZodObject<{
29
+ source: z.ZodEffects<z.ZodString, string, string>;
30
+ directory: z.ZodOptional<z.ZodString>;
31
+ overlays: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
32
+ }, "strict", z.ZodTypeAny, {
33
+ source: string;
34
+ directory?: string | undefined;
35
+ overlays?: string[] | undefined;
36
+ }, {
37
+ source: string;
38
+ directory?: string | undefined;
39
+ overlays?: string[] | undefined;
22
40
  }>]>;
23
41
  export type OpenApiObjConfig = z.infer<typeof openapiObjSchema>;
24
42
  export type OpenApiConfig = z.infer<typeof openApiSchema>;
43
+ export type OpenApiConfigEntry = {
44
+ source: string;
45
+ directory?: string;
46
+ overlays?: string[];
47
+ };
48
+ /** Normalizes any accepted `openapi` config shape into a flat list of entries. */
49
+ export declare const extractOpenApiEntries: (config: OpenApiConfig | undefined) => OpenApiConfigEntry[];
@@ -34,8 +34,29 @@ export const openapiObjSchema = z
34
34
  .object({
35
35
  source: openapiStringSchema,
36
36
  directory: z.string().trim().optional(),
37
+ overlays: z
38
+ .array(openapiStringSchema)
39
+ .optional()
40
+ .describe('OpenAPI Overlay documents to apply to the source specification, in order. An empty array disables all overlays for this specification, including auto-discovered ones.'),
37
41
  })
38
42
  .strict();
39
43
  export const openApiSchema = z
40
- .union([openapiStringSchema, z.array(openapiStringSchema), openapiObjSchema])
41
- .describe('A string or an array of strings of absolute or relative urls pointing to the OpenAPI file(s)');
44
+ .union([
45
+ openapiStringSchema,
46
+ z.array(z.union([openapiStringSchema, openapiObjSchema])),
47
+ openapiObjSchema,
48
+ ])
49
+ .describe('A string, an array of strings or objects, or an object of absolute or relative urls pointing to the OpenAPI file(s), optionally with OpenAPI Overlay documents to apply');
50
+ /** Normalizes any accepted `openapi` config shape into a flat list of entries. */
51
+ export const extractOpenApiEntries = (config) => {
52
+ if (config == undefined)
53
+ return [];
54
+ if (typeof config === 'string')
55
+ return [{ source: config }];
56
+ if (Array.isArray(config)) {
57
+ return config.map((entry) => typeof entry === 'string'
58
+ ? { source: entry }
59
+ : { source: entry.source, directory: entry.directory, overlays: entry.overlays });
60
+ }
61
+ return [{ source: config.source, directory: config.directory, overlays: config.overlays }];
62
+ };