@mintlify/validation 0.1.59 → 0.1.61
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 +17 -41
- package/dist/mint-config/common.js +1 -4
- package/dist/mint-config/flattenUnionErrorMessages.js +1 -5
- package/dist/mint-config/hexadecimalPattern.js +1 -4
- package/dist/mint-config/schemas/analytics.d.ts +0 -104
- package/dist/mint-config/schemas/analytics.js +28 -31
- package/dist/mint-config/schemas/anchorColors.d.ts +0 -1
- package/dist/mint-config/schemas/anchorColors.js +13 -16
- package/dist/mint-config/schemas/anchors.d.ts +7 -56
- package/dist/mint-config/schemas/anchors.js +17 -20
- package/dist/mint-config/schemas/apiReference.d.ts +0 -2
- package/dist/mint-config/schemas/apiReference.js +18 -21
- package/dist/mint-config/schemas/basics.d.ts +0 -11
- package/dist/mint-config/schemas/basics.js +37 -50
- package/dist/mint-config/schemas/colors.d.ts +0 -1
- package/dist/mint-config/schemas/colors.js +18 -21
- package/dist/mint-config/schemas/config.d.ts +13 -14
- package/dist/mint-config/schemas/config.js +38 -41
- package/dist/mint-config/schemas/favicon.js +2 -5
- package/dist/mint-config/schemas/integrations.d.ts +0 -6
- package/dist/mint-config/schemas/integrations.js +4 -7
- package/dist/mint-config/schemas/navigation.d.ts +15 -2
- package/dist/mint-config/schemas/navigation.js +22 -22
- package/dist/mint-config/schemas/tabs.d.ts +0 -13
- package/dist/mint-config/schemas/tabs.js +7 -10
- package/dist/mint-config/schemas/versions.d.ts +0 -13
- package/dist/mint-config/schemas/versions.js +7 -10
- package/dist/mint-config/validateAnchorsWarnings.d.ts +3 -4
- package/dist/mint-config/validateAnchorsWarnings.js +5 -9
- package/dist/mint-config/validateVersionsInNavigation.d.ts +4 -5
- package/dist/mint-config/validateVersionsInNavigation.js +6 -11
- package/dist/openapi/convertOpenApi.d.ts +1 -1
- package/dist/openapi/convertOpenApi.js +23 -31
- package/dist/openapi/convertParameters.d.ts +1 -1
- package/dist/openapi/convertParameters.js +11 -15
- package/dist/openapi/convertSchema.d.ts +1 -1
- package/dist/openapi/convertSchema.js +61 -72
- package/dist/openapi/convertSecurity.d.ts +1 -1
- package/dist/openapi/convertSecurity.js +8 -13
- package/dist/openapi/convertServers.d.ts +1 -1
- package/dist/openapi/convertServers.js +1 -5
- package/dist/openapi/types/endpoint.js +1 -4
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +17 -10
- package/dist/mint-config/types/enums.d.ts +0 -4
- package/dist/mint-config/types/enums.js +0 -4
- package/dist/mint-config/types/index.d.ts +0 -12
- package/dist/mint-config/types/index.js +0 -2
- package/dist/mint-config/types/navigation.d.ts +0 -13
- package/dist/mint-config/types/navigation.js +0 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import type { ConfigType } from '@mintlify/models';
|
|
2
|
+
import { MintValidationResults } from './mint-config/common.js';
|
|
3
3
|
export declare function validateMintConfig(config: ConfigType): MintValidationResults;
|
|
4
|
-
export * from './openapi/types/endpoint';
|
|
5
|
-
export
|
|
6
|
-
export {
|
|
7
|
-
export { convertSchema } from './openapi/convertSchema';
|
|
4
|
+
export * from './openapi/types/endpoint.js';
|
|
5
|
+
export { convertOpenAPIV3_1ToEndpoint } from './openapi/convertOpenApi.js';
|
|
6
|
+
export { convertSchema } from './openapi/convertSchema.js';
|
|
8
7
|
export declare const mintConfigSchema: any;
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
1
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
17
2
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
18
3
|
if (ar || !(i in from)) {
|
|
@@ -22,39 +7,34 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
22
7
|
}
|
|
23
8
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
24
9
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var flattenUnionErrorMessages_1 = require("./mint-config/flattenUnionErrorMessages");
|
|
33
|
-
var config_1 = require("./mint-config/schemas/config");
|
|
34
|
-
var validateAnchorsWarnings_1 = require("./mint-config/validateAnchorsWarnings");
|
|
35
|
-
var validateVersionsInNavigation_1 = require("./mint-config/validateVersionsInNavigation");
|
|
36
|
-
function validateMintConfig(config) {
|
|
10
|
+
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
11
|
+
import { MintValidationResults } from './mint-config/common.js';
|
|
12
|
+
import { flattenUnionErrorMessages } from './mint-config/flattenUnionErrorMessages.js';
|
|
13
|
+
import { configSchema } from './mint-config/schemas/config.js';
|
|
14
|
+
import { validateAnchorsWarnings } from './mint-config/validateAnchorsWarnings.js';
|
|
15
|
+
import { validateVersionsInNavigation } from './mint-config/validateVersionsInNavigation.js';
|
|
16
|
+
export function validateMintConfig(config) {
|
|
37
17
|
var _a;
|
|
38
|
-
var results = new
|
|
18
|
+
var results = new MintValidationResults();
|
|
39
19
|
if (config == null || config == undefined || Object.entries(config).length === 0) {
|
|
40
20
|
results.errors.push('Mint Config object cannot be empty.');
|
|
41
21
|
results.status = 'error';
|
|
42
22
|
return results;
|
|
43
23
|
}
|
|
44
24
|
// Specific warnings and errors
|
|
45
|
-
var validateAnchorsWarningResult =
|
|
46
|
-
var validateVersionsInNavigationResult =
|
|
25
|
+
var validateAnchorsWarningResult = validateAnchorsWarnings(config.anchors, config.navigation);
|
|
26
|
+
var validateVersionsInNavigationResult = validateVersionsInNavigation(config.navigation, (_a = config.versions) !== null && _a !== void 0 ? _a : []);
|
|
47
27
|
results.errors = __spreadArray(__spreadArray([], results.errors, true), validateVersionsInNavigationResult.errors, true);
|
|
48
28
|
results.warnings = __spreadArray(__spreadArray(__spreadArray([], results.warnings, true), validateVersionsInNavigationResult.warnings, true), validateAnchorsWarningResult.warnings, true);
|
|
49
29
|
// Global check
|
|
50
|
-
var validateConfigResult =
|
|
30
|
+
var validateConfigResult = configSchema.safeParse(config);
|
|
51
31
|
if (validateConfigResult.success == false) {
|
|
52
32
|
var errors = validateConfigResult.error.issues;
|
|
53
33
|
errors.forEach(function (e) {
|
|
54
34
|
var _a;
|
|
55
35
|
var _b;
|
|
56
36
|
if (e.code === 'invalid_union' && ((_b = e.unionErrors) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
57
|
-
(_a = results.errors).push.apply(_a,
|
|
37
|
+
(_a = results.errors).push.apply(_a, flattenUnionErrorMessages(e.unionErrors));
|
|
58
38
|
}
|
|
59
39
|
else {
|
|
60
40
|
var message = e.message;
|
|
@@ -69,16 +49,12 @@ function validateMintConfig(config) {
|
|
|
69
49
|
results.status = results.errors.length ? 'error' : 'success';
|
|
70
50
|
return results;
|
|
71
51
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
var
|
|
76
|
-
Object.defineProperty(exports, "convertOpenAPIV3_1ToEndpoint", { enumerable: true, get: function () { return convertOpenApi_1.convertOpenAPIV3_1ToEndpoint; } });
|
|
77
|
-
var convertSchema_1 = require("./openapi/convertSchema");
|
|
78
|
-
Object.defineProperty(exports, "convertSchema", { enumerable: true, get: function () { return convertSchema_1.convertSchema; } });
|
|
79
|
-
exports.mintConfigSchema = (function () {
|
|
52
|
+
export * from './openapi/types/endpoint.js';
|
|
53
|
+
export { convertOpenAPIV3_1ToEndpoint } from './openapi/convertOpenApi.js';
|
|
54
|
+
export { convertSchema } from './openapi/convertSchema.js';
|
|
55
|
+
export var mintConfigSchema = (function () {
|
|
80
56
|
var _a, _b, _c, _d, _e, _f;
|
|
81
|
-
var schema = (
|
|
57
|
+
var schema = zodToJsonSchema(configSchema, 'Schema');
|
|
82
58
|
(_b = (_a = schema.definitions) === null || _a === void 0 ? void 0 : _a.Schema) === null || _b === void 0 ? true : delete _b.properties.__injected;
|
|
83
59
|
(_d = (_c = schema.definitions) === null || _c === void 0 ? void 0 : _c.Schema) === null || _d === void 0 ? true : delete _d.properties.colors.properties.ultraDark;
|
|
84
60
|
(_f = (_e = schema.definitions) === null || _e === void 0 ? void 0 : _e.Schema) === null || _f === void 0 ? true : delete _f.properties.colors.properties.ultraLight;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MintValidationResults = void 0;
|
|
4
1
|
var MintValidationResults = /** @class */ (function () {
|
|
5
2
|
function MintValidationResults() {
|
|
6
3
|
this.status = 'success';
|
|
@@ -9,4 +6,4 @@ var MintValidationResults = /** @class */ (function () {
|
|
|
9
6
|
}
|
|
10
7
|
return MintValidationResults;
|
|
11
8
|
}());
|
|
12
|
-
|
|
9
|
+
export { MintValidationResults };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
2
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
3
|
if (ar || !(i in from)) {
|
|
@@ -8,11 +7,9 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
8
7
|
}
|
|
9
8
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
9
|
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.flattenUnionErrorMessages = void 0;
|
|
13
10
|
// TO DO: Write unit tests for this function.
|
|
14
11
|
// TO DO: Prettify the output instead of just returning JSON objects.
|
|
15
|
-
function flattenUnionErrorMessages(unionErrors) {
|
|
12
|
+
export function flattenUnionErrorMessages(unionErrors) {
|
|
16
13
|
return unionErrors.reduce(function (acc, unionError) {
|
|
17
14
|
if (Array.isArray(unionError.unionErrors) && unionError.unionErrors.length > 0) {
|
|
18
15
|
return __spreadArray(__spreadArray([], acc, true), flattenUnionErrorMessages(unionError.unionErrors), true);
|
|
@@ -20,4 +17,3 @@ function flattenUnionErrorMessages(unionErrors) {
|
|
|
20
17
|
return __spreadArray(__spreadArray([], acc, true), [unionError.message], false);
|
|
21
18
|
}, []);
|
|
22
19
|
}
|
|
23
|
-
exports.flattenUnionErrorMessages = flattenUnionErrorMessages;
|
|
@@ -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 {};
|
|
@@ -1,33 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var zod_1 = require("zod");
|
|
5
|
-
var amplitudeConfigInterfaceSchema = zod_1.z.object({
|
|
6
|
-
apiKey: zod_1.z.string({
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
var amplitudeConfigInterfaceSchema = z.object({
|
|
3
|
+
apiKey: z.string({
|
|
7
4
|
required_error: 'Amplitude apiKey is missing.',
|
|
8
5
|
invalid_type_error: 'Amplitude apiKey must be a string.',
|
|
9
6
|
}),
|
|
10
7
|
}, {
|
|
11
8
|
invalid_type_error: 'Amplitude analytics config must be an object with an apiKey property.',
|
|
12
9
|
});
|
|
13
|
-
var clearbitConfigInterfaceSchema =
|
|
14
|
-
publicApiKey:
|
|
10
|
+
var clearbitConfigInterfaceSchema = z.object({
|
|
11
|
+
publicApiKey: z.string({
|
|
15
12
|
required_error: 'Clearbit publicApiKey is missing.',
|
|
16
13
|
invalid_type_error: 'Clearbit publicApiKey must be a string.',
|
|
17
14
|
}),
|
|
18
15
|
}, {
|
|
19
16
|
invalid_type_error: 'Clearbit config must be an object with a publicApiKey property.',
|
|
20
17
|
});
|
|
21
|
-
var fathomConfigInterfaceSchema =
|
|
22
|
-
siteId:
|
|
18
|
+
var fathomConfigInterfaceSchema = z.object({
|
|
19
|
+
siteId: z.string({
|
|
23
20
|
required_error: 'Fathom siteId is missing.',
|
|
24
21
|
invalid_type_error: 'Fathom siteId must be a string.',
|
|
25
22
|
}),
|
|
26
23
|
}, {
|
|
27
24
|
invalid_type_error: 'Fathom analytics config must be an object with a siteId property.',
|
|
28
25
|
});
|
|
29
|
-
var googleAnalyticsConfigInterfaceSchema =
|
|
30
|
-
measurementId:
|
|
26
|
+
var googleAnalyticsConfigInterfaceSchema = z.object({
|
|
27
|
+
measurementId: z
|
|
31
28
|
.string({
|
|
32
29
|
required_error: 'Google Analytics measurementId is missing.',
|
|
33
30
|
invalid_type_error: 'Google Analytics measurementId must be a string.',
|
|
@@ -36,8 +33,8 @@ var googleAnalyticsConfigInterfaceSchema = zod_1.z.object({
|
|
|
36
33
|
}, {
|
|
37
34
|
invalid_type_error: 'Google Analytics config must be an object with a measurementId property.',
|
|
38
35
|
});
|
|
39
|
-
var googleTagManagerConfigInterfaceSchema =
|
|
40
|
-
tagId:
|
|
36
|
+
var googleTagManagerConfigInterfaceSchema = z.object({
|
|
37
|
+
tagId: z
|
|
41
38
|
.string({
|
|
42
39
|
required_error: 'Google Tag Manager tagId is missing.',
|
|
43
40
|
invalid_type_error: 'Google Tag Manager tagId must be a string.',
|
|
@@ -46,20 +43,20 @@ var googleTagManagerConfigInterfaceSchema = zod_1.z.object({
|
|
|
46
43
|
}, {
|
|
47
44
|
invalid_type_error: 'Google Tag Manager config must be an object with a tagId property.',
|
|
48
45
|
});
|
|
49
|
-
var hotjarConfigInterfaceSchema =
|
|
50
|
-
hjid:
|
|
46
|
+
var hotjarConfigInterfaceSchema = z.object({
|
|
47
|
+
hjid: z.string({
|
|
51
48
|
required_error: 'Hotjar hjid is missing.',
|
|
52
49
|
invalid_type_error: 'Hotjar hjid must be a string.',
|
|
53
50
|
}),
|
|
54
|
-
hjsv:
|
|
51
|
+
hjsv: z.string({
|
|
55
52
|
required_error: 'Hotjar hjsv is missing.',
|
|
56
53
|
invalid_type_error: 'Hotjar hjsv must be a string.',
|
|
57
54
|
}),
|
|
58
55
|
}, {
|
|
59
56
|
invalid_type_error: 'Hotjar config must be an object with a hjid and hjsv property.',
|
|
60
57
|
});
|
|
61
|
-
var koalaConfigInterfaceSchema =
|
|
62
|
-
publicApiKey:
|
|
58
|
+
var koalaConfigInterfaceSchema = z.object({
|
|
59
|
+
publicApiKey: z
|
|
63
60
|
.string({
|
|
64
61
|
required_error: 'Public Api Key is required for the Koala snippet to run.',
|
|
65
62
|
invalid_type_error: 'Koala Public Api Key must be a string.',
|
|
@@ -68,44 +65,44 @@ var koalaConfigInterfaceSchema = zod_1.z.object({
|
|
|
68
65
|
}, {
|
|
69
66
|
invalid_type_error: 'Koala config must be an object with a publicApiKey property.',
|
|
70
67
|
});
|
|
71
|
-
var logrocketConfigInterfaceSchema =
|
|
72
|
-
appId:
|
|
68
|
+
var logrocketConfigInterfaceSchema = z.object({
|
|
69
|
+
appId: z.string({
|
|
73
70
|
required_error: 'Logrocket appId is missing.',
|
|
74
71
|
invalid_type_error: 'Logrocket appId must be a string.',
|
|
75
72
|
}),
|
|
76
73
|
}, {
|
|
77
74
|
invalid_type_error: 'Logrocket config must be an object with an appId property.',
|
|
78
75
|
});
|
|
79
|
-
var mixpanelConfigInterfaceSchema =
|
|
80
|
-
projectToken:
|
|
76
|
+
var mixpanelConfigInterfaceSchema = z.object({
|
|
77
|
+
projectToken: z.string({
|
|
81
78
|
required_error: 'Mixpanel projectToken is missing.',
|
|
82
79
|
invalid_type_error: 'Mixpanel projectToken must be a string.',
|
|
83
80
|
}),
|
|
84
81
|
}, {
|
|
85
82
|
invalid_type_error: 'Mixpanel config must be an object with a projectToken property.',
|
|
86
83
|
});
|
|
87
|
-
var pirschConfigInterfaceSchema =
|
|
88
|
-
id:
|
|
84
|
+
var pirschConfigInterfaceSchema = z.object({
|
|
85
|
+
id: z.string({
|
|
89
86
|
required_error: 'Pirsch id is missing.',
|
|
90
87
|
invalid_type_error: 'Pirsch id must be a string.',
|
|
91
88
|
}),
|
|
92
89
|
}, { invalid_type_error: 'Pirsch config must be an object with an id property.' });
|
|
93
|
-
var postHogConfigInterfaceSchema =
|
|
94
|
-
apiKey:
|
|
90
|
+
var postHogConfigInterfaceSchema = z.object({
|
|
91
|
+
apiKey: z
|
|
95
92
|
.string({
|
|
96
93
|
required_error: 'Posthog apiKey is missing.',
|
|
97
94
|
invalid_type_error: 'Posthog apiKey must be a string.',
|
|
98
95
|
})
|
|
99
96
|
.startsWith('phc_', 'Posthog apiKey must start with phc_'),
|
|
100
|
-
apiHost:
|
|
97
|
+
apiHost: z
|
|
101
98
|
.string({ invalid_type_error: 'Posthog apiHost must be a string.' })
|
|
102
99
|
.url('Posthog apiHost must be a valid URL.')
|
|
103
100
|
.optional(),
|
|
104
101
|
}, {
|
|
105
102
|
invalid_type_error: 'Posthog config must be an object with an apiKey property.',
|
|
106
103
|
});
|
|
107
|
-
var plausibleConfigInterfaceSchema =
|
|
108
|
-
domain:
|
|
104
|
+
var plausibleConfigInterfaceSchema = z.object({
|
|
105
|
+
domain: z
|
|
109
106
|
.string({
|
|
110
107
|
required_error: 'Plausible domain is missing.',
|
|
111
108
|
invalid_type_error: 'Plausible domain must be a string.',
|
|
@@ -114,7 +111,7 @@ var plausibleConfigInterfaceSchema = zod_1.z.object({
|
|
|
114
111
|
}, {
|
|
115
112
|
invalid_type_error: 'Plausible config must be an object with a domain property. The domain must not start with http:// or https://.',
|
|
116
113
|
});
|
|
117
|
-
|
|
114
|
+
export var analyticsSchema = z
|
|
118
115
|
.object({
|
|
119
116
|
amplitude: amplitudeConfigInterfaceSchema.optional(),
|
|
120
117
|
clearbit: clearbitConfigInterfaceSchema.optional(),
|
|
@@ -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>;
|
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var hexadecimalPattern_1 = require("../hexadecimalPattern");
|
|
6
|
-
exports.gradientSchema = zod_1.z.object({
|
|
7
|
-
from: zod_1.z
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { hexadecimalPattern } from '../hexadecimalPattern.js';
|
|
3
|
+
export var gradientSchema = z.object({
|
|
4
|
+
from: z
|
|
8
5
|
.string({
|
|
9
6
|
invalid_type_error: 'Anchor color.from must be a string.',
|
|
10
7
|
})
|
|
11
|
-
.regex(
|
|
12
|
-
via:
|
|
8
|
+
.regex(hexadecimalPattern, 'Anchor color.from must be a hexadecimal color.'),
|
|
9
|
+
via: z
|
|
13
10
|
.string({
|
|
14
11
|
invalid_type_error: 'Anchor color.via must be a string.',
|
|
15
12
|
})
|
|
16
|
-
.regex(
|
|
13
|
+
.regex(hexadecimalPattern, 'Anchor color.via must be undefined or a hexadecimal color.')
|
|
17
14
|
.optional(),
|
|
18
|
-
to:
|
|
15
|
+
to: z
|
|
19
16
|
.string({
|
|
20
17
|
invalid_type_error: 'Anchor color.to must be a string.',
|
|
21
18
|
})
|
|
22
|
-
.regex(
|
|
19
|
+
.regex(hexadecimalPattern, 'Anchor color.to must be a hexadecimal color.'),
|
|
23
20
|
});
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
export var anchorColorSchema = z.union([
|
|
22
|
+
z
|
|
26
23
|
.string({ invalid_type_error: 'Anchor color must be a string.' })
|
|
27
|
-
.regex(
|
|
28
|
-
|
|
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.'),
|
|
29
26
|
], {
|
|
30
27
|
invalid_type_error: 'Anchor color must be a string or an object with from and to properties.',
|
|
31
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?: "brands" | "duotone" | "light" | "sharp-solid" | "solid" | "thin" | undefined;
|
|
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?: "brands" | "duotone" | "light" | "sharp-solid" | "solid" | "thin" | undefined;
|
|
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?: "brands" | "duotone" | "light" | "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?: "brands" | "duotone" | "light" | "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?: "brands" | "duotone" | "light" | "sharp-solid" | "solid" | "thin" | undefined;
|
|
54
|
+
iconType?: "brands" | "duotone" | "light" | "regular" | "sharp-solid" | "solid" | "thin" | undefined;
|
|
100
55
|
}, {
|
|
101
56
|
name: string;
|
|
102
57
|
icon?: string | undefined;
|
|
103
|
-
iconType?: "brands" | "duotone" | "light" | "sharp-solid" | "solid" | "thin" | undefined;
|
|
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 {};
|
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
var anchorSchema = zod_1.z.object({
|
|
7
|
-
name: zod_1.z
|
|
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
|
|
8
6
|
.string({
|
|
9
7
|
required_error: 'Every anchor must have a name.',
|
|
10
8
|
invalid_type_error: 'Anchor name must be a string.',
|
|
11
9
|
})
|
|
12
10
|
.trim()
|
|
13
11
|
.min(1, 'Anchor name is empty.'),
|
|
14
|
-
url:
|
|
12
|
+
url: z
|
|
15
13
|
.string({
|
|
16
14
|
required_error: 'Every anchor must have a url',
|
|
17
15
|
invalid_type_error: 'Anchor url must be a string.',
|
|
18
16
|
})
|
|
19
17
|
.trim()
|
|
20
18
|
.min(1, 'Anchor URL is missing.'),
|
|
21
|
-
icon:
|
|
19
|
+
icon: z
|
|
22
20
|
.string({
|
|
23
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',
|
|
24
22
|
})
|
|
25
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.')
|
|
26
24
|
.optional(),
|
|
27
|
-
iconType:
|
|
28
|
-
.enum(
|
|
25
|
+
iconType: z
|
|
26
|
+
.enum(iconTypes, {
|
|
29
27
|
errorMap: function () {
|
|
30
28
|
return {
|
|
31
29
|
message: 'anchor iconType must be one of the following strings: brands, duotone, light, sharp-solid, solid, thin',
|
|
@@ -33,32 +31,31 @@ var anchorSchema = zod_1.z.object({
|
|
|
33
31
|
},
|
|
34
32
|
})
|
|
35
33
|
.optional(),
|
|
36
|
-
color:
|
|
37
|
-
isDefaultHidden:
|
|
34
|
+
color: anchorColorSchema.optional(),
|
|
35
|
+
isDefaultHidden: z
|
|
38
36
|
.boolean({
|
|
39
37
|
invalid_type_error: 'Anchor isDefaultHidden must be a boolean. Try writing true or false without quotes around them.',
|
|
40
38
|
})
|
|
41
39
|
.optional(),
|
|
42
|
-
version:
|
|
40
|
+
version: z
|
|
43
41
|
.string({
|
|
44
42
|
invalid_type_error: 'Version must be a string in the versions array.',
|
|
45
43
|
})
|
|
46
44
|
.optional(),
|
|
47
45
|
});
|
|
48
|
-
|
|
49
|
-
exports.topAnchorSchema = zod_1.z
|
|
46
|
+
export var topAnchorSchema = z
|
|
50
47
|
.object({
|
|
51
|
-
name:
|
|
48
|
+
name: z.string({
|
|
52
49
|
required_error: 'topAnchor.name is missing, set it or delete the entire topAnchor property.',
|
|
53
50
|
invalid_type_error: 'topAnchor.name must be a string',
|
|
54
51
|
}),
|
|
55
|
-
icon:
|
|
52
|
+
icon: z
|
|
56
53
|
.string({
|
|
57
54
|
invalid_type_error: 'topAnchor.icon must be a string',
|
|
58
55
|
})
|
|
59
56
|
.optional(),
|
|
60
|
-
iconType:
|
|
61
|
-
.enum(
|
|
57
|
+
iconType: z
|
|
58
|
+
.enum(iconTypes, {
|
|
62
59
|
errorMap: function () {
|
|
63
60
|
return {
|
|
64
61
|
message: 'topAnchor.iconType must be one of the following strings: brands, duotone, light, sharp-solid, solid, thin',
|
|
@@ -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>;
|