@mintlify/validation 0.1.59 → 0.1.60

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 (51) hide show
  1. package/dist/index.d.ts +5 -6
  2. package/dist/index.js +17 -41
  3. package/dist/mint-config/common.js +1 -4
  4. package/dist/mint-config/flattenUnionErrorMessages.js +1 -5
  5. package/dist/mint-config/hexadecimalPattern.js +1 -4
  6. package/dist/mint-config/schemas/analytics.d.ts +0 -104
  7. package/dist/mint-config/schemas/analytics.js +28 -31
  8. package/dist/mint-config/schemas/anchorColors.d.ts +0 -1
  9. package/dist/mint-config/schemas/anchorColors.js +13 -16
  10. package/dist/mint-config/schemas/anchors.d.ts +7 -56
  11. package/dist/mint-config/schemas/anchors.js +17 -20
  12. package/dist/mint-config/schemas/apiReference.d.ts +0 -2
  13. package/dist/mint-config/schemas/apiReference.js +18 -21
  14. package/dist/mint-config/schemas/basics.d.ts +0 -11
  15. package/dist/mint-config/schemas/basics.js +37 -50
  16. package/dist/mint-config/schemas/colors.d.ts +0 -1
  17. package/dist/mint-config/schemas/colors.js +18 -21
  18. package/dist/mint-config/schemas/config.d.ts +13 -14
  19. package/dist/mint-config/schemas/config.js +38 -41
  20. package/dist/mint-config/schemas/favicon.js +2 -5
  21. package/dist/mint-config/schemas/integrations.d.ts +0 -6
  22. package/dist/mint-config/schemas/integrations.js +4 -7
  23. package/dist/mint-config/schemas/navigation.d.ts +15 -2
  24. package/dist/mint-config/schemas/navigation.js +22 -22
  25. package/dist/mint-config/schemas/tabs.d.ts +0 -13
  26. package/dist/mint-config/schemas/tabs.js +7 -10
  27. package/dist/mint-config/schemas/versions.d.ts +0 -13
  28. package/dist/mint-config/schemas/versions.js +7 -10
  29. package/dist/mint-config/validateAnchorsWarnings.d.ts +3 -4
  30. package/dist/mint-config/validateAnchorsWarnings.js +5 -9
  31. package/dist/mint-config/validateVersionsInNavigation.d.ts +4 -5
  32. package/dist/mint-config/validateVersionsInNavigation.js +6 -11
  33. package/dist/openapi/convertOpenApi.d.ts +1 -1
  34. package/dist/openapi/convertOpenApi.js +23 -31
  35. package/dist/openapi/convertParameters.d.ts +1 -1
  36. package/dist/openapi/convertParameters.js +11 -15
  37. package/dist/openapi/convertSchema.d.ts +1 -1
  38. package/dist/openapi/convertSchema.js +61 -72
  39. package/dist/openapi/convertSecurity.d.ts +1 -1
  40. package/dist/openapi/convertSecurity.js +8 -13
  41. package/dist/openapi/convertServers.d.ts +1 -1
  42. package/dist/openapi/convertServers.js +1 -5
  43. package/dist/openapi/types/endpoint.js +1 -4
  44. package/dist/tsconfig.build.tsbuildinfo +1 -1
  45. package/package.json +17 -10
  46. package/dist/mint-config/types/enums.d.ts +0 -4
  47. package/dist/mint-config/types/enums.js +0 -4
  48. package/dist/mint-config/types/index.d.ts +0 -12
  49. package/dist/mint-config/types/index.js +0 -2
  50. package/dist/mint-config/types/navigation.d.ts +0 -13
  51. package/dist/mint-config/types/navigation.js +0 -2
@@ -1,26 +1,23 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.apiSchema = exports.openApiSchema = void 0;
4
- var zod_1 = require("zod");
5
- exports.openApiSchema = zod_1.z.union([
6
- zod_1.z.string({
1
+ import { z } from 'zod';
2
+ export var openApiSchema = z.union([
3
+ z.string({
7
4
  invalid_type_error: 'openapi must be a string or an array of strings of absolute or relative URLs pointing to your OpenAPI file.',
8
5
  }),
9
- zod_1.z.array(zod_1.z.string({
6
+ z.array(z.string({
10
7
  invalid_type_error: 'openapi must be a string or an array of strings of absolute or relative URLs pointing to your OpenAPI file.',
11
8
  })),
12
9
  ]);
13
- exports.apiSchema = zod_1.z
10
+ export var apiSchema = z
14
11
  .object({
15
- baseUrl: zod_1.z
12
+ baseUrl: z
16
13
  .union([
17
- zod_1.z.string().url('api.baseUrl must be a valid URL.'),
18
- zod_1.z.array(zod_1.z.string().url('api.baseUrl array entries must be valid URLs.')),
14
+ z.string().url('api.baseUrl must be a valid URL.'),
15
+ z.array(z.string().url('api.baseUrl array entries must be valid URLs.')),
19
16
  ])
20
17
  .optional(),
21
- auth: zod_1.z
18
+ auth: z
22
19
  .object({
23
- method: zod_1.z
20
+ method: z
24
21
  .enum(['bearer', 'basic', 'key', 'cobo'], {
25
22
  errorMap: function () {
26
23
  return {
@@ -29,14 +26,14 @@ exports.apiSchema = zod_1.z
29
26
  },
30
27
  })
31
28
  .optional(),
32
- name: zod_1.z.string().optional(),
33
- inputPrefix: zod_1.z.string().optional(),
29
+ name: z.string().optional(),
30
+ inputPrefix: z.string().optional(),
34
31
  })
35
32
  .strict('api.auth can only contain method, name, and inputPrefix.')
36
33
  .optional(),
37
- playground: zod_1.z
34
+ playground: z
38
35
  .object({
39
- mode: zod_1.z
36
+ mode: z
40
37
  .enum(['show', 'simple', 'hide'], {
41
38
  errorMap: function () {
42
39
  return {
@@ -48,16 +45,16 @@ exports.apiSchema = zod_1.z
48
45
  .default('show'),
49
46
  })
50
47
  .optional(),
51
- request: zod_1.z
48
+ request: z
52
49
  .object({
53
- example: zod_1.z
50
+ example: z
54
51
  .object({
55
- showOptionalParams: zod_1.z.boolean().optional().default(false),
52
+ showOptionalParams: z.boolean().optional().default(false),
56
53
  })
57
54
  .optional(),
58
55
  })
59
56
  .optional(),
60
- maintainOrder: zod_1.z
57
+ maintainOrder: z
61
58
  .boolean({
62
59
  invalid_type_error: 'maintainOrder must be a boolean. Try writing true or false without the quotes.',
63
60
  })
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { NavbarLinkType } from '../types/enums';
3
2
  export declare const nameSchema: z.ZodString;
4
3
  export declare const logoSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5
4
  light: z.ZodString;
@@ -94,13 +93,3 @@ export declare const createCtaButtonSchema: (ctaButtonName: string) => z.ZodUnio
94
93
  type: "github";
95
94
  url: string;
96
95
  }>]>;
97
- export type LogoType = z.infer<typeof logoSchema>;
98
- export type FeedbackType = z.infer<typeof feedbackSchema>;
99
- export type FooterSocialsType = z.infer<typeof footerSocialsSchema>;
100
- export type NavbarLink = {
101
- url: string;
102
- type?: NavbarLinkType;
103
- name?: string;
104
- };
105
- export declare const iconTypes: readonly ["brands", "duotone", "light", "regular", "sharp-solid", "solid", "thin"];
106
- export type IconType = (typeof iconTypes)[number];
@@ -1,23 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.iconTypes = exports.createCtaButtonSchema = exports.redirectsSchema = exports.searchSchema = exports.feedbackSchema = exports.footerSocialsSchema = exports.metadataSchema = exports.isWhiteLabeledSchema = exports.modeToggleSchema = exports.logoSchema = exports.nameSchema = void 0;
4
- var zod_1 = require("zod");
5
- exports.nameSchema = zod_1.z
1
+ import { z } from 'zod';
2
+ export var nameSchema = z
6
3
  .string({ required_error: 'Name is missing.' })
7
4
  .min(1, 'Name cannot be empty.')
8
5
  .trim();
9
- exports.logoSchema = zod_1.z.union([
10
- zod_1.z.string().min(3, 'Logo needs to be a path to your logo file including the file extension.'),
11
- zod_1.z.object({
12
- light: zod_1.z.string(),
13
- dark: zod_1.z.string(),
14
- href: zod_1.z.string().optional(),
6
+ export var logoSchema = z.union([
7
+ z.string().min(3, 'Logo needs to be a path to your logo file including the file extension.'),
8
+ z.object({
9
+ light: z.string(),
10
+ dark: z.string(),
11
+ href: z.string().optional(),
15
12
  }),
16
13
  ], {
17
14
  invalid_type_error: 'Logo must be a string or an object with light and dark properties.',
18
15
  });
19
- exports.modeToggleSchema = zod_1.z.object({
20
- default: zod_1.z
16
+ export var modeToggleSchema = z.object({
17
+ default: z
21
18
  .enum(['light', 'dark'], {
22
19
  errorMap: function () {
23
20
  return {
@@ -26,57 +23,57 @@ exports.modeToggleSchema = zod_1.z.object({
26
23
  },
27
24
  })
28
25
  .optional(),
29
- isHidden: zod_1.z
26
+ isHidden: z
30
27
  .boolean({
31
28
  invalid_type_error: 'isHidden must be a boolean. Try writing true or false without the quotes.',
32
29
  })
33
30
  .optional(),
34
31
  });
35
- exports.isWhiteLabeledSchema = zod_1.z.boolean({
32
+ export var isWhiteLabeledSchema = z.boolean({
36
33
  invalid_type_error: 'isWhiteLabeled must be a boolean. Try writing true or false without the quotes.',
37
34
  });
38
- exports.metadataSchema = zod_1.z.record(zod_1.z.string({ invalid_type_error: 'metadata keys must be strings' }), zod_1.z
35
+ export var metadataSchema = z.record(z.string({ invalid_type_error: 'metadata keys must be strings' }), z
39
36
  .string({ invalid_type_error: 'metadata values must be strings' })
40
37
  .min(1, 'metadata values must not be empty'));
41
- exports.footerSocialsSchema = zod_1.z.union([
38
+ export var footerSocialsSchema = z.union([
42
39
  // TO DO: deprecate array types
43
- zod_1.z.array(zod_1.z.object({
44
- type: zod_1.z.string(),
45
- url: zod_1.z.string().url('footerSocials url must be a valid url'),
40
+ z.array(z.object({
41
+ type: z.string(),
42
+ url: z.string().url('footerSocials url must be a valid url'),
46
43
  })),
47
- zod_1.z.record(zod_1.z.string().trim().min(1, 'footerSocials name (the key in the object) must not be empty'), zod_1.z.string().url('footerSocials url (the value in the object) must be a valid url')),
44
+ z.record(z.string().trim().min(1, 'footerSocials name (the key in the object) must not be empty'), z.string().url('footerSocials url (the value in the object) must be a valid url')),
48
45
  ], {
49
46
  invalid_type_error: 'footerSocials must be an object where the key is the name of the social media and the value is the url to your profile. For example: { "twitter": "https://twitter.com/mintlify" }',
50
47
  });
51
- exports.feedbackSchema = zod_1.z.object({
52
- thumbsRating: zod_1.z
48
+ export var feedbackSchema = z.object({
49
+ thumbsRating: z
53
50
  .boolean({
54
51
  invalid_type_error: 'thumbsRating must be a boolean. Try writing true or false without the quotes.',
55
52
  })
56
53
  .optional(),
57
- suggestEdit: zod_1.z
54
+ suggestEdit: z
58
55
  .boolean({
59
56
  invalid_type_error: 'suggestEdit must be a boolean. Try writing true or false without the quotes.',
60
57
  })
61
58
  .optional(),
62
- raiseIssue: zod_1.z
59
+ raiseIssue: z
63
60
  .boolean({
64
61
  invalid_type_error: 'raiseIssue must be a boolean. Try writing true or false without the quotes.',
65
62
  })
66
63
  .optional(),
67
64
  });
68
- exports.searchSchema = zod_1.z.object({
69
- prompt: zod_1.z
65
+ export var searchSchema = z.object({
66
+ prompt: z
70
67
  .string({
71
68
  invalid_type_error: 'search.prompt must be a string. If this field is undefined, the default prompt is `Search...`',
72
69
  })
73
70
  .optional(),
74
71
  });
75
- var redirectSchema = zod_1.z.object({
76
- source: zod_1.z.string(),
77
- destination: zod_1.z.string(),
72
+ var redirectSchema = z.object({
73
+ source: z.string(),
74
+ destination: z.string(),
78
75
  });
79
- exports.redirectsSchema = zod_1.z
76
+ export var redirectsSchema = z
80
77
  .array(redirectSchema, {
81
78
  invalid_type_error: 'redirects must be an array of objects with source and destination properties',
82
79
  })
@@ -86,16 +83,16 @@ exports.redirectsSchema = zod_1.z
86
83
  }, {
87
84
  message: 'Sources in the array must be unique.',
88
85
  });
89
- var createCtaButtonSchema = function (ctaButtonName) {
90
- return zod_1.z.union([
91
- zod_1.z
86
+ export var createCtaButtonSchema = function (ctaButtonName) {
87
+ return z.union([
88
+ z
92
89
  .object({
93
- type: zod_1.z.literal('link').optional(),
94
- name: zod_1.z.string({
90
+ type: z.literal('link').optional(),
91
+ name: z.string({
95
92
  required_error: 'Name must be defined when using a CTA button',
96
93
  invalid_type_error: 'Name must be a string',
97
94
  }),
98
- url: zod_1.z
95
+ url: z
99
96
  .string({
100
97
  required_error: ctaButtonName + '.url is missing',
101
98
  invalid_type_error: ctaButtonName + '.url must be a string',
@@ -104,10 +101,10 @@ var createCtaButtonSchema = function (ctaButtonName) {
104
101
  })
105
102
  .strict(ctaButtonName +
106
103
  ' can only contain name, url, and type properties. Set a different type if you need to set other fields.'),
107
- zod_1.z
104
+ z
108
105
  .object({
109
- type: zod_1.z.literal('github'),
110
- url: zod_1.z
106
+ type: z.literal('github'),
107
+ url: z
111
108
  .string({
112
109
  required_error: ctaButtonName +
113
110
  '.url is missing. Please set the url to a link to your GitHub repository.',
@@ -123,13 +120,3 @@ var createCtaButtonSchema = function (ctaButtonName) {
123
120
  ' must be an object. The object can have type="link" (the default) if you define a url and a name. You can also have type="github" if you define a url pointing to your GitHub repo and set the type in the object.',
124
121
  });
125
122
  };
126
- exports.createCtaButtonSchema = createCtaButtonSchema;
127
- exports.iconTypes = [
128
- 'brands',
129
- 'duotone',
130
- 'light',
131
- 'regular',
132
- 'sharp-solid',
133
- 'solid',
134
- 'thin',
135
- ];
@@ -59,4 +59,3 @@ export declare const colorsSchema: z.ZodObject<{
59
59
  ultraLight?: any;
60
60
  ultraDark?: any;
61
61
  }>;
62
- export type ColorsType = z.infer<typeof colorsSchema>;
@@ -1,43 +1,40 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.colorsSchema = void 0;
4
- var zod_1 = require("zod");
5
- var hexadecimalPattern_1 = require("../hexadecimalPattern");
6
- var anchorColors_1 = require("./anchorColors");
7
- exports.colorsSchema = zod_1.z
1
+ import { z } from 'zod';
2
+ import { hexadecimalPattern } from '../hexadecimalPattern.js';
3
+ import { anchorColorSchema } from './anchorColors.js';
4
+ export var colorsSchema = z
8
5
  .object({
9
- primary: zod_1.z
6
+ primary: z
10
7
  .string({ invalid_type_error: 'Primary color must be a string.' })
11
8
  .min(1, 'Color primary is missing.')
12
- .regex(hexadecimalPattern_1.hexadecimalPattern, 'Primary color must be a hexadecimal color including the # at the start.'),
13
- light: zod_1.z
9
+ .regex(hexadecimalPattern, 'Primary color must be a hexadecimal color including the # at the start.'),
10
+ light: z
14
11
  .string({ invalid_type_error: 'Light color must be a string.' })
15
- .regex(hexadecimalPattern_1.hexadecimalPattern, 'Light color must be a hexadecimal color including the # at the start.')
12
+ .regex(hexadecimalPattern, 'Light color must be a hexadecimal color including the # at the start.')
16
13
  .optional(),
17
- dark: zod_1.z
14
+ dark: z
18
15
  .string({ invalid_type_error: 'Dark color must be a string.' })
19
- .regex(hexadecimalPattern_1.hexadecimalPattern, 'Dark color must be a hexadecimal color including the # at the start.')
16
+ .regex(hexadecimalPattern, 'Dark color must be a hexadecimal color including the # at the start.')
20
17
  .optional(),
21
- background: zod_1.z
18
+ background: z
22
19
  .object({
23
- light: zod_1.z
20
+ light: z
24
21
  .string({
25
22
  invalid_type_error: 'Background light color must be a string.',
26
23
  })
27
- .regex(hexadecimalPattern_1.hexadecimalPattern, 'Background light color must be a hexadecimal color including the # at the start.')
24
+ .regex(hexadecimalPattern, 'Background light color must be a hexadecimal color including the # at the start.')
28
25
  .optional(),
29
- dark: zod_1.z
26
+ dark: z
30
27
  .string({
31
28
  invalid_type_error: 'Background dark color must be a string.',
32
29
  })
33
- .regex(hexadecimalPattern_1.hexadecimalPattern, 'Background dark color must be a hexadecimal color including the # at the start.')
30
+ .regex(hexadecimalPattern, 'Background dark color must be a hexadecimal color including the # at the start.')
34
31
  .optional(),
35
32
  })
36
33
  .optional(),
37
- anchors: anchorColors_1.anchorColorSchema.optional(),
34
+ anchors: anchorColorSchema.optional(),
38
35
  // Prevent strict() from throwing an error when the user defines a deprecated ultraLight / ultraDark color.
39
- ultraLight: zod_1.z.any().optional(),
40
- ultraDark: zod_1.z.any().optional(),
36
+ ultraLight: z.any().optional(),
37
+ ultraDark: z.any().optional(),
41
38
  }, {
42
39
  required_error: 'Colors are missing. You need to define at least the primary color. For example: { "colors": { "primary": "#ff0000" } }',
43
40
  invalid_type_error: 'Colors must be an object.',
@@ -216,7 +216,7 @@ export declare const configSchema: z.ZodObject<{
216
216
  type: "github";
217
217
  url: string;
218
218
  }>]>, "many">>;
219
- navigation: z.ZodArray<z.ZodType<import("../types").MintNavigationGroup, z.ZodTypeDef, import("../types").MintNavigationGroup>, "many">;
219
+ navigation: z.ZodArray<z.ZodType<import("@mintlify/models").NavigationGroup, z.ZodTypeDef, import("@mintlify/models").NavigationGroup>, "many">;
220
220
  primaryTab: z.ZodOptional<z.ZodObject<{
221
221
  name: z.ZodString;
222
222
  }, "strict", z.ZodTypeAny, {
@@ -227,21 +227,21 @@ export declare const configSchema: z.ZodObject<{
227
227
  topAnchor: z.ZodOptional<z.ZodObject<{
228
228
  name: z.ZodString;
229
229
  icon: z.ZodOptional<z.ZodString>;
230
- iconType: z.ZodOptional<z.ZodEnum<["brands", "duotone", "light", "sharp-solid", "solid", "thin"]>>;
230
+ iconType: z.ZodOptional<z.ZodEnum<["brands", "duotone", "light", "regular", "sharp-solid", "solid", "thin"]>>;
231
231
  }, "strict", z.ZodTypeAny, {
232
232
  name: string;
233
233
  icon?: string | undefined;
234
- iconType?: "brands" | "duotone" | "light" | "sharp-solid" | "solid" | "thin" | undefined;
234
+ iconType?: "brands" | "duotone" | "light" | "regular" | "sharp-solid" | "solid" | "thin" | undefined;
235
235
  }, {
236
236
  name: string;
237
237
  icon?: string | undefined;
238
- iconType?: "brands" | "duotone" | "light" | "sharp-solid" | "solid" | "thin" | undefined;
238
+ iconType?: "brands" | "duotone" | "light" | "regular" | "sharp-solid" | "solid" | "thin" | undefined;
239
239
  }>>;
240
240
  anchors: z.ZodOptional<z.ZodArray<z.ZodObject<{
241
241
  name: z.ZodString;
242
242
  url: z.ZodString;
243
243
  icon: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
244
- iconType: z.ZodOptional<z.ZodEnum<["brands", "duotone", "light", "sharp-solid", "solid", "thin"]>>;
244
+ iconType: z.ZodOptional<z.ZodEnum<["brands", "duotone", "light", "regular", "sharp-solid", "solid", "thin"]>>;
245
245
  color: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
246
246
  from: z.ZodString;
247
247
  via: z.ZodOptional<z.ZodString>;
@@ -261,7 +261,7 @@ export declare const configSchema: z.ZodObject<{
261
261
  name: string;
262
262
  url: string;
263
263
  icon?: string | undefined;
264
- iconType?: "brands" | "duotone" | "light" | "sharp-solid" | "solid" | "thin" | undefined;
264
+ iconType?: "brands" | "duotone" | "light" | "regular" | "sharp-solid" | "solid" | "thin" | undefined;
265
265
  color?: string | {
266
266
  from: string;
267
267
  to: string;
@@ -273,7 +273,7 @@ export declare const configSchema: z.ZodObject<{
273
273
  name: string;
274
274
  url: string;
275
275
  icon?: string | undefined;
276
- iconType?: "brands" | "duotone" | "light" | "sharp-solid" | "solid" | "thin" | undefined;
276
+ iconType?: "brands" | "duotone" | "light" | "regular" | "sharp-solid" | "solid" | "thin" | undefined;
277
277
  color?: string | {
278
278
  from: string;
279
279
  to: string;
@@ -540,7 +540,7 @@ export declare const configSchema: z.ZodObject<{
540
540
  ultraLight?: any;
541
541
  ultraDark?: any;
542
542
  };
543
- navigation: import("../types").MintNavigationGroup[];
543
+ navigation: import("@mintlify/models").NavigationGroup[];
544
544
  mintlify?: string | undefined;
545
545
  logo?: string | {
546
546
  light: string;
@@ -596,13 +596,13 @@ export declare const configSchema: z.ZodObject<{
596
596
  topAnchor?: {
597
597
  name: string;
598
598
  icon?: string | undefined;
599
- iconType?: "brands" | "duotone" | "light" | "sharp-solid" | "solid" | "thin" | undefined;
599
+ iconType?: "brands" | "duotone" | "light" | "regular" | "sharp-solid" | "solid" | "thin" | undefined;
600
600
  } | undefined;
601
601
  anchors?: {
602
602
  name: string;
603
603
  url: string;
604
604
  icon?: string | undefined;
605
- iconType?: "brands" | "duotone" | "light" | "sharp-solid" | "solid" | "thin" | undefined;
605
+ iconType?: "brands" | "duotone" | "light" | "regular" | "sharp-solid" | "solid" | "thin" | undefined;
606
606
  color?: string | {
607
607
  from: string;
608
608
  to: string;
@@ -696,7 +696,7 @@ export declare const configSchema: z.ZodObject<{
696
696
  ultraLight?: any;
697
697
  ultraDark?: any;
698
698
  };
699
- navigation: import("../types").MintNavigationGroup[];
699
+ navigation: import("@mintlify/models").NavigationGroup[];
700
700
  $schema?: string | undefined;
701
701
  mintlify?: string | undefined;
702
702
  logo?: string | {
@@ -753,13 +753,13 @@ export declare const configSchema: z.ZodObject<{
753
753
  topAnchor?: {
754
754
  name: string;
755
755
  icon?: string | undefined;
756
- iconType?: "brands" | "duotone" | "light" | "sharp-solid" | "solid" | "thin" | undefined;
756
+ iconType?: "brands" | "duotone" | "light" | "regular" | "sharp-solid" | "solid" | "thin" | undefined;
757
757
  } | undefined;
758
758
  anchors?: {
759
759
  name: string;
760
760
  url: string;
761
761
  icon?: string | undefined;
762
- iconType?: "brands" | "duotone" | "light" | "sharp-solid" | "solid" | "thin" | undefined;
762
+ iconType?: "brands" | "duotone" | "light" | "regular" | "sharp-solid" | "solid" | "thin" | undefined;
763
763
  color?: string | {
764
764
  from: string;
765
765
  to: string;
@@ -835,4 +835,3 @@ export declare const configSchema: z.ZodObject<{
835
835
  destination: string;
836
836
  }[] | undefined;
837
837
  }>;
838
- export type ConfigType = z.infer<typeof configSchema>;
@@ -1,42 +1,39 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.configSchema = void 0;
4
- var zod_1 = require("zod");
5
- var analytics_1 = require("./analytics");
6
- var anchors_1 = require("./anchors");
7
- var apiReference_1 = require("./apiReference");
8
- var basics_1 = require("./basics");
9
- var colors_1 = require("./colors");
10
- var favicon_1 = require("./favicon");
11
- var integrations_1 = require("./integrations");
12
- var navigation_1 = require("./navigation");
13
- var tabs_1 = require("./tabs");
14
- var versions_1 = require("./versions");
15
- exports.configSchema = zod_1.z.object({
16
- $schema: zod_1.z.string().url().optional().default('https://mintlify.com/schema.json'),
17
- mintlify: zod_1.z.string().optional(),
18
- name: basics_1.nameSchema,
19
- logo: basics_1.logoSchema.optional(),
20
- favicon: favicon_1.faviconSchema,
21
- openapi: apiReference_1.openApiSchema.optional(),
22
- api: apiReference_1.apiSchema.optional(),
23
- modeToggle: basics_1.modeToggleSchema.optional(),
24
- versions: versions_1.versionsSchema.optional(),
25
- metadata: basics_1.metadataSchema.optional(),
26
- colors: colors_1.colorsSchema,
27
- topbarCtaButton: (0, basics_1.createCtaButtonSchema)('topbarCtaButton').optional(),
28
- topbarLinks: zod_1.z.array((0, basics_1.createCtaButtonSchema)('topbarLinks')).optional(),
29
- navigation: navigation_1.navigationConfigSchema,
30
- primaryTab: tabs_1.primaryTabSchema.optional(),
31
- topAnchor: anchors_1.topAnchorSchema.optional(),
32
- anchors: anchors_1.anchorsSchema.optional(),
33
- tabs: tabs_1.tabsSchema.optional(),
34
- footerSocials: basics_1.footerSocialsSchema.optional(),
35
- backgroundImage: zod_1.z.string().optional(),
36
- feedback: basics_1.feedbackSchema.optional(),
37
- analytics: analytics_1.analyticsSchema.optional(),
38
- integrations: integrations_1.integrationsSchema.optional(),
39
- isWhiteLabeled: basics_1.isWhiteLabeledSchema.optional(),
40
- search: basics_1.searchSchema.optional(),
41
- redirects: basics_1.redirectsSchema.optional(),
1
+ import { z } from 'zod';
2
+ import { analyticsSchema } from './analytics.js';
3
+ import { anchorSchema, topAnchorSchema } from './anchors.js';
4
+ import { apiSchema, openApiSchema } from './apiReference.js';
5
+ import { nameSchema, logoSchema, modeToggleSchema, isWhiteLabeledSchema, footerSocialsSchema, feedbackSchema, metadataSchema, createCtaButtonSchema, searchSchema, redirectsSchema, } from './basics.js';
6
+ import { colorsSchema } from './colors.js';
7
+ import { faviconSchema } from './favicon.js';
8
+ import { integrationsSchema } from './integrations.js';
9
+ import { navigationSchema } from './navigation.js';
10
+ import { tabsSchema, primaryTabSchema } from './tabs.js';
11
+ import { versionsSchema } from './versions.js';
12
+ export var configSchema = z.object({
13
+ $schema: z.string().url().optional().default('https://mintlify.com/schema.json'),
14
+ mintlify: z.string().optional(),
15
+ name: nameSchema,
16
+ logo: logoSchema.optional(),
17
+ favicon: faviconSchema,
18
+ openapi: openApiSchema.optional(),
19
+ api: apiSchema.optional(),
20
+ modeToggle: modeToggleSchema.optional(),
21
+ versions: versionsSchema.optional(),
22
+ metadata: metadataSchema.optional(),
23
+ colors: colorsSchema,
24
+ topbarCtaButton: createCtaButtonSchema('topbarCtaButton').optional(),
25
+ topbarLinks: createCtaButtonSchema('topbarLinks').array().optional(),
26
+ navigation: navigationSchema,
27
+ primaryTab: primaryTabSchema.optional(),
28
+ topAnchor: topAnchorSchema.optional(),
29
+ anchors: anchorSchema.array().optional(),
30
+ tabs: tabsSchema.optional(),
31
+ footerSocials: footerSocialsSchema.optional(),
32
+ backgroundImage: z.string().optional(),
33
+ feedback: feedbackSchema.optional(),
34
+ analytics: analyticsSchema.optional(),
35
+ integrations: integrationsSchema.optional(),
36
+ isWhiteLabeled: isWhiteLabeledSchema.optional(),
37
+ search: searchSchema.optional(),
38
+ redirects: redirectsSchema.optional(),
42
39
  });
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.faviconSchema = void 0;
4
- var zod_1 = require("zod");
5
- exports.faviconSchema = zod_1.z
1
+ import { z } from 'zod';
2
+ export var faviconSchema = z
6
3
  .string({
7
4
  required_error: 'Favicon is missing. Please set favicon to the path of your favicon file. We recommend using a .svg or .png file. Mintlify automatically resizes your favicon to the sizes needed.',
8
5
  invalid_type_error: 'Favicon must be a string path pointing to the favicon file in your Mintlify folder.',
@@ -1,6 +1,4 @@
1
1
  import { z } from 'zod';
2
- declare const intercomSchema: z.ZodString;
3
- declare const frontchatSchema: z.ZodString;
4
2
  export declare const integrationsSchema: z.ZodObject<{
5
3
  intercom: z.ZodOptional<z.ZodString>;
6
4
  frontchat: z.ZodOptional<z.ZodString>;
@@ -11,7 +9,3 @@ export declare const integrationsSchema: z.ZodObject<{
11
9
  intercom?: string | undefined;
12
10
  frontchat?: string | undefined;
13
11
  }>;
14
- export type IntercomType = z.infer<typeof intercomSchema>;
15
- export type FrontchatType = z.infer<typeof frontchatSchema>;
16
- export type IntegrationsType = z.infer<typeof integrationsSchema>;
17
- export {};
@@ -1,14 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.integrationsSchema = void 0;
4
- var zod_1 = require("zod");
5
- var intercomSchema = zod_1.z
1
+ import { z } from 'zod';
2
+ var intercomSchema = z
6
3
  .string({ invalid_type_error: 'integrations.intercom must be a string' })
7
4
  .min(6, 'integrations.intercom must be a valid Intercom app ID');
8
- var frontchatSchema = zod_1.z
5
+ var frontchatSchema = z
9
6
  .string({ invalid_type_error: 'integrations.frontchat must be a string' })
10
7
  .min(6, 'integrations.frontchat must be a valid Front chat snippet id');
11
- exports.integrationsSchema = zod_1.z.object({
8
+ export var integrationsSchema = z.object({
12
9
  intercom: intercomSchema.optional(),
13
10
  frontchat: frontchatSchema.optional(),
14
11
  }, { invalid_type_error: 'integrations must be an object' });
@@ -1,3 +1,16 @@
1
+ import { NavigationGroup } from '@mintlify/models';
1
2
  import { z } from 'zod';
2
- import { MintNavigationGroup } from '../types/navigation';
3
- export declare const navigationConfigSchema: z.ZodArray<z.ZodType<MintNavigationGroup, z.ZodTypeDef, MintNavigationGroup>, "many">;
3
+ export declare const baseNavigationGroupSchema: z.ZodObject<{
4
+ group: z.ZodString;
5
+ icon: z.ZodOptional<z.ZodString>;
6
+ version: z.ZodOptional<z.ZodString>;
7
+ }, "strict", z.ZodTypeAny, {
8
+ group: string;
9
+ icon?: string | undefined;
10
+ version?: string | undefined;
11
+ }, {
12
+ group: string;
13
+ icon?: string | undefined;
14
+ version?: string | undefined;
15
+ }>;
16
+ export declare const navigationSchema: z.ZodArray<z.ZodType<NavigationGroup, z.ZodTypeDef, NavigationGroup>, "many">;
@@ -1,26 +1,26 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.navigationConfigSchema = void 0;
4
- var zod_1 = require("zod");
5
- var navigationSchema = zod_1.z.lazy(function () {
6
- return zod_1.z
7
- .object({
8
- // We allow top-level groups to be an empty string if the user wants to hide the title.
9
- // Future work should refactor this so nested groups are non-empty strings.
10
- group: zod_1.z.string({
11
- required_error: 'Missing navigation group name.',
12
- invalid_type_error: 'Group must be a string. We use the group name to create the navigation sidebar.',
13
- }),
14
- pages: zod_1.z
15
- .array(zod_1.z.union([navigationSchema, zod_1.z.string().min(1, 'Page cannot be an empty string.')]))
16
- .min(1, "Pages array can't be empty."),
17
- icon: zod_1.z.string({ invalid_type_error: 'Icon must be a string.' }).optional(),
18
- version: zod_1.z.string({ invalid_type_error: 'Version must be a string.' }).optional(),
19
- }, { invalid_type_error: 'Navigation entry must be an object.' })
20
- .strict('Navigation entry can only contain group, pages, icon, and version.');
1
+ import { z } from 'zod';
2
+ // export to allow type testing against @mintlify/models
3
+ export var baseNavigationGroupSchema = z
4
+ .object({
5
+ // We allow top-level groups to be an empty string if the user wants to hide the title.
6
+ // Future work should refactor this so nested groups are non-empty strings.
7
+ group: z.string({
8
+ required_error: 'Missing navigation group name.',
9
+ invalid_type_error: 'Group must be a string. We use the group name to create the navigation sidebar.',
10
+ }),
11
+ icon: z.string({ invalid_type_error: 'Icon must be a string.' }).optional(),
12
+ version: z.string({ invalid_type_error: 'Version must be a string.' }).optional(),
13
+ }, { invalid_type_error: 'Navigation entry must be an object.' })
14
+ .strict('Navigation entry can only contain group, pages, icon, and version.');
15
+ var navigationGroupSchema = baseNavigationGroupSchema.extend({
16
+ pages: z.lazy(function () {
17
+ return z
18
+ .array(z.union([navigationGroupSchema, z.string().min(1, 'Page cannot be an empty string.')]))
19
+ .min(1, "Pages array can't be empty.");
20
+ }),
21
21
  });
22
- exports.navigationConfigSchema = zod_1.z
23
- .array(navigationSchema, {
22
+ export var navigationSchema = z
23
+ .array(navigationGroupSchema, {
24
24
  required_error: 'Navigation is missing.',
25
25
  invalid_type_error: 'Navigation must be an array.',
26
26
  })