@mintlify/validation 0.1.46 → 0.1.47

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.
Files changed (60) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +55 -55
  3. package/dist/index.d.ts +7 -7
  4. package/dist/index.js +1 -1
  5. package/dist/mint-config/common.d.ts +6 -6
  6. package/dist/mint-config/flattenUnionErrorMessages.d.ts +7 -7
  7. package/dist/mint-config/hexadecimalPattern.d.ts +1 -1
  8. package/dist/mint-config/schemas/analytics.d.ts +275 -275
  9. package/dist/mint-config/schemas/anchorColors.d.ts +28 -28
  10. package/dist/mint-config/schemas/anchors.d.ts +108 -108
  11. package/dist/mint-config/schemas/apiReference.d.ts +77 -77
  12. package/dist/mint-config/schemas/basics.d.ts +80 -80
  13. package/dist/mint-config/schemas/colors.d.ts +62 -62
  14. package/dist/mint-config/schemas/config.d.ts +815 -815
  15. package/dist/mint-config/schemas/favicon.d.ts +2 -2
  16. package/dist/mint-config/schemas/integrations.d.ts +38 -38
  17. package/dist/mint-config/schemas/navigation.d.ts +3 -3
  18. package/dist/mint-config/schemas/tabs.d.ts +31 -31
  19. package/dist/mint-config/schemas/versions.d.ts +24 -24
  20. package/dist/mint-config/types/enums.d.ts +4 -4
  21. package/dist/mint-config/types/index.d.ts +12 -12
  22. package/dist/mint-config/types/navigation.d.ts +13 -13
  23. package/dist/mint-config/validateAnchorsWarnings.d.ts +4 -4
  24. package/dist/mint-config/validateVersionsInNavigation.d.ts +5 -5
  25. package/dist/openapi/convertOpenApi.d.ts +18 -18
  26. package/dist/openapi/convertParameters.d.ts +9 -9
  27. package/dist/openapi/convertSchema.d.ts +11 -11
  28. package/dist/openapi/convertSecurity.d.ts +14 -14
  29. package/dist/openapi/convertServers.d.ts +8 -8
  30. package/dist/openapi/types/endpoint.d.ts +128 -128
  31. package/package.json +76 -75
  32. package/dist/mint-config/schemas/name.d.ts +0 -2
  33. package/dist/mint-config/types/analytics.d.ts +0 -3
  34. package/dist/mint-config/types/anchors.d.ts +0 -3
  35. package/dist/mint-config/types/colors.d.ts +0 -3
  36. package/dist/mint-config/types/config.d.ts +0 -3
  37. package/dist/mint-config/types/versions.d.ts +0 -3
  38. package/dist/schemas/analytics.d.ts +0 -171
  39. package/dist/schemas/anchorColors.d.ts +0 -14
  40. package/dist/schemas/anchors.d.ts +0 -46
  41. package/dist/schemas/colors.d.ts +0 -61
  42. package/dist/schemas/config.d.ts +0 -799
  43. package/dist/schemas/favicon.d.ts +0 -2
  44. package/dist/schemas/name.d.ts +0 -2
  45. package/dist/schemas/navigation.d.ts +0 -3
  46. package/dist/schemas/tabs.d.ts +0 -11
  47. package/dist/schemas/versions.d.ts +0 -11
  48. package/dist/types/analytics.d.ts +0 -3
  49. package/dist/types/anchors.d.ts +0 -3
  50. package/dist/types/colors.d.ts +0 -3
  51. package/dist/types/config.d.ts +0 -3
  52. package/dist/types/endpoint.d.ts +0 -125
  53. package/dist/types/navigation.d.ts +0 -6
  54. package/dist/types/versions.d.ts +0 -3
  55. package/dist/utils/common.d.ts +0 -6
  56. package/dist/utils/convertOpenApi.d.ts +0 -43
  57. package/dist/utils/flattenUnionErrorMessages.d.ts +0 -7
  58. package/dist/utils/hexadecimalPattern.d.ts +0 -1
  59. package/dist/utils/validateAnchorsWarnings.d.ts +0 -4
  60. package/dist/utils/validateVersionsInNavigation.d.ts +0 -5
@@ -1,2 +0,0 @@
1
- import { z } from "zod";
2
- export declare const faviconSchema: z.ZodEffects<z.ZodString, string, string>;
@@ -1,2 +0,0 @@
1
- import { z } from "zod";
2
- export declare const nameSchema: z.ZodString;
@@ -1,3 +0,0 @@
1
- import { z } from 'zod';
2
- import { NavigationType } from '../types/navigation';
3
- export declare const navigationConfigSchema: z.ZodArray<z.ZodType<NavigationType, z.ZodTypeDef, NavigationType>, "many">;
@@ -1,11 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const tabsSchema: z.ZodArray<z.ZodObject<{
3
- name: z.ZodString;
4
- url: z.ZodString;
5
- }, "strip", z.ZodTypeAny, {
6
- name: string;
7
- url: string;
8
- }, {
9
- name: string;
10
- url: string;
11
- }>, "many">;
@@ -1,11 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const versionsSchema: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
3
- name: z.ZodString;
4
- url: z.ZodString;
5
- }, "strict", z.ZodTypeAny, {
6
- name: string;
7
- url: string;
8
- }, {
9
- name: string;
10
- url: string;
11
- }>]>, "many">;
@@ -1,3 +0,0 @@
1
- import { z } from "zod";
2
- import { analyticsSchema } from "../schemas/analytics";
3
- export type AnalyticsType = z.infer<typeof analyticsSchema>;
@@ -1,3 +0,0 @@
1
- import { z } from "zod";
2
- import { anchorsSchema } from "../schemas/anchors";
3
- export type AnchorsType = z.infer<typeof anchorsSchema>;
@@ -1,3 +0,0 @@
1
- import { z } from "zod";
2
- import { colorsSchema } from "../schemas/colors";
3
- export type ColorsType = z.infer<typeof colorsSchema>;
@@ -1,3 +0,0 @@
1
- import { z } from "zod";
2
- import { configSchema } from "../schemas/config";
3
- export type ConfigType = z.infer<typeof configSchema>;
@@ -1,125 +0,0 @@
1
- export type Endpoint = {
2
- description?: string;
3
- path: string;
4
- method: HttpMethod;
5
- servers?: Server[];
6
- request: RequestSchema;
7
- response: ResponseSchema;
8
- deprecated: boolean;
9
- };
10
- export type Server = {
11
- url: string;
12
- description?: string;
13
- variables?: {
14
- [variableName: string]: ServerVariableSchema;
15
- };
16
- };
17
- export type ServerVariableSchema = ServerVariableStringSchema | ServerVariableStringEnumSchema;
18
- export type ServerVariableStringSchema = {
19
- type: 'string';
20
- default: string;
21
- description?: string;
22
- };
23
- export type ServerVariableStringEnumSchema = {
24
- type: 'stringEnum';
25
- enum: string[];
26
- default: string;
27
- description?: string;
28
- };
29
- export type HttpMethod = "get" | "put" | "post" | "delete" | "options" | "head" | "patch" | "trace";
30
- export type RequestSchema = {
31
- security: SecurityOption[];
32
- parameters: ParameterSections;
33
- body: BodySchema;
34
- };
35
- export type SecurityOption = NonPathParameterSections & {
36
- title: string;
37
- };
38
- export type BodySchema = {
39
- [contentType: string]: DataSchemaArray;
40
- };
41
- export type ParameterSchema = {
42
- required: boolean;
43
- description?: string;
44
- deprecated: boolean;
45
- schema: DataSchemaArray | 'basic' | 'bearer';
46
- };
47
- export type PathParameterSchema = ParameterSchema & {
48
- required: true;
49
- };
50
- export type ParameterGroup = {
51
- [name: string]: ParameterSchema;
52
- };
53
- export type PathParameterGroup = {
54
- [name: string]: PathParameterSchema;
55
- };
56
- type NonPathParameterLocations = 'query' | 'header' | 'cookie';
57
- type PathParameterLocations = 'path';
58
- export type ParameterLocations = NonPathParameterLocations | PathParameterLocations;
59
- type NonPathParameterSections = Record<NonPathParameterLocations, ParameterGroup>;
60
- type PathParameterSections = Record<PathParameterLocations, PathParameterGroup>;
61
- export type ParameterSections = NonPathParameterSections & PathParameterSections;
62
- export type ResponseSchema = {
63
- [code: string]: BodySchema;
64
- };
65
- export type DataSchemaArray = [DataSchema, ...DataSchema[]];
66
- export declare const typeList: readonly ["boolean", "string", "number", "integer", "object", "array", "stringEnum", "numberEnum", "integerEnum", "null"];
67
- export type SchemaType = typeof typeList[number];
68
- export type DataSchema = BooleanSchema | StringSchema | NumberSchema | ObjectSchema | ArraySchema | StringEnumSchema | NumberEnumSchema | NullSchema;
69
- export type BaseSchema<T> = {
70
- type: SchemaType;
71
- title?: string;
72
- description?: string;
73
- default?: T;
74
- example?: T;
75
- required?: boolean;
76
- readOnly?: boolean;
77
- writeOnly?: boolean;
78
- deprecated?: boolean;
79
- };
80
- export type BooleanSchema = {
81
- type: 'boolean';
82
- } & BaseSchema<boolean>;
83
- export type StringSchema = {
84
- type: 'string';
85
- format?: string;
86
- pattern?: string;
87
- maxLength?: number;
88
- minLength?: number;
89
- } & BaseSchema<string>;
90
- export type NumberSchema = {
91
- type: 'number' | 'integer';
92
- multipleOf?: number;
93
- maximum?: number;
94
- exclusiveMaximum?: boolean;
95
- minimum?: number;
96
- exclusiveMinimum?: boolean;
97
- } & BaseSchema<number>;
98
- export type ObjectSchema = {
99
- type: 'object';
100
- additionalProperties?: boolean | DataSchemaArray;
101
- maxProperties?: number;
102
- minProperties?: number;
103
- properties: {
104
- [key: string]: DataSchemaArray;
105
- };
106
- } & BaseSchema<object>;
107
- export type ArraySchema = {
108
- type: 'array';
109
- items: DataSchemaArray;
110
- maxItems?: number;
111
- minItems?: number;
112
- uniqueItems?: boolean;
113
- } & BaseSchema<unknown[]>;
114
- export type StringEnumSchema = {
115
- type: 'stringEnum';
116
- enum: string[];
117
- } & BaseSchema<string>;
118
- export type NumberEnumSchema = {
119
- type: 'numberEnum' | 'integerEnum';
120
- enum: number[];
121
- } & BaseSchema<number>;
122
- export type NullSchema = {
123
- type: 'null';
124
- } & BaseSchema<null>;
125
- export {};
@@ -1,6 +0,0 @@
1
- export type NavigationEntry = string | NavigationType;
2
- export type NavigationType = {
3
- group: string;
4
- pages: NavigationEntry[];
5
- version?: string;
6
- };
@@ -1,3 +0,0 @@
1
- import { z } from "zod";
2
- import { versionsSchema } from "../schemas/versions";
3
- export type VersionsType = z.infer<typeof versionsSchema>;
@@ -1,6 +0,0 @@
1
- export declare class MintValidationResults {
2
- status: "error" | "success";
3
- errors: string[];
4
- warnings: string[];
5
- constructor();
6
- }
@@ -1,43 +0,0 @@
1
- import { OpenAPIV3_1 } from 'openapi-types';
2
- import type { BodySchema, DataSchemaArray, Endpoint, HttpMethod, ParameterSections, ResponseSchema, SecurityOption, Server } from '../types/endpoint';
3
- export declare class InvalidSchemaError extends Error {
4
- constructor(message?: string);
5
- }
6
- export declare class ImpossibleSchemaError extends Error {
7
- constructor(message?: string);
8
- }
9
- export declare class ConversionError extends Error {
10
- constructor(message?: string);
11
- }
12
- type ConvertServersParams = OpenAPIV3_1.ServerObject[] | undefined;
13
- type ConvertServersType = Server[] | undefined;
14
- export declare const convertServers: (servers: ConvertServersParams) => ConvertServersType;
15
- type ConvertParametersParams = {
16
- pathParameters?: OpenAPIV3_1.ParameterObject[];
17
- operationParameters?: OpenAPIV3_1.ParameterObject[];
18
- };
19
- export declare const convertParameters: ({ pathParameters, operationParameters, }: ConvertParametersParams) => ParameterSections;
20
- export declare const convertSchema: (schema?: OpenAPIV3_1.SchemaObject, required?: boolean) => DataSchemaArray;
21
- export declare const combineTopLevelSchemas: (schema1: OpenAPIV3_1.SchemaObject, schema2: OpenAPIV3_1.SchemaObject) => OpenAPIV3_1.SchemaObject;
22
- export declare const convertProperties: (properties?: {
23
- [key: string]: OpenAPIV3_1.SchemaObject;
24
- } | undefined, required?: string[]) => {
25
- [key: string]: DataSchemaArray;
26
- };
27
- type ConvertSecurityParams = {
28
- securityRequirements?: OpenAPIV3_1.SecurityRequirementObject[];
29
- securitySchemes: OpenAPIV3_1.ComponentsObject['securitySchemes'];
30
- };
31
- export declare const convertSecurity: ({ securityRequirements, securitySchemes, }: ConvertSecurityParams) => SecurityOption[];
32
- type AddSecurityParametersParams = {
33
- securityScheme: OpenAPIV3_1.SecuritySchemeObject;
34
- parameterSections: SecurityOption;
35
- };
36
- export declare const addSecurityParameters: ({ securityScheme, parameterSections, }: AddSecurityParametersParams) => void;
37
- export declare const convertBody: (body?: OpenAPIV3_1.RequestBodyObject) => BodySchema;
38
- export declare const convertResponses: (responses: OpenAPIV3_1.ResponsesObject) => ResponseSchema;
39
- export declare const convertResponse: (response: OpenAPIV3_1.ResponseObject) => {
40
- [contentType: string]: DataSchemaArray;
41
- };
42
- export declare const convertOpenAPIV3_1ToEndpoint: (spec: OpenAPIV3_1.Document, path: string, method: HttpMethod) => Endpoint | undefined;
43
- export {};
@@ -1,7 +0,0 @@
1
- type UnionError = {
2
- message: string;
3
- code?: string;
4
- unionErrors?: UnionError[];
5
- };
6
- export declare function flattenUnionErrorMessages(unionErrors: UnionError[]): string[];
7
- export {};
@@ -1 +0,0 @@
1
- export declare const hexadecimalPattern: RegExp;
@@ -1,4 +0,0 @@
1
- import { NavigationType } from "../types/navigation";
2
- import { AnchorsType } from "../types/anchors";
3
- import { MintValidationResults } from "./common";
4
- export declare function validateAnchorsWarnings(anchors: AnchorsType | undefined, navigation: NavigationType[] | undefined): MintValidationResults;
@@ -1,5 +0,0 @@
1
- import { NavigationEntry, NavigationType } from "../types/navigation";
2
- import { VersionsType } from "../types/versions";
3
- import { MintValidationResults } from "./common";
4
- export declare function flattenNavigationVersions(nav: NavigationEntry[], versions?: string[]): string[];
5
- export declare function validateVersionsInNavigation(navigation: NavigationType[] | undefined, versions?: VersionsType | undefined): MintValidationResults;