@mintlify/validation 0.1.245 → 0.1.247
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.
- package/dist/mint-config/schemas/v2/index.d.ts +5235 -2167
- package/dist/mint-config/schemas/v2/index.js +8 -6
- package/dist/mint-config/schemas/v2/properties/api.d.ts +14 -11
- package/dist/mint-config/schemas/v2/properties/api.js +5 -5
- package/dist/mint-config/schemas/v2/properties/appearance.d.ts +4 -4
- package/dist/mint-config/schemas/v2/properties/appearance.js +6 -3
- package/dist/mint-config/schemas/v2/properties/icons.d.ts +2 -2
- package/dist/mint-config/schemas/v2/properties/icons.js +3 -1
- package/dist/mint-config/schemas/v2/properties/index.d.ts +9 -0
- package/dist/mint-config/schemas/v2/properties/index.js +9 -0
- package/dist/mint-config/schemas/v2/properties/navigation/anchors.d.ts +225 -2
- package/dist/mint-config/schemas/v2/properties/navigation/anchors.js +10 -16
- package/dist/mint-config/schemas/v2/properties/navigation/divisionSchemas.d.ts +7 -0
- package/dist/mint-config/schemas/v2/properties/navigation/divisionSchemas.js +26 -0
- package/dist/mint-config/schemas/v2/properties/navigation/dropdown.d.ts +155 -2
- package/dist/mint-config/schemas/v2/properties/navigation/dropdown.js +10 -16
- package/dist/mint-config/schemas/v2/properties/navigation/global.d.ts +25 -0
- package/dist/mint-config/schemas/v2/properties/navigation/groups.d.ts +638 -6
- package/dist/mint-config/schemas/v2/properties/navigation/groups.js +15 -7
- package/dist/mint-config/schemas/v2/properties/navigation/index.d.ts +1338 -295
- package/dist/mint-config/schemas/v2/properties/navigation/index.js +20 -18
- package/dist/mint-config/schemas/v2/properties/navigation/languages.d.ts +47 -214
- package/dist/mint-config/schemas/v2/properties/navigation/languages.js +10 -18
- package/dist/mint-config/schemas/v2/properties/navigation/pages.d.ts +4 -0
- package/dist/mint-config/schemas/v2/properties/navigation/pages.js +6 -2
- package/dist/mint-config/schemas/v2/properties/navigation/tabs.d.ts +153 -2
- package/dist/mint-config/schemas/v2/properties/navigation/tabs.js +8 -16
- package/dist/mint-config/schemas/v2/properties/navigation/version.d.ts +81 -2
- package/dist/mint-config/schemas/v2/properties/navigation/version.js +10 -16
- package/dist/mint-config/schemas/v2/properties/reusable/divisions.d.ts +2 -0
- package/dist/mint-config/schemas/v2/properties/reusable/divisions.js +1 -0
- package/dist/mint-config/schemas/v2/properties/reusable/index.d.ts +4 -0
- package/dist/mint-config/schemas/v2/properties/reusable/index.js +4 -0
- package/dist/mint-config/schemas/v2/properties/reusable/page.d.ts +86 -0
- package/dist/mint-config/schemas/v2/properties/reusable/page.js +27 -0
- package/dist/mint-config/schemas/v2/properties/seo.d.ts +2 -2
- package/dist/mint-config/schemas/v2/properties/seo.js +1 -2
- package/dist/mint-config/schemas/v2/properties/styling.d.ts +6 -6
- package/dist/mint-config/schemas/v2/properties/styling.js +3 -6
- package/dist/mint-config/schemas/v2/themes/{quill.d.ts → linden.d.ts} +745 -543
- package/dist/mint-config/schemas/v2/themes/linden.js +3 -0
- package/dist/mint-config/schemas/v2/themes/{venus.d.ts → maple.d.ts} +745 -543
- package/dist/mint-config/schemas/v2/themes/maple.js +3 -0
- package/dist/mint-config/schemas/v2/themes/mint.d.ts +741 -539
- package/dist/mint-config/schemas/v2/themes/{prism.d.ts → palm.d.ts} +745 -543
- package/dist/mint-config/schemas/v2/themes/palm.js +3 -0
- package/dist/mint-config/schemas/v2/themes/reusable/index.d.ts +523 -321
- package/dist/mint-config/schemas/v2/themes/reusable/index.js +0 -2
- package/dist/mint-config/schemas/v2/themes/willow.d.ts +2262 -0
- package/dist/mint-config/schemas/v2/themes/willow.js +3 -0
- package/dist/mint-config/upgrades/upgradeToDocsConfig.d.ts +2 -5
- package/dist/mint-config/upgrades/upgradeToDocsConfig.js +72 -45
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/mint-config/schemas/v2/themes/prism.js +0 -3
- package/dist/mint-config/schemas/v2/themes/quill.js +0 -3
- package/dist/mint-config/schemas/v2/themes/venus.js +0 -3
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { ConfigType } from '@mintlify/models';
|
|
2
|
-
import {
|
|
3
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,22 +42,25 @@ 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
|
|
52
|
+
const proxy = disableProxy == undefined ? undefined : !disableProxy;
|
|
43
53
|
return { display, proxy };
|
|
44
54
|
}
|
|
45
55
|
function updateTopbarPrimary(config) {
|
|
46
56
|
const ctaButton = config.topbarCtaButton;
|
|
47
|
-
if (
|
|
57
|
+
if (!ctaButton)
|
|
58
|
+
return undefined;
|
|
59
|
+
if (ctaButton.type === undefined || ctaButton.type === 'link') {
|
|
48
60
|
return {
|
|
49
61
|
type: 'button',
|
|
50
|
-
label: ctaButton
|
|
51
|
-
href: ctaButton
|
|
62
|
+
label: ctaButton.name,
|
|
63
|
+
href: ctaButton.url,
|
|
52
64
|
};
|
|
53
65
|
}
|
|
54
66
|
return {
|
|
@@ -90,17 +102,18 @@ function updateFooterSocials(config) {
|
|
|
90
102
|
return footerSocials;
|
|
91
103
|
}
|
|
92
104
|
export function upgradeToDocsConfig(config) {
|
|
93
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
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';
|
|
94
107
|
const fonts = updateFont(config);
|
|
95
108
|
const playground = updateApiPlayground(config);
|
|
96
109
|
const rounded = updateRounded(config);
|
|
97
110
|
const eyebrows = updateEyebrows(config);
|
|
98
111
|
const codeblocks = updateCodeblocks(config);
|
|
99
|
-
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
|
|
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: {
|
|
100
113
|
primary: config.colors.primary,
|
|
101
114
|
light: config.colors.light,
|
|
102
115
|
dark: config.colors.dark,
|
|
103
|
-
}, favicon: config.favicon, navigation: updateNavigationToDocsConfig(config) }, (
|
|
116
|
+
}, favicon: config.favicon, navigation: updateNavigationToDocsConfig(config) }, (rounded || eyebrows || codeblocks
|
|
104
117
|
? {
|
|
105
118
|
styling: {
|
|
106
119
|
rounded,
|
|
@@ -108,34 +121,44 @@ export function upgradeToDocsConfig(config) {
|
|
|
108
121
|
codeblocks,
|
|
109
122
|
},
|
|
110
123
|
}
|
|
111
|
-
: {})), { logo: config.logo }), (playground ||
|
|
124
|
+
: {})), { logo: config.logo }), (playground ||
|
|
125
|
+
((_c = (_b = (_a = config.api) === null || _a === void 0 ? void 0 : _a.request) === null || _b === void 0 ? void 0 : _b.example) === null || _c === void 0 ? void 0 : _c.languages) ||
|
|
126
|
+
((_d = config.api) === null || _d === void 0 ? void 0 : _d.baseUrl) ||
|
|
127
|
+
((_f = (_e = config.api) === null || _e === void 0 ? void 0 : _e.auth) === null || _f === void 0 ? void 0 : _f.method) ||
|
|
128
|
+
config.openapi
|
|
112
129
|
? {
|
|
113
|
-
api: Object.assign(Object.assign(Object.assign({}, (playground
|
|
114
|
-
?
|
|
130
|
+
api: Object.assign(Object.assign(Object.assign(Object.assign({}, (config.openapi ? { openapi: config.openapi } : {})), (playground
|
|
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)
|
|
115
138
|
? {
|
|
116
139
|
examples: {
|
|
117
140
|
languages: config.api.request.example.languages,
|
|
118
141
|
},
|
|
119
142
|
}
|
|
120
|
-
: {})), (((
|
|
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)
|
|
121
144
|
? {
|
|
122
145
|
mdx: {
|
|
123
|
-
|
|
124
|
-
auth: (
|
|
146
|
+
server: config.api.baseUrl,
|
|
147
|
+
auth: (_o = config.api.auth) === null || _o === void 0 ? void 0 : _o.method,
|
|
125
148
|
},
|
|
126
149
|
}
|
|
127
150
|
: {})),
|
|
128
151
|
}
|
|
129
|
-
: {})), (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
|
|
130
153
|
? {
|
|
131
154
|
appearance: {
|
|
132
|
-
default:
|
|
133
|
-
strict:
|
|
155
|
+
default: config.modeToggle.default,
|
|
156
|
+
strict: config.modeToggle.isHidden,
|
|
134
157
|
},
|
|
135
158
|
}
|
|
136
159
|
: {})), (config.background || config.backgroundImage || config.colors.background
|
|
137
160
|
? {
|
|
138
|
-
background: Object.assign(Object.assign(Object.assign({}, (config.backgroundImage ? { image: config.backgroundImage } : {})), { decoration: (
|
|
161
|
+
background: Object.assign(Object.assign(Object.assign({}, (config.backgroundImage ? { image: config.backgroundImage } : {})), { decoration: (_r = config.background) === null || _r === void 0 ? void 0 : _r.style }), (config.colors.background
|
|
139
162
|
? {
|
|
140
163
|
color: {
|
|
141
164
|
light: config.colors.background.light,
|
|
@@ -144,37 +167,41 @@ export function upgradeToDocsConfig(config) {
|
|
|
144
167
|
}
|
|
145
168
|
: {})),
|
|
146
169
|
}
|
|
147
|
-
: {})),
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
170
|
+
: {})), (config.topbarLinks
|
|
171
|
+
? {
|
|
172
|
+
topbar: {
|
|
173
|
+
links: config.topbarLinks.map((item) => {
|
|
174
|
+
if (item.type === 'link' || item.type === undefined) {
|
|
175
|
+
return {
|
|
176
|
+
label: item.name,
|
|
177
|
+
href: item.url,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
return {
|
|
182
|
+
label: _.capitalize(item.type),
|
|
183
|
+
href: item.url,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
}),
|
|
187
|
+
primary: updateTopbarPrimary(config),
|
|
188
|
+
},
|
|
189
|
+
}
|
|
190
|
+
: {})), (((_s = config.search) === null || _s === void 0 ? void 0 : _s.prompt)
|
|
164
191
|
? {
|
|
165
192
|
search: {
|
|
166
193
|
prompt: config.search.prompt,
|
|
167
194
|
},
|
|
168
195
|
}
|
|
169
|
-
: {})), (config.metadata || ((
|
|
196
|
+
: {})), (config.metadata || ((_t = config.seo) === null || _t === void 0 ? void 0 : _t.indexHiddenPages) !== undefined
|
|
170
197
|
? {
|
|
171
|
-
seo: Object.assign(Object.assign({}, (config.metadata ? { metatags: config.metadata } : {})), { indexing: ((
|
|
198
|
+
seo: Object.assign(Object.assign({}, (config.metadata ? { metatags: config.metadata } : {})), { indexing: ((_u = config.seo) === null || _u === void 0 ? void 0 : _u.indexHiddenPages) ? 'navigable' : 'all' }),
|
|
172
199
|
}
|
|
173
200
|
: {})), (config.footer || config.footerSocials
|
|
174
201
|
? {
|
|
175
|
-
footer: Object.assign(Object.assign({}, (((
|
|
202
|
+
footer: Object.assign(Object.assign({}, (((_v = config.footer) === null || _v === void 0 ? void 0 : _v.socials) || config.footerSocials
|
|
176
203
|
? { socials: updateFooterSocials(config) }
|
|
177
|
-
: {})), (((
|
|
204
|
+
: {})), (((_w = config.footer) === null || _w === void 0 ? void 0 : _w.links)
|
|
178
205
|
? {
|
|
179
206
|
links: config.footer.links.map((group) => {
|
|
180
207
|
return {
|
|
@@ -192,19 +219,19 @@ export function upgradeToDocsConfig(config) {
|
|
|
192
219
|
}
|
|
193
220
|
: {})), (config.integrations || config.analytics
|
|
194
221
|
? {
|
|
195
|
-
integrations: Object.assign(Object.assign(Object.assign(Object.assign({}, config.analytics), (((
|
|
222
|
+
integrations: Object.assign(Object.assign(Object.assign(Object.assign({}, config.analytics), (((_x = config.integrations) === null || _x === void 0 ? void 0 : _x.intercom)
|
|
196
223
|
? {
|
|
197
224
|
intercom: {
|
|
198
225
|
appId: config.integrations.intercom,
|
|
199
226
|
},
|
|
200
227
|
}
|
|
201
|
-
: {})), (((
|
|
228
|
+
: {})), (((_y = config.integrations) === null || _y === void 0 ? void 0 : _y.frontchat)
|
|
202
229
|
? {
|
|
203
230
|
frontchat: {
|
|
204
231
|
snippetId: config.integrations.frontchat,
|
|
205
232
|
},
|
|
206
233
|
}
|
|
207
|
-
: {})), (((
|
|
234
|
+
: {})), (((_z = config.integrations) === null || _z === void 0 ? void 0 : _z.osano)
|
|
208
235
|
? {
|
|
209
236
|
osano: {
|
|
210
237
|
scriptSource: config.integrations.osano,
|
|
@@ -212,6 +239,6 @@ export function upgradeToDocsConfig(config) {
|
|
|
212
239
|
}
|
|
213
240
|
: {})),
|
|
214
241
|
}
|
|
215
|
-
: {})), (fonts ? { fonts } : {}));
|
|
242
|
+
: {})), (fonts ? { fonts } : {})), (config.redirects ? { redirects: config.redirects } : {}));
|
|
216
243
|
return v2Config;
|
|
217
244
|
}
|