@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,11 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { lindenConfigSchema } from './themes/linden.js';
|
|
3
|
+
import { mapleConfigSchema } from './themes/maple.js';
|
|
2
4
|
import { mintConfigSchema } from './themes/mint.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { venusConfigSchema } from './themes/venus.js';
|
|
5
|
+
import { palmConfigSchema } from './themes/palm.js';
|
|
6
|
+
import { willowConfigSchema } from './themes/willow.js';
|
|
6
7
|
export const docsConfigSchema = z.discriminatedUnion('theme', [
|
|
7
8
|
mintConfigSchema,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
mapleConfigSchema,
|
|
10
|
+
palmConfigSchema,
|
|
11
|
+
willowConfigSchema,
|
|
12
|
+
lindenConfigSchema,
|
|
11
13
|
]);
|
|
@@ -1,11 +1,12 @@
|
|
|
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">]>>;
|
|
3
4
|
playground: z.ZodOptional<z.ZodObject<{
|
|
4
|
-
display: z.
|
|
5
|
-
proxy: z.
|
|
5
|
+
display: z.ZodOptional<z.ZodEnum<["interactive", "simple", "none"]>>;
|
|
6
|
+
proxy: z.ZodOptional<z.ZodBoolean>;
|
|
6
7
|
}, "strip", z.ZodTypeAny, {
|
|
7
|
-
display
|
|
8
|
-
proxy
|
|
8
|
+
display?: "simple" | "none" | "interactive" | undefined;
|
|
9
|
+
proxy?: boolean | undefined;
|
|
9
10
|
}, {
|
|
10
11
|
display?: "simple" | "none" | "interactive" | undefined;
|
|
11
12
|
proxy?: boolean | undefined;
|
|
@@ -19,27 +20,29 @@ export declare const apiSchema: z.ZodObject<{
|
|
|
19
20
|
}>>;
|
|
20
21
|
mdx: z.ZodOptional<z.ZodObject<{
|
|
21
22
|
auth: z.ZodOptional<z.ZodEnum<["bearer", "basic", "key", "cobo"]>>;
|
|
22
|
-
|
|
23
|
+
server: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
23
24
|
}, "strip", z.ZodTypeAny, {
|
|
24
25
|
auth?: "key" | "bearer" | "basic" | "cobo" | undefined;
|
|
25
|
-
|
|
26
|
+
server?: string | string[] | undefined;
|
|
26
27
|
}, {
|
|
27
28
|
auth?: "key" | "bearer" | "basic" | "cobo" | undefined;
|
|
28
|
-
|
|
29
|
+
server?: string | string[] | undefined;
|
|
29
30
|
}>>;
|
|
30
31
|
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
openapi?: string | string[] | undefined;
|
|
31
33
|
playground?: {
|
|
32
|
-
display
|
|
33
|
-
proxy
|
|
34
|
+
display?: "simple" | "none" | "interactive" | undefined;
|
|
35
|
+
proxy?: boolean | undefined;
|
|
34
36
|
} | undefined;
|
|
35
37
|
examples?: {
|
|
36
38
|
languages?: string[] | undefined;
|
|
37
39
|
} | undefined;
|
|
38
40
|
mdx?: {
|
|
39
41
|
auth?: "key" | "bearer" | "basic" | "cobo" | undefined;
|
|
40
|
-
|
|
42
|
+
server?: string | string[] | undefined;
|
|
41
43
|
} | undefined;
|
|
42
44
|
}, {
|
|
45
|
+
openapi?: string | string[] | undefined;
|
|
43
46
|
playground?: {
|
|
44
47
|
display?: "simple" | "none" | "interactive" | undefined;
|
|
45
48
|
proxy?: boolean | undefined;
|
|
@@ -49,6 +52,6 @@ export declare const apiSchema: z.ZodObject<{
|
|
|
49
52
|
} | undefined;
|
|
50
53
|
mdx?: {
|
|
51
54
|
auth?: "key" | "bearer" | "basic" | "cobo" | undefined;
|
|
52
|
-
|
|
55
|
+
server?: string | string[] | undefined;
|
|
53
56
|
} | undefined;
|
|
54
57
|
}>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { openApiSchema } from './reusable/openapi.js';
|
|
2
3
|
export const apiSchema = z
|
|
3
4
|
.object({
|
|
5
|
+
openapi: openApiSchema.optional(),
|
|
4
6
|
playground: z
|
|
5
7
|
.object({
|
|
6
8
|
display: z
|
|
7
9
|
.enum(['interactive', 'simple', 'none'])
|
|
8
10
|
.optional()
|
|
9
|
-
.
|
|
10
|
-
.describe('The display mode of the API playground'),
|
|
11
|
+
.describe('The display mode of the API playground. Defaults to `interactive`.'),
|
|
11
12
|
proxy: z
|
|
12
13
|
.boolean()
|
|
13
14
|
.optional()
|
|
14
|
-
.
|
|
15
|
-
.describe('Whether to pass API requests through a proxy server'),
|
|
15
|
+
.describe('Whether to pass API requests through a proxy server. Defaults to `false`.'),
|
|
16
16
|
})
|
|
17
17
|
.optional()
|
|
18
18
|
.describe('Configurations for the API playground'),
|
|
@@ -31,7 +31,7 @@ export const apiSchema = z
|
|
|
31
31
|
.enum(['bearer', 'basic', 'key', 'cobo'])
|
|
32
32
|
.optional()
|
|
33
33
|
.describe('Authentication method for the API'),
|
|
34
|
-
|
|
34
|
+
server: z
|
|
35
35
|
.union([z.string().url(), z.array(z.string().url())])
|
|
36
36
|
.optional()
|
|
37
37
|
.describe('Base URL(s) for the API'),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const appearanceSchema: z.ZodObject<{
|
|
3
|
-
default: z.
|
|
4
|
-
strict: z.
|
|
3
|
+
default: z.ZodOptional<z.ZodEnum<["system", "light", "dark"]>>;
|
|
4
|
+
strict: z.ZodOptional<z.ZodBoolean>;
|
|
5
5
|
}, "strip", z.ZodTypeAny, {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
default?: "light" | "dark" | "system" | undefined;
|
|
7
|
+
strict?: boolean | undefined;
|
|
8
8
|
}, {
|
|
9
9
|
default?: "light" | "dark" | "system" | undefined;
|
|
10
10
|
strict?: boolean | undefined;
|
|
@@ -3,8 +3,11 @@ export const appearanceSchema = z
|
|
|
3
3
|
.object({
|
|
4
4
|
default: z
|
|
5
5
|
.enum(['system', 'light', 'dark'])
|
|
6
|
-
.
|
|
7
|
-
.describe('The default light/dark mode'),
|
|
8
|
-
strict: z
|
|
6
|
+
.optional()
|
|
7
|
+
.describe('The default light/dark mode. Defaults to system'),
|
|
8
|
+
strict: z
|
|
9
|
+
.boolean()
|
|
10
|
+
.optional()
|
|
11
|
+
.describe('Whether to hide the light / dark mode toggle. Defaults to `false`.'),
|
|
9
12
|
})
|
|
10
13
|
.describe('Light / dark mode toggle settings');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const iconsSchema: z.ZodObject<{
|
|
3
|
-
library: z.
|
|
3
|
+
library: z.ZodEnum<["fontawesome"]>;
|
|
4
4
|
}, "strip", z.ZodTypeAny, {
|
|
5
5
|
library: "fontawesome";
|
|
6
6
|
}, {
|
|
7
|
-
library
|
|
7
|
+
library: "fontawesome";
|
|
8
8
|
}>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export const iconsSchema = z
|
|
3
3
|
.object({
|
|
4
|
-
library: z
|
|
4
|
+
library: z
|
|
5
|
+
.enum(['fontawesome'])
|
|
6
|
+
.describe('The icon library to be used. Defaults to `fontawesome`.'),
|
|
5
7
|
})
|
|
6
8
|
.describe('Icon library settings');
|
|
@@ -1 +1,10 @@
|
|
|
1
1
|
export * from './font.js';
|
|
2
|
+
export * from './navigation/index.js';
|
|
3
|
+
export * from './navigation/anchors.js';
|
|
4
|
+
export * from './navigation/global.js';
|
|
5
|
+
export * from './navigation/groups.js';
|
|
6
|
+
export * from './navigation/languages.js';
|
|
7
|
+
export * from './navigation/pages.js';
|
|
8
|
+
export * from './navigation/tabs.js';
|
|
9
|
+
export * from './navigation/version.js';
|
|
10
|
+
export * from './reusable/index.js';
|
|
@@ -1 +1,10 @@
|
|
|
1
1
|
export * from './font.js';
|
|
2
|
+
export * from './navigation/index.js';
|
|
3
|
+
export * from './navigation/anchors.js';
|
|
4
|
+
export * from './navigation/global.js';
|
|
5
|
+
export * from './navigation/groups.js';
|
|
6
|
+
export * from './navigation/languages.js';
|
|
7
|
+
export * from './navigation/pages.js';
|
|
8
|
+
export * from './navigation/tabs.js';
|
|
9
|
+
export * from './navigation/version.js';
|
|
10
|
+
export * from './reusable/index.js';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const anchorSchema: z.ZodType;
|
|
3
2
|
export declare const nonRecursiveAnchorSchema: z.ZodIntersection<z.ZodObject<{
|
|
4
3
|
anchor: z.ZodString;
|
|
5
4
|
icon: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
|
|
@@ -23,6 +22,7 @@ export declare const nonRecursiveAnchorSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
23
22
|
dark?: string | undefined;
|
|
24
23
|
}>>;
|
|
25
24
|
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
+
openapi: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">]>>;
|
|
26
26
|
}, "strip", z.ZodTypeAny, {
|
|
27
27
|
anchor: string;
|
|
28
28
|
icon?: string | {
|
|
@@ -34,6 +34,7 @@ export declare const nonRecursiveAnchorSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
34
34
|
dark?: string | undefined;
|
|
35
35
|
} | undefined;
|
|
36
36
|
hidden?: boolean | undefined;
|
|
37
|
+
openapi?: string | string[] | undefined;
|
|
37
38
|
}, {
|
|
38
39
|
anchor: string;
|
|
39
40
|
icon?: string | {
|
|
@@ -45,6 +46,7 @@ export declare const nonRecursiveAnchorSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
45
46
|
dark?: string | undefined;
|
|
46
47
|
} | undefined;
|
|
47
48
|
hidden?: boolean | undefined;
|
|
49
|
+
openapi?: string | string[] | undefined;
|
|
48
50
|
}>, z.ZodObject<{
|
|
49
51
|
href: z.ZodString;
|
|
50
52
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -52,6 +54,227 @@ export declare const nonRecursiveAnchorSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
52
54
|
}, {
|
|
53
55
|
href: string;
|
|
54
56
|
}>>;
|
|
55
|
-
export declare const
|
|
57
|
+
export declare const anchorSchema: z.ZodIntersection<z.ZodObject<{
|
|
58
|
+
anchor: z.ZodString;
|
|
59
|
+
icon: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
|
|
60
|
+
style: z.ZodOptional<z.ZodEnum<["brands", "duotone", "light", "regular", "sharp-duotone-solid", "sharp-light", "sharp-regular", "sharp-solid", "sharp-thin", "solid", "thin"]>>;
|
|
61
|
+
name: z.ZodEffects<z.ZodString, string, string>;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
name: string;
|
|
64
|
+
style?: "brands" | "duotone" | "light" | "regular" | "sharp-duotone-solid" | "sharp-light" | "sharp-regular" | "sharp-solid" | "sharp-thin" | "solid" | "thin" | undefined;
|
|
65
|
+
}, {
|
|
66
|
+
name: string;
|
|
67
|
+
style?: "brands" | "duotone" | "light" | "regular" | "sharp-duotone-solid" | "sharp-light" | "sharp-regular" | "sharp-solid" | "sharp-thin" | "solid" | "thin" | undefined;
|
|
68
|
+
}>]>>;
|
|
69
|
+
color: z.ZodOptional<z.ZodObject<{
|
|
70
|
+
light: z.ZodOptional<z.ZodString>;
|
|
71
|
+
dark: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, "strict", z.ZodTypeAny, {
|
|
73
|
+
light?: string | undefined;
|
|
74
|
+
dark?: string | undefined;
|
|
75
|
+
}, {
|
|
76
|
+
light?: string | undefined;
|
|
77
|
+
dark?: string | undefined;
|
|
78
|
+
}>>;
|
|
79
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
+
openapi: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">]>>;
|
|
81
|
+
}, "strip", z.ZodTypeAny, {
|
|
82
|
+
anchor: string;
|
|
83
|
+
icon?: string | {
|
|
84
|
+
name: string;
|
|
85
|
+
style?: "brands" | "duotone" | "light" | "regular" | "sharp-duotone-solid" | "sharp-light" | "sharp-regular" | "sharp-solid" | "sharp-thin" | "solid" | "thin" | undefined;
|
|
86
|
+
} | undefined;
|
|
87
|
+
color?: {
|
|
88
|
+
light?: string | undefined;
|
|
89
|
+
dark?: string | undefined;
|
|
90
|
+
} | undefined;
|
|
91
|
+
hidden?: boolean | undefined;
|
|
92
|
+
openapi?: string | string[] | undefined;
|
|
93
|
+
}, {
|
|
94
|
+
anchor: string;
|
|
95
|
+
icon?: string | {
|
|
96
|
+
name: string;
|
|
97
|
+
style?: "brands" | "duotone" | "light" | "regular" | "sharp-duotone-solid" | "sharp-light" | "sharp-regular" | "sharp-solid" | "sharp-thin" | "solid" | "thin" | undefined;
|
|
98
|
+
} | undefined;
|
|
99
|
+
color?: {
|
|
100
|
+
light?: string | undefined;
|
|
101
|
+
dark?: string | undefined;
|
|
102
|
+
} | undefined;
|
|
103
|
+
hidden?: boolean | undefined;
|
|
104
|
+
openapi?: string | string[] | undefined;
|
|
105
|
+
}>, z.ZodUnion<[z.ZodObject<{
|
|
106
|
+
href: z.ZodString;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
href: string;
|
|
109
|
+
}, {
|
|
110
|
+
href: string;
|
|
111
|
+
}>, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>, ...z.ZodType<any, z.ZodTypeDef, any>[]]>>;
|
|
112
|
+
export declare const decoratedAnchorSchema: z.ZodIntersection<z.ZodObject<{
|
|
113
|
+
anchor: z.ZodString;
|
|
114
|
+
icon: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
|
|
115
|
+
style: z.ZodOptional<z.ZodEnum<["brands", "duotone", "light", "regular", "sharp-duotone-solid", "sharp-light", "sharp-regular", "sharp-solid", "sharp-thin", "solid", "thin"]>>;
|
|
116
|
+
name: z.ZodEffects<z.ZodString, string, string>;
|
|
117
|
+
}, "strip", z.ZodTypeAny, {
|
|
118
|
+
name: string;
|
|
119
|
+
style?: "brands" | "duotone" | "light" | "regular" | "sharp-duotone-solid" | "sharp-light" | "sharp-regular" | "sharp-solid" | "sharp-thin" | "solid" | "thin" | undefined;
|
|
120
|
+
}, {
|
|
121
|
+
name: string;
|
|
122
|
+
style?: "brands" | "duotone" | "light" | "regular" | "sharp-duotone-solid" | "sharp-light" | "sharp-regular" | "sharp-solid" | "sharp-thin" | "solid" | "thin" | undefined;
|
|
123
|
+
}>]>>;
|
|
124
|
+
color: z.ZodOptional<z.ZodObject<{
|
|
125
|
+
light: z.ZodOptional<z.ZodString>;
|
|
126
|
+
dark: z.ZodOptional<z.ZodString>;
|
|
127
|
+
}, "strict", z.ZodTypeAny, {
|
|
128
|
+
light?: string | undefined;
|
|
129
|
+
dark?: string | undefined;
|
|
130
|
+
}, {
|
|
131
|
+
light?: string | undefined;
|
|
132
|
+
dark?: string | undefined;
|
|
133
|
+
}>>;
|
|
134
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
+
openapi: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">]>>;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
anchor: string;
|
|
138
|
+
icon?: string | {
|
|
139
|
+
name: string;
|
|
140
|
+
style?: "brands" | "duotone" | "light" | "regular" | "sharp-duotone-solid" | "sharp-light" | "sharp-regular" | "sharp-solid" | "sharp-thin" | "solid" | "thin" | undefined;
|
|
141
|
+
} | undefined;
|
|
142
|
+
color?: {
|
|
143
|
+
light?: string | undefined;
|
|
144
|
+
dark?: string | undefined;
|
|
145
|
+
} | undefined;
|
|
146
|
+
hidden?: boolean | undefined;
|
|
147
|
+
openapi?: string | string[] | undefined;
|
|
148
|
+
}, {
|
|
149
|
+
anchor: string;
|
|
150
|
+
icon?: string | {
|
|
151
|
+
name: string;
|
|
152
|
+
style?: "brands" | "duotone" | "light" | "regular" | "sharp-duotone-solid" | "sharp-light" | "sharp-regular" | "sharp-solid" | "sharp-thin" | "solid" | "thin" | undefined;
|
|
153
|
+
} | undefined;
|
|
154
|
+
color?: {
|
|
155
|
+
light?: string | undefined;
|
|
156
|
+
dark?: string | undefined;
|
|
157
|
+
} | undefined;
|
|
158
|
+
hidden?: boolean | undefined;
|
|
159
|
+
openapi?: string | string[] | undefined;
|
|
160
|
+
}>, z.ZodUnion<[z.ZodObject<{
|
|
161
|
+
href: z.ZodString;
|
|
162
|
+
}, "strip", z.ZodTypeAny, {
|
|
163
|
+
href: string;
|
|
164
|
+
}, {
|
|
165
|
+
href: string;
|
|
166
|
+
}>, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>, ...z.ZodType<any, z.ZodTypeDef, any>[]]>>;
|
|
167
|
+
export declare const anchorsSchema: z.ZodArray<z.ZodIntersection<z.ZodObject<{
|
|
168
|
+
anchor: z.ZodString;
|
|
169
|
+
icon: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
|
|
170
|
+
style: z.ZodOptional<z.ZodEnum<["brands", "duotone", "light", "regular", "sharp-duotone-solid", "sharp-light", "sharp-regular", "sharp-solid", "sharp-thin", "solid", "thin"]>>;
|
|
171
|
+
name: z.ZodEffects<z.ZodString, string, string>;
|
|
172
|
+
}, "strip", z.ZodTypeAny, {
|
|
173
|
+
name: string;
|
|
174
|
+
style?: "brands" | "duotone" | "light" | "regular" | "sharp-duotone-solid" | "sharp-light" | "sharp-regular" | "sharp-solid" | "sharp-thin" | "solid" | "thin" | undefined;
|
|
175
|
+
}, {
|
|
176
|
+
name: string;
|
|
177
|
+
style?: "brands" | "duotone" | "light" | "regular" | "sharp-duotone-solid" | "sharp-light" | "sharp-regular" | "sharp-solid" | "sharp-thin" | "solid" | "thin" | undefined;
|
|
178
|
+
}>]>>;
|
|
179
|
+
color: z.ZodOptional<z.ZodObject<{
|
|
180
|
+
light: z.ZodOptional<z.ZodString>;
|
|
181
|
+
dark: z.ZodOptional<z.ZodString>;
|
|
182
|
+
}, "strict", z.ZodTypeAny, {
|
|
183
|
+
light?: string | undefined;
|
|
184
|
+
dark?: string | undefined;
|
|
185
|
+
}, {
|
|
186
|
+
light?: string | undefined;
|
|
187
|
+
dark?: string | undefined;
|
|
188
|
+
}>>;
|
|
189
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
190
|
+
openapi: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">]>>;
|
|
191
|
+
}, "strip", z.ZodTypeAny, {
|
|
192
|
+
anchor: string;
|
|
193
|
+
icon?: string | {
|
|
194
|
+
name: string;
|
|
195
|
+
style?: "brands" | "duotone" | "light" | "regular" | "sharp-duotone-solid" | "sharp-light" | "sharp-regular" | "sharp-solid" | "sharp-thin" | "solid" | "thin" | undefined;
|
|
196
|
+
} | undefined;
|
|
197
|
+
color?: {
|
|
198
|
+
light?: string | undefined;
|
|
199
|
+
dark?: string | undefined;
|
|
200
|
+
} | undefined;
|
|
201
|
+
hidden?: boolean | undefined;
|
|
202
|
+
openapi?: string | string[] | undefined;
|
|
203
|
+
}, {
|
|
204
|
+
anchor: string;
|
|
205
|
+
icon?: string | {
|
|
206
|
+
name: string;
|
|
207
|
+
style?: "brands" | "duotone" | "light" | "regular" | "sharp-duotone-solid" | "sharp-light" | "sharp-regular" | "sharp-solid" | "sharp-thin" | "solid" | "thin" | undefined;
|
|
208
|
+
} | undefined;
|
|
209
|
+
color?: {
|
|
210
|
+
light?: string | undefined;
|
|
211
|
+
dark?: string | undefined;
|
|
212
|
+
} | undefined;
|
|
213
|
+
hidden?: boolean | undefined;
|
|
214
|
+
openapi?: string | string[] | undefined;
|
|
215
|
+
}>, z.ZodUnion<[z.ZodObject<{
|
|
216
|
+
href: z.ZodString;
|
|
217
|
+
}, "strip", z.ZodTypeAny, {
|
|
218
|
+
href: string;
|
|
219
|
+
}, {
|
|
220
|
+
href: string;
|
|
221
|
+
}>, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>, ...z.ZodType<any, z.ZodTypeDef, any>[]]>>, "many">;
|
|
222
|
+
export declare const decoratedAnchorsSchema: z.ZodArray<z.ZodIntersection<z.ZodObject<{
|
|
223
|
+
anchor: z.ZodString;
|
|
224
|
+
icon: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
|
|
225
|
+
style: z.ZodOptional<z.ZodEnum<["brands", "duotone", "light", "regular", "sharp-duotone-solid", "sharp-light", "sharp-regular", "sharp-solid", "sharp-thin", "solid", "thin"]>>;
|
|
226
|
+
name: z.ZodEffects<z.ZodString, string, string>;
|
|
227
|
+
}, "strip", z.ZodTypeAny, {
|
|
228
|
+
name: string;
|
|
229
|
+
style?: "brands" | "duotone" | "light" | "regular" | "sharp-duotone-solid" | "sharp-light" | "sharp-regular" | "sharp-solid" | "sharp-thin" | "solid" | "thin" | undefined;
|
|
230
|
+
}, {
|
|
231
|
+
name: string;
|
|
232
|
+
style?: "brands" | "duotone" | "light" | "regular" | "sharp-duotone-solid" | "sharp-light" | "sharp-regular" | "sharp-solid" | "sharp-thin" | "solid" | "thin" | undefined;
|
|
233
|
+
}>]>>;
|
|
234
|
+
color: z.ZodOptional<z.ZodObject<{
|
|
235
|
+
light: z.ZodOptional<z.ZodString>;
|
|
236
|
+
dark: z.ZodOptional<z.ZodString>;
|
|
237
|
+
}, "strict", z.ZodTypeAny, {
|
|
238
|
+
light?: string | undefined;
|
|
239
|
+
dark?: string | undefined;
|
|
240
|
+
}, {
|
|
241
|
+
light?: string | undefined;
|
|
242
|
+
dark?: string | undefined;
|
|
243
|
+
}>>;
|
|
244
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
245
|
+
openapi: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">]>>;
|
|
246
|
+
}, "strip", z.ZodTypeAny, {
|
|
247
|
+
anchor: string;
|
|
248
|
+
icon?: string | {
|
|
249
|
+
name: string;
|
|
250
|
+
style?: "brands" | "duotone" | "light" | "regular" | "sharp-duotone-solid" | "sharp-light" | "sharp-regular" | "sharp-solid" | "sharp-thin" | "solid" | "thin" | undefined;
|
|
251
|
+
} | undefined;
|
|
252
|
+
color?: {
|
|
253
|
+
light?: string | undefined;
|
|
254
|
+
dark?: string | undefined;
|
|
255
|
+
} | undefined;
|
|
256
|
+
hidden?: boolean | undefined;
|
|
257
|
+
openapi?: string | string[] | undefined;
|
|
258
|
+
}, {
|
|
259
|
+
anchor: string;
|
|
260
|
+
icon?: string | {
|
|
261
|
+
name: string;
|
|
262
|
+
style?: "brands" | "duotone" | "light" | "regular" | "sharp-duotone-solid" | "sharp-light" | "sharp-regular" | "sharp-solid" | "sharp-thin" | "solid" | "thin" | undefined;
|
|
263
|
+
} | undefined;
|
|
264
|
+
color?: {
|
|
265
|
+
light?: string | undefined;
|
|
266
|
+
dark?: string | undefined;
|
|
267
|
+
} | undefined;
|
|
268
|
+
hidden?: boolean | undefined;
|
|
269
|
+
openapi?: string | string[] | undefined;
|
|
270
|
+
}>, z.ZodUnion<[z.ZodObject<{
|
|
271
|
+
href: z.ZodString;
|
|
272
|
+
}, "strip", z.ZodTypeAny, {
|
|
273
|
+
href: string;
|
|
274
|
+
}, {
|
|
275
|
+
href: string;
|
|
276
|
+
}>, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>, ...z.ZodType<any, z.ZodTypeDef, any>[]]>>, "many">;
|
|
56
277
|
export type AnchorsConfig = z.infer<typeof anchorsSchema>;
|
|
57
278
|
export type AnchorConfig = z.infer<typeof anchorSchema>;
|
|
279
|
+
export type DecoratedAnchorsConfig = z.infer<typeof decoratedAnchorsSchema>;
|
|
280
|
+
export type DecoratedAnchorConfig = z.infer<typeof decoratedAnchorSchema>;
|
|
@@ -4,27 +4,21 @@ import { hiddenSchema } from '../reusable/hidden.js';
|
|
|
4
4
|
import { hrefSchema } from '../reusable/href.js';
|
|
5
5
|
import { iconSchema } from '../reusable/icon.js';
|
|
6
6
|
import { openApiSchema } from '../reusable/openapi.js';
|
|
7
|
-
import {
|
|
8
|
-
import { groupsSchema } from './groups.js';
|
|
9
|
-
import { languagesSchema } from './languages.js';
|
|
10
|
-
import { pagesSchema } from './pages.js';
|
|
11
|
-
import { tabsSchema } from './tabs.js';
|
|
12
|
-
import { versionsSchema } from './version.js';
|
|
7
|
+
import { getDivisionSchemasExcluding, registerDivisionSchema } from './divisionSchemas.js';
|
|
13
8
|
const baseAnchorSchema = z.object({
|
|
14
9
|
anchor: z.string().nonempty().describe('The name of the anchor'),
|
|
15
10
|
icon: iconSchema.optional(),
|
|
16
11
|
color: colorSchemaWithOptionalLightAndDark.optional(),
|
|
17
12
|
hidden: hiddenSchema.optional(),
|
|
13
|
+
openapi: openApiSchema.optional(),
|
|
18
14
|
});
|
|
19
|
-
|
|
20
|
-
z.object({ openapi: openApiSchema }),
|
|
21
|
-
z.object({ href: hrefSchema }),
|
|
22
|
-
z.lazy(() => z.object({ languages: languagesSchema })),
|
|
23
|
-
z.lazy(() => z.object({ versions: versionsSchema })),
|
|
24
|
-
z.lazy(() => z.object({ dropdowns: dropdownsSchema })),
|
|
25
|
-
z.lazy(() => z.object({ tabs: tabsSchema })),
|
|
26
|
-
z.lazy(() => z.object({ groups: groupsSchema })),
|
|
27
|
-
z.lazy(() => z.object({ pages: pagesSchema })),
|
|
28
|
-
]));
|
|
15
|
+
const createAnchorSchema = (type) => baseAnchorSchema.and(z.union([z.object({ href: hrefSchema }), ...getDivisionSchemasExcluding('anchors', type)]));
|
|
29
16
|
export const nonRecursiveAnchorSchema = baseAnchorSchema.and(z.object({ href: hrefSchema }));
|
|
17
|
+
export const anchorSchema = createAnchorSchema('default');
|
|
18
|
+
export const decoratedAnchorSchema = createAnchorSchema('decorated');
|
|
30
19
|
export const anchorsSchema = z.array(anchorSchema).describe('Organizing by anchors');
|
|
20
|
+
export const decoratedAnchorsSchema = z
|
|
21
|
+
.array(decoratedAnchorSchema)
|
|
22
|
+
.describe('Organizing by anchors');
|
|
23
|
+
registerDivisionSchema('anchors', anchorsSchema, 'default');
|
|
24
|
+
registerDivisionSchema('anchors', decoratedAnchorsSchema, 'decorated');
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { Division } from '../reusable/divisions.js';
|
|
3
|
+
import { NavigationSchemaType } from './index.js';
|
|
4
|
+
export declare const divisionSchemas: Partial<Record<Division, z.ZodType>>;
|
|
5
|
+
export declare const decoratedDivisionSchemas: Partial<Record<Division, z.ZodType>>;
|
|
6
|
+
export declare function registerDivisionSchema(division: Division, schema: z.ZodType, type: NavigationSchemaType): void;
|
|
7
|
+
export declare function getDivisionSchemasExcluding(division: Division, type: NavigationSchemaType): [z.ZodType, z.ZodType, ...z.ZodType[]];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { groupsSchema } from './groups.js';
|
|
3
|
+
import { decoratedGroupsSchema } from './groups.js';
|
|
4
|
+
import { decoratedPagesSchema, pagesSchema } from './pages.js';
|
|
5
|
+
export const divisionSchemas = {};
|
|
6
|
+
export const decoratedDivisionSchemas = {};
|
|
7
|
+
export function registerDivisionSchema(division, schema, type) {
|
|
8
|
+
if (type === 'decorated') {
|
|
9
|
+
decoratedDivisionSchemas[division] = schema;
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
divisionSchemas[division] = schema;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export function getDivisionSchemasExcluding(division, type) {
|
|
16
|
+
const schemas = type === 'decorated'
|
|
17
|
+
? Object.entries(decoratedDivisionSchemas)
|
|
18
|
+
.filter(([key]) => key !== division)
|
|
19
|
+
.map(([key, schema]) => z.lazy(() => z.object({ [key]: schema })))
|
|
20
|
+
.concat(z.lazy(() => z.object({ groups: decoratedGroupsSchema })), z.lazy(() => z.object({ pages: decoratedPagesSchema })))
|
|
21
|
+
: Object.entries(divisionSchemas)
|
|
22
|
+
.filter(([key]) => key !== division)
|
|
23
|
+
.map(([key, schema]) => z.lazy(() => z.object({ [key]: schema })))
|
|
24
|
+
.concat(z.lazy(() => z.object({ groups: groupsSchema })), z.lazy(() => z.object({ pages: pagesSchema })));
|
|
25
|
+
return schemas;
|
|
26
|
+
}
|