@mintlify/validation 0.1.246 → 0.1.248

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 (56) hide show
  1. package/dist/mint-config/schemas/v2/index.d.ts +5215 -2155
  2. package/dist/mint-config/schemas/v2/index.js +8 -6
  3. package/dist/mint-config/schemas/v2/properties/api.d.ts +11 -11
  4. package/dist/mint-config/schemas/v2/properties/api.js +3 -5
  5. package/dist/mint-config/schemas/v2/properties/appearance.d.ts +4 -4
  6. package/dist/mint-config/schemas/v2/properties/appearance.js +6 -3
  7. package/dist/mint-config/schemas/v2/properties/icons.d.ts +2 -2
  8. package/dist/mint-config/schemas/v2/properties/icons.js +3 -1
  9. package/dist/mint-config/schemas/v2/properties/index.d.ts +9 -0
  10. package/dist/mint-config/schemas/v2/properties/index.js +9 -0
  11. package/dist/mint-config/schemas/v2/properties/navigation/anchors.d.ts +225 -2
  12. package/dist/mint-config/schemas/v2/properties/navigation/anchors.js +10 -16
  13. package/dist/mint-config/schemas/v2/properties/navigation/divisionSchemas.d.ts +7 -0
  14. package/dist/mint-config/schemas/v2/properties/navigation/divisionSchemas.js +26 -0
  15. package/dist/mint-config/schemas/v2/properties/navigation/dropdown.d.ts +155 -2
  16. package/dist/mint-config/schemas/v2/properties/navigation/dropdown.js +10 -16
  17. package/dist/mint-config/schemas/v2/properties/navigation/global.d.ts +25 -0
  18. package/dist/mint-config/schemas/v2/properties/navigation/groups.d.ts +638 -6
  19. package/dist/mint-config/schemas/v2/properties/navigation/groups.js +15 -7
  20. package/dist/mint-config/schemas/v2/properties/navigation/index.d.ts +1338 -295
  21. package/dist/mint-config/schemas/v2/properties/navigation/index.js +20 -18
  22. package/dist/mint-config/schemas/v2/properties/navigation/languages.d.ts +47 -214
  23. package/dist/mint-config/schemas/v2/properties/navigation/languages.js +10 -18
  24. package/dist/mint-config/schemas/v2/properties/navigation/pages.d.ts +4 -0
  25. package/dist/mint-config/schemas/v2/properties/navigation/pages.js +6 -2
  26. package/dist/mint-config/schemas/v2/properties/navigation/tabs.d.ts +153 -2
  27. package/dist/mint-config/schemas/v2/properties/navigation/tabs.js +8 -16
  28. package/dist/mint-config/schemas/v2/properties/navigation/version.d.ts +81 -2
  29. package/dist/mint-config/schemas/v2/properties/navigation/version.js +10 -16
  30. package/dist/mint-config/schemas/v2/properties/reusable/divisions.d.ts +2 -0
  31. package/dist/mint-config/schemas/v2/properties/reusable/divisions.js +1 -0
  32. package/dist/mint-config/schemas/v2/properties/reusable/index.d.ts +4 -0
  33. package/dist/mint-config/schemas/v2/properties/reusable/index.js +4 -0
  34. package/dist/mint-config/schemas/v2/properties/reusable/page.d.ts +86 -0
  35. package/dist/mint-config/schemas/v2/properties/reusable/page.js +27 -0
  36. package/dist/mint-config/schemas/v2/properties/seo.d.ts +2 -2
  37. package/dist/mint-config/schemas/v2/properties/seo.js +1 -2
  38. package/dist/mint-config/schemas/v2/properties/styling.d.ts +6 -6
  39. package/dist/mint-config/schemas/v2/properties/styling.js +3 -6
  40. package/dist/mint-config/schemas/v2/themes/{quill.d.ts → linden.d.ts} +740 -540
  41. package/dist/mint-config/schemas/v2/themes/linden.js +3 -0
  42. package/dist/mint-config/schemas/v2/themes/{venus.d.ts → maple.d.ts} +740 -540
  43. package/dist/mint-config/schemas/v2/themes/maple.js +3 -0
  44. package/dist/mint-config/schemas/v2/themes/mint.d.ts +736 -536
  45. package/dist/mint-config/schemas/v2/themes/{prism.d.ts → palm.d.ts} +740 -540
  46. package/dist/mint-config/schemas/v2/themes/palm.js +3 -0
  47. package/dist/mint-config/schemas/v2/themes/reusable/index.d.ts +520 -320
  48. package/dist/mint-config/schemas/v2/themes/willow.d.ts +2262 -0
  49. package/dist/mint-config/schemas/v2/themes/willow.js +3 -0
  50. package/dist/mint-config/upgrades/upgradeToDocsConfig.d.ts +2 -5
  51. package/dist/mint-config/upgrades/upgradeToDocsConfig.js +47 -29
  52. package/dist/tsconfig.build.tsbuildinfo +1 -1
  53. package/package.json +2 -2
  54. package/dist/mint-config/schemas/v2/themes/prism.js +0 -3
  55. package/dist/mint-config/schemas/v2/themes/quill.js +0 -3
  56. package/dist/mint-config/schemas/v2/themes/venus.js +0 -3
@@ -0,0 +1,3 @@
1
+ import { z } from 'zod';
2
+ import { standardConfigSchema } from './reusable/index.js';
3
+ export const willowConfigSchema = z.object(Object.assign({ theme: z.literal('willow') }, standardConfigSchema));
@@ -1,6 +1,3 @@
1
1
  import { ConfigType } from '@mintlify/models';
2
- import { z } from 'zod';
3
- import { docsConfigSchema } from '../schemas/v2/index.js';
4
- type ConfigV2Type = z.infer<typeof docsConfigSchema>;
5
- export declare function upgradeToDocsConfig(config: ConfigType): ConfigV2Type;
6
- export {};
2
+ import { DocsConfig } from '../schemas/v2/index.js';
3
+ export declare function upgradeToDocsConfig(config: ConfigType): DocsConfig;
@@ -12,15 +12,24 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import _ from 'lodash';
13
13
  import { updateNavigationToDocsConfig } from './updateNavigationToDocsConfig.js';
14
14
  function updateRounded(config) {
15
+ if (config.rounded == undefined) {
16
+ return undefined;
17
+ }
15
18
  return config.rounded === 'sharp' ? 'sharp' : 'regular';
16
19
  }
17
20
  function updateEyebrows(config) {
18
21
  var _a;
19
- return ((_a = config.eyebrow) === null || _a === void 0 ? void 0 : _a.display) === 'section' ? 'section' : 'breadcrumbs';
22
+ if (((_a = config.eyebrow) === null || _a === void 0 ? void 0 : _a.display) == undefined) {
23
+ return undefined;
24
+ }
25
+ return config.eyebrow.display === 'breadcrumbs' ? 'breadcrumbs' : 'section';
20
26
  }
21
27
  function updateCodeblocks(config) {
22
28
  var _a;
23
- return ((_a = config.codeBlock) === null || _a === void 0 ? void 0 : _a.mode) === 'dark' ? 'dark' : 'system';
29
+ if (((_a = config.codeBlock) === null || _a === void 0 ? void 0 : _a.mode) == undefined) {
30
+ return undefined;
31
+ }
32
+ return config.codeBlock.mode === 'dark' ? 'dark' : 'system';
24
33
  }
25
34
  function updateApiPlayground(config) {
26
35
  var _a, _b, _c, _d;
@@ -33,13 +42,14 @@ function updateApiPlayground(config) {
33
42
  case 'show':
34
43
  return 'interactive';
35
44
  case 'hide':
36
- case undefined:
37
45
  return 'none';
46
+ case undefined:
47
+ return undefined;
38
48
  default:
39
49
  return oldMode;
40
50
  }
41
51
  })();
42
- const proxy = disableProxy !== undefined ? !disableProxy : undefined;
52
+ const proxy = disableProxy == undefined ? undefined : !disableProxy;
43
53
  return { display, proxy };
44
54
  }
45
55
  function updateTopbarPrimary(config) {
@@ -93,16 +103,17 @@ function updateFooterSocials(config) {
93
103
  }
94
104
  export function upgradeToDocsConfig(config) {
95
105
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
106
+ const theme = 'mint';
96
107
  const fonts = updateFont(config);
97
108
  const playground = updateApiPlayground(config);
98
109
  const rounded = updateRounded(config);
99
110
  const eyebrows = updateEyebrows(config);
100
111
  const codeblocks = updateCodeblocks(config);
101
- const v2Config = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ $schema: 'https://mintlify.com/docs.json', theme: 'mint', name: config.name, colors: {
112
+ const v2Config = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ $schema: 'https://mintlify.com/docs.json', theme, name: config.name, colors: {
102
113
  primary: config.colors.primary,
103
114
  light: config.colors.light,
104
115
  dark: config.colors.dark,
105
- }, favicon: config.favicon, navigation: updateNavigationToDocsConfig(config) }, (config.rounded || config.eyebrow || config.codeBlock
116
+ }, favicon: config.favicon, navigation: updateNavigationToDocsConfig(config) }, (rounded || eyebrows || codeblocks
106
117
  ? {
107
118
  styling: {
108
119
  rounded,
@@ -117,7 +128,13 @@ export function upgradeToDocsConfig(config) {
117
128
  config.openapi
118
129
  ? {
119
130
  api: Object.assign(Object.assign(Object.assign(Object.assign({}, (config.openapi ? { openapi: config.openapi } : {})), (playground
120
- ? Object.assign({ display: playground.display }, (playground.proxy !== undefined ? { proxy: playground.proxy } : {})) : {})), (((_j = (_h = (_g = config.api) === null || _g === void 0 ? void 0 : _g.request) === null || _h === void 0 ? void 0 : _h.example) === null || _j === void 0 ? void 0 : _j.languages)
131
+ ? {
132
+ playground: {
133
+ display: playground.display,
134
+ proxy: playground.proxy,
135
+ },
136
+ }
137
+ : {})), (((_j = (_h = (_g = config.api) === null || _g === void 0 ? void 0 : _g.request) === null || _h === void 0 ? void 0 : _h.example) === null || _j === void 0 ? void 0 : _j.languages)
121
138
  ? {
122
139
  examples: {
123
140
  languages: config.api.request.example.languages,
@@ -126,17 +143,17 @@ export function upgradeToDocsConfig(config) {
126
143
  : {})), (((_k = config.api) === null || _k === void 0 ? void 0 : _k.baseUrl) || ((_m = (_l = config.api) === null || _l === void 0 ? void 0 : _l.auth) === null || _m === void 0 ? void 0 : _m.method)
127
144
  ? {
128
145
  mdx: {
129
- base: config.api.baseUrl,
146
+ server: config.api.baseUrl,
130
147
  auth: (_o = config.api.auth) === null || _o === void 0 ? void 0 : _o.method,
131
148
  },
132
149
  }
133
150
  : {})),
134
151
  }
135
- : {})), (config.modeToggle
152
+ : {})), (((_p = config.modeToggle) === null || _p === void 0 ? void 0 : _p.default) || ((_q = config.modeToggle) === null || _q === void 0 ? void 0 : _q.isHidden) != undefined
136
153
  ? {
137
154
  appearance: {
138
- default: (_p = config.modeToggle.default) !== null && _p !== void 0 ? _p : 'system',
139
- strict: (_q = config.modeToggle.isHidden) !== null && _q !== void 0 ? _q : false,
155
+ default: config.modeToggle.default,
156
+ strict: config.modeToggle.isHidden,
140
157
  },
141
158
  }
142
159
  : {})), (config.background || config.backgroundImage || config.colors.background
@@ -150,25 +167,26 @@ export function upgradeToDocsConfig(config) {
150
167
  }
151
168
  : {})),
152
169
  }
153
- : {})), (config.topbarLinks
170
+ : {})), (config.topbarLinks || config.topbarCtaButton
154
171
  ? {
155
- topbar: {
156
- links: config.topbarLinks.map((item) => {
157
- if (item.type === 'link' || item.type === undefined) {
158
- return {
159
- label: item.name,
160
- href: item.url,
161
- };
162
- }
163
- else {
164
- return {
165
- label: _.capitalize(item.type),
166
- href: item.url,
167
- };
168
- }
169
- }),
170
- primary: updateTopbarPrimary(config),
171
- },
172
+ topbar: Object.assign(Object.assign({}, (config.topbarLinks
173
+ ? {
174
+ links: config.topbarLinks.map((item) => {
175
+ if (item.type === 'link' || item.type === undefined) {
176
+ return {
177
+ label: item.name,
178
+ href: item.url,
179
+ };
180
+ }
181
+ else {
182
+ return {
183
+ label: _.capitalize(item.type),
184
+ href: item.url,
185
+ };
186
+ }
187
+ }),
188
+ }
189
+ : {})), { primary: updateTopbarPrimary(config) }),
172
190
  }
173
191
  : {})), (((_s = config.search) === null || _s === void 0 ? void 0 : _s.prompt)
174
192
  ? {