@mintlify/validation 0.1.58 → 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.
- package/dist/index.d.ts +5 -6
- package/dist/index.js +62 -2
- package/dist/mint-config/common.js +9 -0
- package/dist/mint-config/flattenUnionErrorMessages.js +19 -0
- package/dist/mint-config/hexadecimalPattern.js +1 -0
- package/dist/mint-config/schemas/analytics.d.ts +0 -104
- package/dist/mint-config/schemas/analytics.js +129 -0
- package/dist/mint-config/schemas/anchorColors.d.ts +0 -1
- package/dist/mint-config/schemas/anchorColors.js +28 -0
- package/dist/mint-config/schemas/anchors.d.ts +7 -56
- package/dist/mint-config/schemas/anchors.js +69 -0
- package/dist/mint-config/schemas/apiReference.d.ts +0 -2
- package/dist/mint-config/schemas/apiReference.js +65 -0
- package/dist/mint-config/schemas/basics.d.ts +0 -11
- package/dist/mint-config/schemas/basics.js +122 -0
- package/dist/mint-config/schemas/colors.d.ts +0 -1
- package/dist/mint-config/schemas/colors.js +42 -0
- package/dist/mint-config/schemas/config.d.ts +18 -19
- package/dist/mint-config/schemas/config.js +39 -0
- package/dist/mint-config/schemas/favicon.js +9 -0
- package/dist/mint-config/schemas/integrations.d.ts +0 -6
- package/dist/mint-config/schemas/integrations.js +11 -0
- package/dist/mint-config/schemas/navigation.d.ts +15 -2
- package/dist/mint-config/schemas/navigation.js +27 -0
- package/dist/mint-config/schemas/tabs.d.ts +0 -13
- package/dist/mint-config/schemas/tabs.js +28 -0
- package/dist/mint-config/schemas/versions.d.ts +0 -13
- package/dist/mint-config/schemas/versions.js +13 -0
- package/dist/mint-config/validateAnchorsWarnings.d.ts +3 -4
- package/dist/mint-config/validateAnchorsWarnings.js +35 -0
- package/dist/mint-config/validateVersionsInNavigation.d.ts +4 -5
- package/dist/mint-config/validateVersionsInNavigation.js +55 -0
- package/dist/openapi/convertOpenApi.d.ts +1 -1
- package/dist/openapi/convertOpenApi.js +166 -0
- package/dist/openapi/convertParameters.d.ts +1 -1
- package/dist/openapi/convertParameters.js +60 -0
- package/dist/openapi/convertSchema.d.ts +1 -1
- package/dist/openapi/convertSchema.js +475 -0
- package/dist/openapi/convertSecurity.d.ts +1 -1
- package/dist/openapi/convertSecurity.js +82 -0
- package/dist/openapi/convertServers.d.ts +1 -1
- package/dist/openapi/convertServers.js +43 -0
- package/dist/openapi/types/endpoint.js +13 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +18 -11
- package/dist/index.js.LICENSE.txt +0 -8
- package/dist/mint-config/types/enums.d.ts +0 -4
- package/dist/mint-config/types/index.d.ts +0 -12
- package/dist/mint-config/types/navigation.d.ts +0 -13
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
10
|
+
// TO DO: Write unit tests for this function.
|
|
11
|
+
// TO DO: Prettify the output instead of just returning JSON objects.
|
|
12
|
+
export function flattenUnionErrorMessages(unionErrors) {
|
|
13
|
+
return unionErrors.reduce(function (acc, unionError) {
|
|
14
|
+
if (Array.isArray(unionError.unionErrors) && unionError.unionErrors.length > 0) {
|
|
15
|
+
return __spreadArray(__spreadArray([], acc, true), flattenUnionErrorMessages(unionError.unionErrors), true);
|
|
16
|
+
}
|
|
17
|
+
return __spreadArray(__spreadArray([], acc, true), [unionError.message], false);
|
|
18
|
+
}, []);
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var hexadecimalPattern = /^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/;
|
|
@@ -1,106 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
declare const amplitudeConfigInterfaceSchema: z.ZodObject<{
|
|
3
|
-
apiKey: z.ZodString;
|
|
4
|
-
}, "strip", z.ZodTypeAny, {
|
|
5
|
-
apiKey: string;
|
|
6
|
-
}, {
|
|
7
|
-
apiKey: string;
|
|
8
|
-
}>;
|
|
9
|
-
declare const clearbitConfigInterfaceSchema: z.ZodObject<{
|
|
10
|
-
publicApiKey: z.ZodString;
|
|
11
|
-
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
publicApiKey: string;
|
|
13
|
-
}, {
|
|
14
|
-
publicApiKey: string;
|
|
15
|
-
}>;
|
|
16
|
-
declare const fathomConfigInterfaceSchema: z.ZodObject<{
|
|
17
|
-
siteId: z.ZodString;
|
|
18
|
-
}, "strip", z.ZodTypeAny, {
|
|
19
|
-
siteId: string;
|
|
20
|
-
}, {
|
|
21
|
-
siteId: string;
|
|
22
|
-
}>;
|
|
23
|
-
declare const googleAnalyticsConfigInterfaceSchema: z.ZodObject<{
|
|
24
|
-
measurementId: z.ZodString;
|
|
25
|
-
}, "strip", z.ZodTypeAny, {
|
|
26
|
-
measurementId: string;
|
|
27
|
-
}, {
|
|
28
|
-
measurementId: string;
|
|
29
|
-
}>;
|
|
30
|
-
declare const googleTagManagerConfigInterfaceSchema: z.ZodObject<{
|
|
31
|
-
tagId: z.ZodString;
|
|
32
|
-
}, "strip", z.ZodTypeAny, {
|
|
33
|
-
tagId: string;
|
|
34
|
-
}, {
|
|
35
|
-
tagId: string;
|
|
36
|
-
}>;
|
|
37
|
-
declare const hotjarConfigInterfaceSchema: z.ZodObject<{
|
|
38
|
-
hjid: z.ZodString;
|
|
39
|
-
hjsv: z.ZodString;
|
|
40
|
-
}, "strip", z.ZodTypeAny, {
|
|
41
|
-
hjid: string;
|
|
42
|
-
hjsv: string;
|
|
43
|
-
}, {
|
|
44
|
-
hjid: string;
|
|
45
|
-
hjsv: string;
|
|
46
|
-
}>;
|
|
47
|
-
declare const koalaConfigInterfaceSchema: z.ZodObject<{
|
|
48
|
-
publicApiKey: z.ZodEffects<z.ZodString, string, string>;
|
|
49
|
-
}, "strip", z.ZodTypeAny, {
|
|
50
|
-
publicApiKey: string;
|
|
51
|
-
}, {
|
|
52
|
-
publicApiKey: string;
|
|
53
|
-
}>;
|
|
54
|
-
declare const logrocketConfigInterfaceSchema: z.ZodObject<{
|
|
55
|
-
appId: z.ZodString;
|
|
56
|
-
}, "strip", z.ZodTypeAny, {
|
|
57
|
-
appId: string;
|
|
58
|
-
}, {
|
|
59
|
-
appId: string;
|
|
60
|
-
}>;
|
|
61
|
-
declare const mixpanelConfigInterfaceSchema: z.ZodObject<{
|
|
62
|
-
projectToken: z.ZodString;
|
|
63
|
-
}, "strip", z.ZodTypeAny, {
|
|
64
|
-
projectToken: string;
|
|
65
|
-
}, {
|
|
66
|
-
projectToken: string;
|
|
67
|
-
}>;
|
|
68
|
-
declare const pirschConfigInterfaceSchema: z.ZodObject<{
|
|
69
|
-
id: z.ZodString;
|
|
70
|
-
}, "strip", z.ZodTypeAny, {
|
|
71
|
-
id: string;
|
|
72
|
-
}, {
|
|
73
|
-
id: string;
|
|
74
|
-
}>;
|
|
75
|
-
declare const postHogConfigInterfaceSchema: z.ZodObject<{
|
|
76
|
-
apiKey: z.ZodString;
|
|
77
|
-
apiHost: z.ZodOptional<z.ZodString>;
|
|
78
|
-
}, "strip", z.ZodTypeAny, {
|
|
79
|
-
apiKey: string;
|
|
80
|
-
apiHost?: string | undefined;
|
|
81
|
-
}, {
|
|
82
|
-
apiKey: string;
|
|
83
|
-
apiHost?: string | undefined;
|
|
84
|
-
}>;
|
|
85
|
-
declare const plausibleConfigInterfaceSchema: z.ZodObject<{
|
|
86
|
-
domain: z.ZodEffects<z.ZodString, string, string>;
|
|
87
|
-
}, "strip", z.ZodTypeAny, {
|
|
88
|
-
domain: string;
|
|
89
|
-
}, {
|
|
90
|
-
domain: string;
|
|
91
|
-
}>;
|
|
92
|
-
export type AmplitudeConfigInterface = z.infer<typeof amplitudeConfigInterfaceSchema>;
|
|
93
|
-
export type ClearbitConfigInterface = z.infer<typeof clearbitConfigInterfaceSchema>;
|
|
94
|
-
export type FathomConfigInterface = z.infer<typeof fathomConfigInterfaceSchema>;
|
|
95
|
-
export type GoogleAnalyticsConfigInterface = z.infer<typeof googleAnalyticsConfigInterfaceSchema>;
|
|
96
|
-
export type GoogleTagManagerConfigInterface = z.infer<typeof googleTagManagerConfigInterfaceSchema>;
|
|
97
|
-
export type HotjarConfigInterface = z.infer<typeof hotjarConfigInterfaceSchema>;
|
|
98
|
-
export type KoalaConfigInterface = z.infer<typeof koalaConfigInterfaceSchema>;
|
|
99
|
-
export type LogrocketConfigInterface = z.infer<typeof logrocketConfigInterfaceSchema>;
|
|
100
|
-
export type MixpanelConfigInterface = z.infer<typeof mixpanelConfigInterfaceSchema>;
|
|
101
|
-
export type PirschConfigInterface = z.infer<typeof pirschConfigInterfaceSchema>;
|
|
102
|
-
export type PostHogConfigInterface = z.infer<typeof postHogConfigInterfaceSchema>;
|
|
103
|
-
export type PlausibleConfigInterface = z.infer<typeof plausibleConfigInterfaceSchema>;
|
|
104
2
|
export declare const analyticsSchema: z.ZodObject<{
|
|
105
3
|
amplitude: z.ZodOptional<z.ZodObject<{
|
|
106
4
|
apiKey: z.ZodString;
|
|
@@ -271,5 +169,3 @@ export declare const analyticsSchema: z.ZodObject<{
|
|
|
271
169
|
domain: string;
|
|
272
170
|
} | undefined;
|
|
273
171
|
}>;
|
|
274
|
-
export type AnalyticsType = z.infer<typeof analyticsSchema>;
|
|
275
|
-
export {};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
var amplitudeConfigInterfaceSchema = z.object({
|
|
3
|
+
apiKey: z.string({
|
|
4
|
+
required_error: 'Amplitude apiKey is missing.',
|
|
5
|
+
invalid_type_error: 'Amplitude apiKey must be a string.',
|
|
6
|
+
}),
|
|
7
|
+
}, {
|
|
8
|
+
invalid_type_error: 'Amplitude analytics config must be an object with an apiKey property.',
|
|
9
|
+
});
|
|
10
|
+
var clearbitConfigInterfaceSchema = z.object({
|
|
11
|
+
publicApiKey: z.string({
|
|
12
|
+
required_error: 'Clearbit publicApiKey is missing.',
|
|
13
|
+
invalid_type_error: 'Clearbit publicApiKey must be a string.',
|
|
14
|
+
}),
|
|
15
|
+
}, {
|
|
16
|
+
invalid_type_error: 'Clearbit config must be an object with a publicApiKey property.',
|
|
17
|
+
});
|
|
18
|
+
var fathomConfigInterfaceSchema = z.object({
|
|
19
|
+
siteId: z.string({
|
|
20
|
+
required_error: 'Fathom siteId is missing.',
|
|
21
|
+
invalid_type_error: 'Fathom siteId must be a string.',
|
|
22
|
+
}),
|
|
23
|
+
}, {
|
|
24
|
+
invalid_type_error: 'Fathom analytics config must be an object with a siteId property.',
|
|
25
|
+
});
|
|
26
|
+
var googleAnalyticsConfigInterfaceSchema = z.object({
|
|
27
|
+
measurementId: z
|
|
28
|
+
.string({
|
|
29
|
+
required_error: 'Google Analytics measurementId is missing.',
|
|
30
|
+
invalid_type_error: 'Google Analytics measurementId must be a string.',
|
|
31
|
+
})
|
|
32
|
+
.startsWith('G', 'Google Analytics measurementId must start with G.'),
|
|
33
|
+
}, {
|
|
34
|
+
invalid_type_error: 'Google Analytics config must be an object with a measurementId property.',
|
|
35
|
+
});
|
|
36
|
+
var googleTagManagerConfigInterfaceSchema = z.object({
|
|
37
|
+
tagId: z
|
|
38
|
+
.string({
|
|
39
|
+
required_error: 'Google Tag Manager tagId is missing.',
|
|
40
|
+
invalid_type_error: 'Google Tag Manager tagId must be a string.',
|
|
41
|
+
})
|
|
42
|
+
.startsWith('G', 'Google Tag Manager tagId must start with G.'),
|
|
43
|
+
}, {
|
|
44
|
+
invalid_type_error: 'Google Tag Manager config must be an object with a tagId property.',
|
|
45
|
+
});
|
|
46
|
+
var hotjarConfigInterfaceSchema = z.object({
|
|
47
|
+
hjid: z.string({
|
|
48
|
+
required_error: 'Hotjar hjid is missing.',
|
|
49
|
+
invalid_type_error: 'Hotjar hjid must be a string.',
|
|
50
|
+
}),
|
|
51
|
+
hjsv: z.string({
|
|
52
|
+
required_error: 'Hotjar hjsv is missing.',
|
|
53
|
+
invalid_type_error: 'Hotjar hjsv must be a string.',
|
|
54
|
+
}),
|
|
55
|
+
}, {
|
|
56
|
+
invalid_type_error: 'Hotjar config must be an object with a hjid and hjsv property.',
|
|
57
|
+
});
|
|
58
|
+
var koalaConfigInterfaceSchema = z.object({
|
|
59
|
+
publicApiKey: z
|
|
60
|
+
.string({
|
|
61
|
+
required_error: 'Public Api Key is required for the Koala snippet to run.',
|
|
62
|
+
invalid_type_error: 'Koala Public Api Key must be a string.',
|
|
63
|
+
})
|
|
64
|
+
.refine(function (publicApiKey) { return publicApiKey.length >= 2; }, 'Koala Public Api Key must have at least two characters'),
|
|
65
|
+
}, {
|
|
66
|
+
invalid_type_error: 'Koala config must be an object with a publicApiKey property.',
|
|
67
|
+
});
|
|
68
|
+
var logrocketConfigInterfaceSchema = z.object({
|
|
69
|
+
appId: z.string({
|
|
70
|
+
required_error: 'Logrocket appId is missing.',
|
|
71
|
+
invalid_type_error: 'Logrocket appId must be a string.',
|
|
72
|
+
}),
|
|
73
|
+
}, {
|
|
74
|
+
invalid_type_error: 'Logrocket config must be an object with an appId property.',
|
|
75
|
+
});
|
|
76
|
+
var mixpanelConfigInterfaceSchema = z.object({
|
|
77
|
+
projectToken: z.string({
|
|
78
|
+
required_error: 'Mixpanel projectToken is missing.',
|
|
79
|
+
invalid_type_error: 'Mixpanel projectToken must be a string.',
|
|
80
|
+
}),
|
|
81
|
+
}, {
|
|
82
|
+
invalid_type_error: 'Mixpanel config must be an object with a projectToken property.',
|
|
83
|
+
});
|
|
84
|
+
var pirschConfigInterfaceSchema = z.object({
|
|
85
|
+
id: z.string({
|
|
86
|
+
required_error: 'Pirsch id is missing.',
|
|
87
|
+
invalid_type_error: 'Pirsch id must be a string.',
|
|
88
|
+
}),
|
|
89
|
+
}, { invalid_type_error: 'Pirsch config must be an object with an id property.' });
|
|
90
|
+
var postHogConfigInterfaceSchema = z.object({
|
|
91
|
+
apiKey: z
|
|
92
|
+
.string({
|
|
93
|
+
required_error: 'Posthog apiKey is missing.',
|
|
94
|
+
invalid_type_error: 'Posthog apiKey must be a string.',
|
|
95
|
+
})
|
|
96
|
+
.startsWith('phc_', 'Posthog apiKey must start with phc_'),
|
|
97
|
+
apiHost: z
|
|
98
|
+
.string({ invalid_type_error: 'Posthog apiHost must be a string.' })
|
|
99
|
+
.url('Posthog apiHost must be a valid URL.')
|
|
100
|
+
.optional(),
|
|
101
|
+
}, {
|
|
102
|
+
invalid_type_error: 'Posthog config must be an object with an apiKey property.',
|
|
103
|
+
});
|
|
104
|
+
var plausibleConfigInterfaceSchema = z.object({
|
|
105
|
+
domain: z
|
|
106
|
+
.string({
|
|
107
|
+
required_error: 'Plausible domain is missing.',
|
|
108
|
+
invalid_type_error: 'Plausible domain must be a string.',
|
|
109
|
+
})
|
|
110
|
+
.refine(function (domain) { return !domain.startsWith('http://') && !domain.startsWith('https://'); }, 'Plausible domain must not start with http:// or https://'),
|
|
111
|
+
}, {
|
|
112
|
+
invalid_type_error: 'Plausible config must be an object with a domain property. The domain must not start with http:// or https://.',
|
|
113
|
+
});
|
|
114
|
+
export var analyticsSchema = z
|
|
115
|
+
.object({
|
|
116
|
+
amplitude: amplitudeConfigInterfaceSchema.optional(),
|
|
117
|
+
clearbit: clearbitConfigInterfaceSchema.optional(),
|
|
118
|
+
fathom: fathomConfigInterfaceSchema.optional(),
|
|
119
|
+
ga4: googleAnalyticsConfigInterfaceSchema.optional(),
|
|
120
|
+
gtm: googleTagManagerConfigInterfaceSchema.optional(),
|
|
121
|
+
hotjar: hotjarConfigInterfaceSchema.optional(),
|
|
122
|
+
koala: koalaConfigInterfaceSchema.optional(),
|
|
123
|
+
logrocket: logrocketConfigInterfaceSchema.optional(),
|
|
124
|
+
mixpanel: mixpanelConfigInterfaceSchema.optional(),
|
|
125
|
+
pirsch: pirschConfigInterfaceSchema.optional(),
|
|
126
|
+
posthog: postHogConfigInterfaceSchema.optional(),
|
|
127
|
+
plausible: plausibleConfigInterfaceSchema.optional(),
|
|
128
|
+
})
|
|
129
|
+
.strict('Mintlify only supports analytics integrations from: amplitude, clearbit, fathom, ga4, gtm, hotjar, koala, logrocket, mixpanel, pirsch, posthog and plausible.');
|
|
@@ -12,7 +12,6 @@ export declare const gradientSchema: z.ZodObject<{
|
|
|
12
12
|
to: string;
|
|
13
13
|
via?: string | undefined;
|
|
14
14
|
}>;
|
|
15
|
-
export type GradientType = z.infer<typeof gradientSchema>;
|
|
16
15
|
export declare const anchorColorSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
17
16
|
from: z.ZodString;
|
|
18
17
|
via: z.ZodOptional<z.ZodString>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { hexadecimalPattern } from '../hexadecimalPattern.js';
|
|
3
|
+
export var gradientSchema = z.object({
|
|
4
|
+
from: z
|
|
5
|
+
.string({
|
|
6
|
+
invalid_type_error: 'Anchor color.from must be a string.',
|
|
7
|
+
})
|
|
8
|
+
.regex(hexadecimalPattern, 'Anchor color.from must be a hexadecimal color.'),
|
|
9
|
+
via: z
|
|
10
|
+
.string({
|
|
11
|
+
invalid_type_error: 'Anchor color.via must be a string.',
|
|
12
|
+
})
|
|
13
|
+
.regex(hexadecimalPattern, 'Anchor color.via must be undefined or a hexadecimal color.')
|
|
14
|
+
.optional(),
|
|
15
|
+
to: z
|
|
16
|
+
.string({
|
|
17
|
+
invalid_type_error: 'Anchor color.to must be a string.',
|
|
18
|
+
})
|
|
19
|
+
.regex(hexadecimalPattern, 'Anchor color.to must be a hexadecimal color.'),
|
|
20
|
+
});
|
|
21
|
+
export var anchorColorSchema = z.union([
|
|
22
|
+
z
|
|
23
|
+
.string({ invalid_type_error: 'Anchor color must be a string.' })
|
|
24
|
+
.regex(hexadecimalPattern, 'Anchor color must be a hexadecimal color.'),
|
|
25
|
+
gradientSchema.strict('Anchors with gradient colors can only have properties from, via, and to with valid hexadecimal colors.'),
|
|
26
|
+
], {
|
|
27
|
+
invalid_type_error: 'Anchor color must be a string or an object with from and to properties.',
|
|
28
|
+
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
declare const anchorSchema: z.ZodObject<{
|
|
2
|
+
export declare const anchorSchema: z.ZodObject<{
|
|
3
3
|
name: z.ZodString;
|
|
4
4
|
url: z.ZodString;
|
|
5
5
|
icon: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
6
|
-
iconType: z.ZodOptional<z.ZodEnum<["brands", "duotone", "light", "sharp-solid", "solid", "thin"]>>;
|
|
6
|
+
iconType: z.ZodOptional<z.ZodEnum<["brands", "duotone", "light", "regular", "sharp-solid", "solid", "thin"]>>;
|
|
7
7
|
color: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
8
8
|
from: z.ZodString;
|
|
9
9
|
via: z.ZodOptional<z.ZodString>;
|
|
@@ -23,7 +23,7 @@ declare const anchorSchema: z.ZodObject<{
|
|
|
23
23
|
name: string;
|
|
24
24
|
url: string;
|
|
25
25
|
icon?: string | undefined;
|
|
26
|
-
iconType?: "
|
|
26
|
+
iconType?: "brands" | "duotone" | "light" | "regular" | "sharp-solid" | "solid" | "thin" | undefined;
|
|
27
27
|
color?: string | {
|
|
28
28
|
from: string;
|
|
29
29
|
to: string;
|
|
@@ -35,7 +35,7 @@ declare const anchorSchema: z.ZodObject<{
|
|
|
35
35
|
name: string;
|
|
36
36
|
url: string;
|
|
37
37
|
icon?: string | undefined;
|
|
38
|
-
iconType?: "
|
|
38
|
+
iconType?: "brands" | "duotone" | "light" | "regular" | "sharp-solid" | "solid" | "thin" | undefined;
|
|
39
39
|
color?: string | {
|
|
40
40
|
from: string;
|
|
41
41
|
to: string;
|
|
@@ -44,65 +44,16 @@ declare const anchorSchema: z.ZodObject<{
|
|
|
44
44
|
isDefaultHidden?: boolean | undefined;
|
|
45
45
|
version?: string | undefined;
|
|
46
46
|
}>;
|
|
47
|
-
export declare const anchorsSchema: z.ZodArray<z.ZodObject<{
|
|
48
|
-
name: z.ZodString;
|
|
49
|
-
url: z.ZodString;
|
|
50
|
-
icon: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
51
|
-
iconType: z.ZodOptional<z.ZodEnum<["brands", "duotone", "light", "sharp-solid", "solid", "thin"]>>;
|
|
52
|
-
color: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
53
|
-
from: z.ZodString;
|
|
54
|
-
via: z.ZodOptional<z.ZodString>;
|
|
55
|
-
to: z.ZodString;
|
|
56
|
-
}, "strict", z.ZodTypeAny, {
|
|
57
|
-
from: string;
|
|
58
|
-
to: string;
|
|
59
|
-
via?: string | undefined;
|
|
60
|
-
}, {
|
|
61
|
-
from: string;
|
|
62
|
-
to: string;
|
|
63
|
-
via?: string | undefined;
|
|
64
|
-
}>]>>;
|
|
65
|
-
isDefaultHidden: z.ZodOptional<z.ZodBoolean>;
|
|
66
|
-
version: z.ZodOptional<z.ZodString>;
|
|
67
|
-
}, "strip", z.ZodTypeAny, {
|
|
68
|
-
name: string;
|
|
69
|
-
url: string;
|
|
70
|
-
icon?: string | undefined;
|
|
71
|
-
iconType?: "light" | "brands" | "duotone" | "sharp-solid" | "solid" | "thin" | undefined;
|
|
72
|
-
color?: string | {
|
|
73
|
-
from: string;
|
|
74
|
-
to: string;
|
|
75
|
-
via?: string | undefined;
|
|
76
|
-
} | undefined;
|
|
77
|
-
isDefaultHidden?: boolean | undefined;
|
|
78
|
-
version?: string | undefined;
|
|
79
|
-
}, {
|
|
80
|
-
name: string;
|
|
81
|
-
url: string;
|
|
82
|
-
icon?: string | undefined;
|
|
83
|
-
iconType?: "light" | "brands" | "duotone" | "sharp-solid" | "solid" | "thin" | undefined;
|
|
84
|
-
color?: string | {
|
|
85
|
-
from: string;
|
|
86
|
-
to: string;
|
|
87
|
-
via?: string | undefined;
|
|
88
|
-
} | undefined;
|
|
89
|
-
isDefaultHidden?: boolean | undefined;
|
|
90
|
-
version?: string | undefined;
|
|
91
|
-
}>, "many">;
|
|
92
47
|
export declare const topAnchorSchema: z.ZodObject<{
|
|
93
48
|
name: z.ZodString;
|
|
94
49
|
icon: z.ZodOptional<z.ZodString>;
|
|
95
|
-
iconType: z.ZodOptional<z.ZodEnum<["brands", "duotone", "light", "sharp-solid", "solid", "thin"]>>;
|
|
50
|
+
iconType: z.ZodOptional<z.ZodEnum<["brands", "duotone", "light", "regular", "sharp-solid", "solid", "thin"]>>;
|
|
96
51
|
}, "strict", z.ZodTypeAny, {
|
|
97
52
|
name: string;
|
|
98
53
|
icon?: string | undefined;
|
|
99
|
-
iconType?: "
|
|
54
|
+
iconType?: "brands" | "duotone" | "light" | "regular" | "sharp-solid" | "solid" | "thin" | undefined;
|
|
100
55
|
}, {
|
|
101
56
|
name: string;
|
|
102
57
|
icon?: string | undefined;
|
|
103
|
-
iconType?: "
|
|
58
|
+
iconType?: "brands" | "duotone" | "light" | "regular" | "sharp-solid" | "solid" | "thin" | undefined;
|
|
104
59
|
}>;
|
|
105
|
-
export type AnchorType = z.infer<typeof anchorSchema>;
|
|
106
|
-
export type AnchorsType = z.infer<typeof anchorsSchema>;
|
|
107
|
-
export type TopAnchorType = z.infer<typeof topAnchorSchema>;
|
|
108
|
-
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { iconTypes } from '@mintlify/models';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { anchorColorSchema } from './anchorColors.js';
|
|
4
|
+
export var anchorSchema = z.object({
|
|
5
|
+
name: z
|
|
6
|
+
.string({
|
|
7
|
+
required_error: 'Every anchor must have a name.',
|
|
8
|
+
invalid_type_error: 'Anchor name must be a string.',
|
|
9
|
+
})
|
|
10
|
+
.trim()
|
|
11
|
+
.min(1, 'Anchor name is empty.'),
|
|
12
|
+
url: z
|
|
13
|
+
.string({
|
|
14
|
+
required_error: 'Every anchor must have a url',
|
|
15
|
+
invalid_type_error: 'Anchor url must be a string.',
|
|
16
|
+
})
|
|
17
|
+
.trim()
|
|
18
|
+
.min(1, 'Anchor URL is missing.'),
|
|
19
|
+
icon: z
|
|
20
|
+
.string({
|
|
21
|
+
invalid_type_error: 'Anchor icon must be the name of a Font Awesome icon. Visit this link to see all the available icons: https://fontawesome.com/icons',
|
|
22
|
+
})
|
|
23
|
+
.refine(function (iconStr) { return !iconStr.startsWith('fa-'); }, 'icon does not need to start with "fa-". Please delete "fa-" and keep the rest of the icon name.')
|
|
24
|
+
.optional(),
|
|
25
|
+
iconType: z
|
|
26
|
+
.enum(iconTypes, {
|
|
27
|
+
errorMap: function () {
|
|
28
|
+
return {
|
|
29
|
+
message: 'anchor iconType must be one of the following strings: brands, duotone, light, sharp-solid, solid, thin',
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
})
|
|
33
|
+
.optional(),
|
|
34
|
+
color: anchorColorSchema.optional(),
|
|
35
|
+
isDefaultHidden: z
|
|
36
|
+
.boolean({
|
|
37
|
+
invalid_type_error: 'Anchor isDefaultHidden must be a boolean. Try writing true or false without quotes around them.',
|
|
38
|
+
})
|
|
39
|
+
.optional(),
|
|
40
|
+
version: z
|
|
41
|
+
.string({
|
|
42
|
+
invalid_type_error: 'Version must be a string in the versions array.',
|
|
43
|
+
})
|
|
44
|
+
.optional(),
|
|
45
|
+
});
|
|
46
|
+
export var topAnchorSchema = z
|
|
47
|
+
.object({
|
|
48
|
+
name: z.string({
|
|
49
|
+
required_error: 'topAnchor.name is missing, set it or delete the entire topAnchor property.',
|
|
50
|
+
invalid_type_error: 'topAnchor.name must be a string',
|
|
51
|
+
}),
|
|
52
|
+
icon: z
|
|
53
|
+
.string({
|
|
54
|
+
invalid_type_error: 'topAnchor.icon must be a string',
|
|
55
|
+
})
|
|
56
|
+
.optional(),
|
|
57
|
+
iconType: z
|
|
58
|
+
.enum(iconTypes, {
|
|
59
|
+
errorMap: function () {
|
|
60
|
+
return {
|
|
61
|
+
message: 'topAnchor.iconType must be one of the following strings: brands, duotone, light, sharp-solid, solid, thin',
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
})
|
|
65
|
+
.optional(),
|
|
66
|
+
}, {
|
|
67
|
+
invalid_type_error: "topAnchor must be an object with a name property. Delete the topAnchor if you don't want to customize the values.",
|
|
68
|
+
})
|
|
69
|
+
.strict('topAnchor can only have name, icon, and iconType properties.');
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const openApiSchema: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
3
|
-
export type OpenApiType = z.infer<typeof openApiSchema>;
|
|
4
3
|
export declare const apiSchema: z.ZodObject<{
|
|
5
4
|
baseUrl: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
6
5
|
auth: z.ZodOptional<z.ZodObject<{
|
|
@@ -74,4 +73,3 @@ export declare const apiSchema: z.ZodObject<{
|
|
|
74
73
|
} | undefined;
|
|
75
74
|
maintainOrder?: boolean | undefined;
|
|
76
75
|
}>;
|
|
77
|
-
export type ApiConfigType = z.infer<typeof apiSchema>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export var openApiSchema = z.union([
|
|
3
|
+
z.string({
|
|
4
|
+
invalid_type_error: 'openapi must be a string or an array of strings of absolute or relative URLs pointing to your OpenAPI file.',
|
|
5
|
+
}),
|
|
6
|
+
z.array(z.string({
|
|
7
|
+
invalid_type_error: 'openapi must be a string or an array of strings of absolute or relative URLs pointing to your OpenAPI file.',
|
|
8
|
+
})),
|
|
9
|
+
]);
|
|
10
|
+
export var apiSchema = z
|
|
11
|
+
.object({
|
|
12
|
+
baseUrl: z
|
|
13
|
+
.union([
|
|
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.')),
|
|
16
|
+
])
|
|
17
|
+
.optional(),
|
|
18
|
+
auth: z
|
|
19
|
+
.object({
|
|
20
|
+
method: z
|
|
21
|
+
.enum(['bearer', 'basic', 'key', 'cobo'], {
|
|
22
|
+
errorMap: function () {
|
|
23
|
+
return {
|
|
24
|
+
message: 'api.auth.method has to be one of: bearer, basic, or key',
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
})
|
|
28
|
+
.optional(),
|
|
29
|
+
name: z.string().optional(),
|
|
30
|
+
inputPrefix: z.string().optional(),
|
|
31
|
+
})
|
|
32
|
+
.strict('api.auth can only contain method, name, and inputPrefix.')
|
|
33
|
+
.optional(),
|
|
34
|
+
playground: z
|
|
35
|
+
.object({
|
|
36
|
+
mode: z
|
|
37
|
+
.enum(['show', 'simple', 'hide'], {
|
|
38
|
+
errorMap: function () {
|
|
39
|
+
return {
|
|
40
|
+
message: 'api.playground.mode must be one of the following strings: show, simple, or hide',
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
})
|
|
44
|
+
.optional()
|
|
45
|
+
.default('show'),
|
|
46
|
+
})
|
|
47
|
+
.optional(),
|
|
48
|
+
request: z
|
|
49
|
+
.object({
|
|
50
|
+
example: z
|
|
51
|
+
.object({
|
|
52
|
+
showOptionalParams: z.boolean().optional().default(false),
|
|
53
|
+
})
|
|
54
|
+
.optional(),
|
|
55
|
+
})
|
|
56
|
+
.optional(),
|
|
57
|
+
maintainOrder: z
|
|
58
|
+
.boolean({
|
|
59
|
+
invalid_type_error: 'maintainOrder must be a boolean. Try writing true or false without the quotes.',
|
|
60
|
+
})
|
|
61
|
+
.optional(),
|
|
62
|
+
}, {
|
|
63
|
+
invalid_type_error: 'api must be an object. The object can have baseUrl, auth, and playground as properties.',
|
|
64
|
+
})
|
|
65
|
+
.strict('api can only contain baseUrl, auth, and playground as properties.');
|
|
@@ -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];
|