@mintlify/validation 0.1.796 → 0.1.798
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/editor-navigation/types.d.ts +8 -0
- package/dist/index.js +2 -0
- package/dist/mint-config/schemas/v2/index.d.ts +520 -0
- package/dist/mint-config/schemas/v2/properties/navigation/anchors.d.ts +6 -0
- package/dist/mint-config/schemas/v2/properties/navigation/anchors.js +2 -1
- package/dist/mint-config/schemas/v2/properties/navigation/dropdown.d.ts +6 -0
- package/dist/mint-config/schemas/v2/properties/navigation/dropdown.js +2 -1
- package/dist/mint-config/schemas/v2/properties/navigation/groups.d.ts +7 -0
- package/dist/mint-config/schemas/v2/properties/navigation/groups.js +2 -1
- package/dist/mint-config/schemas/v2/properties/navigation/index.d.ts +40 -0
- package/dist/mint-config/schemas/v2/properties/navigation/index.js +2 -1
- package/dist/mint-config/schemas/v2/properties/navigation/languages.d.ts +6 -0
- package/dist/mint-config/schemas/v2/properties/navigation/languages.js +2 -1
- package/dist/mint-config/schemas/v2/properties/navigation/menu.d.ts +6 -0
- package/dist/mint-config/schemas/v2/properties/navigation/menu.js +2 -1
- package/dist/mint-config/schemas/v2/properties/navigation/pages.d.ts +4 -0
- package/dist/mint-config/schemas/v2/properties/navigation/products.d.ts +6 -0
- package/dist/mint-config/schemas/v2/properties/navigation/products.js +2 -1
- package/dist/mint-config/schemas/v2/properties/navigation/tabs.d.ts +3 -0
- package/dist/mint-config/schemas/v2/properties/navigation/tabs.js +25 -2
- package/dist/mint-config/schemas/v2/properties/navigation/version.d.ts +6 -0
- package/dist/mint-config/schemas/v2/properties/navigation/version.js +2 -1
- package/dist/mint-config/schemas/v2/properties/reusable/graphql.d.ts +24 -0
- package/dist/mint-config/schemas/v2/properties/reusable/graphql.js +35 -0
- package/dist/mint-config/schemas/v2/properties/reusable/index.d.ts +1 -0
- package/dist/mint-config/schemas/v2/properties/reusable/index.js +1 -0
- package/dist/mint-config/schemas/v2/themes/almond.d.ts +52 -0
- package/dist/mint-config/schemas/v2/themes/aspen.d.ts +52 -0
- package/dist/mint-config/schemas/v2/themes/linden.d.ts +52 -0
- package/dist/mint-config/schemas/v2/themes/luma.d.ts +52 -0
- package/dist/mint-config/schemas/v2/themes/maple.d.ts +52 -0
- package/dist/mint-config/schemas/v2/themes/mint.d.ts +52 -0
- package/dist/mint-config/schemas/v2/themes/palm.d.ts +52 -0
- package/dist/mint-config/schemas/v2/themes/reusable/index.d.ts +32 -0
- package/dist/mint-config/schemas/v2/themes/sequoia.d.ts +52 -0
- package/dist/mint-config/schemas/v2/themes/willow.d.ts +52 -0
- package/dist/mint-config/validateConfig.d.ts +180 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/serverStaticProps.d.ts +3 -1
- package/package.json +3 -3
|
@@ -3,6 +3,7 @@ import { ProductNavigation } from './divisionNav.js';
|
|
|
3
3
|
export declare const baseProductSchema: z.ZodObject<{
|
|
4
4
|
directory: z.ZodOptional<z.ZodEnum<["none", "accordion", "card"]>>;
|
|
5
5
|
product: z.ZodString;
|
|
6
|
+
graphql: z.ZodOptional<z.ZodNever>;
|
|
6
7
|
name: z.ZodOptional<z.ZodString>;
|
|
7
8
|
icon: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
|
|
8
9
|
style: z.ZodOptional<z.ZodEnum<["brands", "duotone", "light", "regular", "sharp-duotone-solid", "sharp-light", "sharp-regular", "sharp-solid", "sharp-thin", "solid", "thin"]>>;
|
|
@@ -44,6 +45,7 @@ export declare const baseProductSchema: z.ZodObject<{
|
|
|
44
45
|
directory?: "none" | "card" | "accordion" | undefined;
|
|
45
46
|
description?: string | undefined;
|
|
46
47
|
hidden?: boolean | undefined;
|
|
48
|
+
graphql?: undefined;
|
|
47
49
|
}, {
|
|
48
50
|
product: string;
|
|
49
51
|
name?: string | undefined;
|
|
@@ -59,6 +61,7 @@ export declare const baseProductSchema: z.ZodObject<{
|
|
|
59
61
|
directory?: "none" | "card" | "accordion" | undefined;
|
|
60
62
|
description?: string | undefined;
|
|
61
63
|
hidden?: boolean | undefined;
|
|
64
|
+
graphql?: undefined;
|
|
62
65
|
}>;
|
|
63
66
|
export declare const productSchema: z.ZodType<ProductNavigation<'default'>>;
|
|
64
67
|
export declare const decoratedProductSchema: z.ZodType<ProductNavigation<'decorated'>>;
|
|
@@ -68,6 +71,7 @@ export type BaseProductSchema = z.infer<typeof baseProductSchema>;
|
|
|
68
71
|
export declare const nonRecursiveProductSchema: z.ZodObject<{
|
|
69
72
|
directory: z.ZodOptional<z.ZodEnum<["none", "accordion", "card"]>>;
|
|
70
73
|
product: z.ZodString;
|
|
74
|
+
graphql: z.ZodOptional<z.ZodNever>;
|
|
71
75
|
name: z.ZodOptional<z.ZodString>;
|
|
72
76
|
icon: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
|
|
73
77
|
style: z.ZodOptional<z.ZodEnum<["brands", "duotone", "light", "regular", "sharp-duotone-solid", "sharp-light", "sharp-regular", "sharp-solid", "sharp-thin", "solid", "thin"]>>;
|
|
@@ -112,6 +116,7 @@ export declare const nonRecursiveProductSchema: z.ZodObject<{
|
|
|
112
116
|
directory?: "none" | "card" | "accordion" | undefined;
|
|
113
117
|
description?: string | undefined;
|
|
114
118
|
hidden?: boolean | undefined;
|
|
119
|
+
graphql?: undefined;
|
|
115
120
|
}, {
|
|
116
121
|
href: string;
|
|
117
122
|
product: string;
|
|
@@ -128,6 +133,7 @@ export declare const nonRecursiveProductSchema: z.ZodObject<{
|
|
|
128
133
|
directory?: "none" | "card" | "accordion" | undefined;
|
|
129
134
|
description?: string | undefined;
|
|
130
135
|
hidden?: boolean | undefined;
|
|
136
|
+
graphql?: undefined;
|
|
131
137
|
}>;
|
|
132
138
|
export type ProductConfig = z.infer<typeof productSchema>;
|
|
133
139
|
export type ProductsConfig = z.infer<typeof productsSchema>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { asyncApiSchema } from '../reusable/asyncapi.js';
|
|
3
3
|
import { colorSchemaWithOptionalLightAndDark } from '../reusable/color.js';
|
|
4
|
+
import { graphqlNotSupportedSchema } from '../reusable/graphql.js';
|
|
4
5
|
import { hiddenSchema } from '../reusable/hidden.js';
|
|
5
6
|
import { hrefSchema } from '../reusable/href.js';
|
|
6
7
|
import { iconSchema } from '../reusable/icon.js';
|
|
@@ -14,7 +15,7 @@ import { decoratedMenuSchema, menuSchema } from './menu.js';
|
|
|
14
15
|
import { pagesSchema, decoratedPagesSchema } from './pages.js';
|
|
15
16
|
import { tabsSchema, decoratedTabsSchema } from './tabs.js';
|
|
16
17
|
import { versionsSchema, decoratedVersionsSchema } from './version.js';
|
|
17
|
-
export const baseProductSchema = z.object(Object.assign({ product: z.string().nonempty().describe('The name of the product'), name: z.string().optional().describe('Display name for the product'), icon: iconSchema.optional(), color: colorSchemaWithOptionalLightAndDark.optional(), description: z.string().optional().describe('The description of the product'), hidden: hiddenSchema.optional() }, directoryField));
|
|
18
|
+
export const baseProductSchema = z.object(Object.assign({ product: z.string().nonempty().describe('The name of the product'), graphql: graphqlNotSupportedSchema, name: z.string().optional().describe('Display name for the product'), icon: iconSchema.optional(), color: colorSchemaWithOptionalLightAndDark.optional(), description: z.string().optional().describe('The description of the product'), hidden: hiddenSchema.optional() }, directoryField));
|
|
18
19
|
export const productSchema = z.union([
|
|
19
20
|
baseProductSchema.extend({
|
|
20
21
|
href: hrefSchema,
|
|
@@ -66,6 +66,7 @@ export declare const nonRecursiveTabSchema: z.ZodObject<{
|
|
|
66
66
|
align: z.ZodOptional<z.ZodEnum<["start", "end"]>>;
|
|
67
67
|
} & {
|
|
68
68
|
href: z.ZodEffects<z.ZodString, string, string>;
|
|
69
|
+
graphql: z.ZodOptional<z.ZodNever>;
|
|
69
70
|
}, "strip", z.ZodTypeAny, {
|
|
70
71
|
href: string;
|
|
71
72
|
tab: string;
|
|
@@ -77,6 +78,7 @@ export declare const nonRecursiveTabSchema: z.ZodObject<{
|
|
|
77
78
|
directory?: "none" | "card" | "accordion" | undefined;
|
|
78
79
|
searchable?: boolean | undefined;
|
|
79
80
|
hidden?: boolean | undefined;
|
|
81
|
+
graphql?: undefined;
|
|
80
82
|
align?: "start" | "end" | undefined;
|
|
81
83
|
}, {
|
|
82
84
|
href: string;
|
|
@@ -89,6 +91,7 @@ export declare const nonRecursiveTabSchema: z.ZodObject<{
|
|
|
89
91
|
directory?: "none" | "card" | "accordion" | undefined;
|
|
90
92
|
searchable?: boolean | undefined;
|
|
91
93
|
hidden?: boolean | undefined;
|
|
94
|
+
graphql?: undefined;
|
|
92
95
|
align?: "start" | "end" | undefined;
|
|
93
96
|
}>;
|
|
94
97
|
export declare const tabSchema: z.ZodType<TabNavigation<'default'>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { asyncApiSchema } from '../reusable/asyncapi.js';
|
|
3
|
+
import { graphqlNotSupportedSchema, graphqlSchema } from '../reusable/graphql.js';
|
|
3
4
|
import { hiddenSchema } from '../reusable/hidden.js';
|
|
4
5
|
import { hrefSchema } from '../reusable/href.js';
|
|
5
6
|
import { iconSchema } from '../reusable/icon.js';
|
|
@@ -16,69 +17,91 @@ import { decoratedProductsSchema, productsSchema } from './products.js';
|
|
|
16
17
|
import { decoratedVersionsSchema, versionsSchema } from './version.js';
|
|
17
18
|
export const tabAlignSchema = z.enum(['start', 'end']).describe('Tab alignment in the navigation');
|
|
18
19
|
export const baseTabSchema = z.object(Object.assign({ tab: z.string().nonempty().describe('The name of the tab'), icon: iconSchema.optional(), hidden: hiddenSchema.optional(), searchable: searchableSchema.optional(), align: tabAlignSchema.optional() }, directoryField));
|
|
19
|
-
export const nonRecursiveTabSchema = baseTabSchema.extend({
|
|
20
|
+
export const nonRecursiveTabSchema = baseTabSchema.extend({
|
|
21
|
+
href: hrefSchema,
|
|
22
|
+
graphql: graphqlNotSupportedSchema,
|
|
23
|
+
});
|
|
20
24
|
export const tabSchema = z.union([
|
|
25
|
+
baseTabSchema.extend({ graphql: graphqlSchema }).strict(),
|
|
26
|
+
baseTabSchema
|
|
27
|
+
.extend({
|
|
28
|
+
groups: z.lazy(() => groupsSchema),
|
|
29
|
+
graphql: graphqlSchema,
|
|
30
|
+
})
|
|
31
|
+
.strict(),
|
|
21
32
|
baseTabSchema.extend({
|
|
22
33
|
href: hrefSchema,
|
|
34
|
+
graphql: graphqlNotSupportedSchema,
|
|
23
35
|
openapi: openApiSchema.optional(),
|
|
24
36
|
asyncapi: asyncApiSchema.optional(),
|
|
25
37
|
global: z.lazy(() => globalSchema).optional(),
|
|
26
38
|
}),
|
|
27
39
|
baseTabSchema.extend({
|
|
28
40
|
languages: z.lazy(() => languagesSchema),
|
|
41
|
+
graphql: graphqlNotSupportedSchema,
|
|
29
42
|
openapi: openApiSchema.optional(),
|
|
30
43
|
asyncapi: asyncApiSchema.optional(),
|
|
31
44
|
global: z.lazy(() => globalSchema).optional(),
|
|
32
45
|
}),
|
|
33
46
|
baseTabSchema.extend({
|
|
34
47
|
versions: z.lazy(() => versionsSchema),
|
|
48
|
+
graphql: graphqlNotSupportedSchema,
|
|
35
49
|
openapi: openApiSchema.optional(),
|
|
36
50
|
asyncapi: asyncApiSchema.optional(),
|
|
37
51
|
global: z.lazy(() => globalSchema).optional(),
|
|
38
52
|
}),
|
|
39
53
|
baseTabSchema.extend({
|
|
40
54
|
dropdowns: z.lazy(() => dropdownsSchema),
|
|
55
|
+
graphql: graphqlNotSupportedSchema,
|
|
41
56
|
openapi: openApiSchema.optional(),
|
|
42
57
|
asyncapi: asyncApiSchema.optional(),
|
|
43
58
|
global: z.lazy(() => globalSchema).optional(),
|
|
44
59
|
}),
|
|
45
60
|
baseTabSchema.extend({
|
|
46
61
|
anchors: z.lazy(() => anchorsSchema),
|
|
62
|
+
graphql: graphqlNotSupportedSchema,
|
|
47
63
|
openapi: openApiSchema.optional(),
|
|
48
64
|
asyncapi: asyncApiSchema.optional(),
|
|
49
65
|
global: z.lazy(() => globalSchema).optional(),
|
|
50
66
|
}),
|
|
51
67
|
baseTabSchema.extend({
|
|
52
68
|
products: z.lazy(() => productsSchema),
|
|
69
|
+
graphql: graphqlNotSupportedSchema,
|
|
53
70
|
openapi: openApiSchema.optional(),
|
|
54
71
|
asyncapi: asyncApiSchema.optional(),
|
|
55
72
|
global: z.lazy(() => globalSchema).optional(),
|
|
56
73
|
}),
|
|
57
74
|
baseTabSchema.extend({
|
|
58
75
|
groups: z.lazy(() => groupsSchema),
|
|
76
|
+
graphql: graphqlNotSupportedSchema,
|
|
59
77
|
openapi: openApiSchema.optional(),
|
|
60
78
|
asyncapi: asyncApiSchema.optional(),
|
|
61
79
|
global: z.lazy(() => globalSchema).optional(),
|
|
62
80
|
}),
|
|
63
81
|
baseTabSchema.extend({
|
|
64
82
|
pages: z.lazy(() => pagesSchema),
|
|
83
|
+
graphql: graphqlNotSupportedSchema,
|
|
65
84
|
openapi: openApiSchema.optional(),
|
|
66
85
|
asyncapi: asyncApiSchema.optional(),
|
|
67
86
|
global: z.lazy(() => globalSchema).optional(),
|
|
68
87
|
}),
|
|
69
88
|
baseTabSchema.extend({
|
|
70
89
|
menu: z.lazy(() => menuSchema),
|
|
90
|
+
graphql: graphqlNotSupportedSchema,
|
|
71
91
|
openapi: openApiSchema.optional(),
|
|
72
92
|
asyncapi: asyncApiSchema.optional(),
|
|
73
93
|
global: z.lazy(() => globalSchema).optional(),
|
|
74
94
|
}),
|
|
75
95
|
baseTabSchema.extend({
|
|
96
|
+
graphql: graphqlNotSupportedSchema,
|
|
76
97
|
openapi: openApiSchema.optional(),
|
|
77
98
|
asyncapi: asyncApiSchema.optional(),
|
|
78
99
|
global: z.lazy(() => globalSchema).optional(),
|
|
79
100
|
}),
|
|
80
101
|
]);
|
|
81
|
-
export const decoratedTabSchema = baseTabSchema
|
|
102
|
+
export const decoratedTabSchema = baseTabSchema
|
|
103
|
+
.and(z.object({ graphql: graphqlNotSupportedSchema }))
|
|
104
|
+
.and(z.union([
|
|
82
105
|
z.object({ href: hrefSchema }),
|
|
83
106
|
z.lazy(() => z.object({ languages: decoratedLanguagesSchema, global: globalSchema.optional() })),
|
|
84
107
|
z.lazy(() => z.object({ versions: decoratedVersionsSchema, global: globalSchema.optional() })),
|
|
@@ -3,6 +3,7 @@ import { VersionNavigation } from './divisionNav.js';
|
|
|
3
3
|
export declare const baseVersionSchema: z.ZodObject<{
|
|
4
4
|
directory: z.ZodOptional<z.ZodEnum<["none", "accordion", "card"]>>;
|
|
5
5
|
version: z.ZodString;
|
|
6
|
+
graphql: z.ZodOptional<z.ZodNever>;
|
|
6
7
|
default: z.ZodOptional<z.ZodBoolean>;
|
|
7
8
|
tag: z.ZodOptional<z.ZodString>;
|
|
8
9
|
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -12,17 +13,20 @@ export declare const baseVersionSchema: z.ZodObject<{
|
|
|
12
13
|
directory?: "none" | "card" | "accordion" | undefined;
|
|
13
14
|
tag?: string | undefined;
|
|
14
15
|
hidden?: boolean | undefined;
|
|
16
|
+
graphql?: undefined;
|
|
15
17
|
}, {
|
|
16
18
|
version: string;
|
|
17
19
|
default?: boolean | undefined;
|
|
18
20
|
directory?: "none" | "card" | "accordion" | undefined;
|
|
19
21
|
tag?: string | undefined;
|
|
20
22
|
hidden?: boolean | undefined;
|
|
23
|
+
graphql?: undefined;
|
|
21
24
|
}>;
|
|
22
25
|
export type BaseVersionSchema = z.infer<typeof baseVersionSchema>;
|
|
23
26
|
export declare const nonRecursiveVersionSchema: z.ZodObject<{
|
|
24
27
|
directory: z.ZodOptional<z.ZodEnum<["none", "accordion", "card"]>>;
|
|
25
28
|
version: z.ZodString;
|
|
29
|
+
graphql: z.ZodOptional<z.ZodNever>;
|
|
26
30
|
default: z.ZodOptional<z.ZodBoolean>;
|
|
27
31
|
tag: z.ZodOptional<z.ZodString>;
|
|
28
32
|
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -35,6 +39,7 @@ export declare const nonRecursiveVersionSchema: z.ZodObject<{
|
|
|
35
39
|
directory?: "none" | "card" | "accordion" | undefined;
|
|
36
40
|
tag?: string | undefined;
|
|
37
41
|
hidden?: boolean | undefined;
|
|
42
|
+
graphql?: undefined;
|
|
38
43
|
}, {
|
|
39
44
|
version: string;
|
|
40
45
|
href: string;
|
|
@@ -42,6 +47,7 @@ export declare const nonRecursiveVersionSchema: z.ZodObject<{
|
|
|
42
47
|
directory?: "none" | "card" | "accordion" | undefined;
|
|
43
48
|
tag?: string | undefined;
|
|
44
49
|
hidden?: boolean | undefined;
|
|
50
|
+
graphql?: undefined;
|
|
45
51
|
}>;
|
|
46
52
|
export declare const versionSchema: z.ZodType<VersionNavigation<'default'>>;
|
|
47
53
|
export declare const decoratedVersionSchema: z.ZodType<VersionNavigation<'decorated'>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { asyncApiSchema } from '../reusable/asyncapi.js';
|
|
3
|
+
import { graphqlNotSupportedSchema } from '../reusable/graphql.js';
|
|
3
4
|
import { hiddenSchema } from '../reusable/hidden.js';
|
|
4
5
|
import { hrefSchema } from '../reusable/href.js';
|
|
5
6
|
import { openApiSchema } from '../reusable/openapi.js';
|
|
@@ -11,7 +12,7 @@ import { decoratedLanguagesSchema, languagesSchema } from './languages.js';
|
|
|
11
12
|
import { decoratedPagesSchema, pagesSchema } from './pages.js';
|
|
12
13
|
import { decoratedProductsSchema, productsSchema } from './products.js';
|
|
13
14
|
import { decoratedTabsSchema, tabsSchema } from './tabs.js';
|
|
14
|
-
export const baseVersionSchema = z.object(Object.assign({ version: z.string().nonempty().describe('The name of the version'), default: z.boolean().optional().describe('Whether this version is the default version'), tag: z.string().optional().describe('Tag for the version'), hidden: hiddenSchema.optional() }, directoryField));
|
|
15
|
+
export const baseVersionSchema = z.object(Object.assign({ version: z.string().nonempty().describe('The name of the version'), graphql: graphqlNotSupportedSchema, default: z.boolean().optional().describe('Whether this version is the default version'), tag: z.string().optional().describe('Tag for the version'), hidden: hiddenSchema.optional() }, directoryField));
|
|
15
16
|
export const nonRecursiveVersionSchema = baseVersionSchema.extend({ href: hrefSchema });
|
|
16
17
|
export const versionSchema = z.union([
|
|
17
18
|
baseVersionSchema.extend({
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const graphqlStringSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
3
|
+
export declare const graphqlObjSchema: z.ZodObject<{
|
|
4
|
+
source: z.ZodEffects<z.ZodString, string, string>;
|
|
5
|
+
directory: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
6
|
+
}, "strict", z.ZodTypeAny, {
|
|
7
|
+
source: string;
|
|
8
|
+
directory?: string | undefined;
|
|
9
|
+
}, {
|
|
10
|
+
source: string;
|
|
11
|
+
directory?: string | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const graphqlSchema: z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
|
|
14
|
+
source: z.ZodEffects<z.ZodString, string, string>;
|
|
15
|
+
directory: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
16
|
+
}, "strict", z.ZodTypeAny, {
|
|
17
|
+
source: string;
|
|
18
|
+
directory?: string | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
source: string;
|
|
21
|
+
directory?: string | undefined;
|
|
22
|
+
}>]>;
|
|
23
|
+
export type GraphqlConfig = z.infer<typeof graphqlSchema>;
|
|
24
|
+
export declare const graphqlNotSupportedSchema: z.ZodOptional<z.ZodNever>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { isAbsoluteUrl } from '../../../../isAbsoluteUrl.js';
|
|
3
|
+
import { normalizeRelativePath } from '../../../../transforms/normalizeRelativePath.js';
|
|
4
|
+
export const graphqlStringSchema = z
|
|
5
|
+
.string()
|
|
6
|
+
.trim()
|
|
7
|
+
.nonempty()
|
|
8
|
+
.transform((value, ctx) => {
|
|
9
|
+
if (!isAbsoluteUrl(value))
|
|
10
|
+
return normalizeRelativePath(value);
|
|
11
|
+
try {
|
|
12
|
+
if (new URL(value).protocol !== 'https:') {
|
|
13
|
+
ctx.addIssue({
|
|
14
|
+
code: z.ZodIssueCode.custom,
|
|
15
|
+
message: 'Must be a local path or a valid HTTPS URL.',
|
|
16
|
+
});
|
|
17
|
+
return z.NEVER;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
catch (_a) {
|
|
21
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, message: 'Invalid URL' });
|
|
22
|
+
return z.NEVER;
|
|
23
|
+
}
|
|
24
|
+
return value;
|
|
25
|
+
});
|
|
26
|
+
export const graphqlObjSchema = z
|
|
27
|
+
.object({
|
|
28
|
+
source: graphqlStringSchema,
|
|
29
|
+
directory: z.string().trim().nonempty().transform(normalizeRelativePath).optional(),
|
|
30
|
+
})
|
|
31
|
+
.strict();
|
|
32
|
+
export const graphqlSchema = z
|
|
33
|
+
.union([graphqlStringSchema, graphqlObjSchema])
|
|
34
|
+
.describe('A local path or HTTPS URL pointing to a GraphQL SDL schema');
|
|
35
|
+
export const graphqlNotSupportedSchema = z.never().optional();
|