@mintlify/validation 0.1.492 → 0.1.494

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 (32) hide show
  1. package/dist/openapi/v2/mapExample.d.ts +8 -0
  2. package/dist/openapi/v2/mapExample.js +20 -0
  3. package/dist/openapi/v2/mapExampleComponents.d.ts +8 -0
  4. package/dist/openapi/v2/mapExampleComponents.js +15 -0
  5. package/dist/openapi/v2/mapHeader.d.ts +8 -0
  6. package/dist/openapi/v2/mapHeader.js +57 -0
  7. package/dist/openapi/v2/mapHeaderComponents.d.ts +8 -0
  8. package/dist/openapi/v2/mapHeaderComponents.js +13 -0
  9. package/dist/openapi/v2/mapMedia.d.ts +8 -0
  10. package/dist/openapi/v2/mapMedia.js +36 -0
  11. package/dist/openapi/v2/mapParameter.d.ts +8 -0
  12. package/dist/openapi/v2/mapParameter.js +53 -0
  13. package/dist/openapi/v2/mapParameterComponents.d.ts +8 -0
  14. package/dist/openapi/v2/mapParameterComponents.js +20 -0
  15. package/dist/openapi/v2/mapRequestBody.d.ts +8 -0
  16. package/dist/openapi/v2/mapRequestBody.js +31 -0
  17. package/dist/openapi/v2/mapRequestBodyComponents.d.ts +8 -0
  18. package/dist/openapi/v2/mapRequestBodyComponents.js +15 -0
  19. package/dist/openapi/v2/mapResponseComponents.d.ts +8 -0
  20. package/dist/openapi/v2/mapResponseComponents.js +51 -0
  21. package/dist/openapi/v2/mapSchema.d.ts +8 -0
  22. package/dist/openapi/v2/mapSchema.js +15 -0
  23. package/dist/openapi/v2/mapSchemaComponents.d.ts +8 -0
  24. package/dist/openapi/v2/mapSchemaComponents.js +22 -0
  25. package/dist/openapi/v2/mapSecuritySchemeComponents.d.ts +8 -0
  26. package/dist/openapi/v2/mapSecuritySchemeComponents.js +20 -0
  27. package/dist/openapi/v2/openApiToSchemaGraph.js +16 -2
  28. package/dist/openapi/v2/replaceSchemaRefs.d.ts +5 -0
  29. package/dist/openapi/v2/replaceSchemaRefs.js +34 -0
  30. package/dist/openapi/v2/types/index.d.ts +55 -44
  31. package/dist/tsconfig.build.tsbuildinfo +1 -1
  32. package/package.json +2 -2
@@ -1,14 +1,15 @@
1
1
  import { OpenAPIV3, OpenAPIV3_1 } from 'openapi-types';
2
2
  import { XMcp, XMint } from '../../types/endpoint.js';
3
3
  export type UUID = string;
4
- export type objectHash = string;
4
+ export type HashId = string;
5
5
  export type RefUuidMap = Record<string, UUID>;
6
- export type UUIDObjectHashMap = Record<UUID, objectHash>;
7
- export type HashedNodeMap = Record<objectHash, GraphNode>;
8
- export type GraphNode = Schema | Response | Parameter | Example | RequestBody | SecurityScheme | Media | Encoding;
6
+ export type UUIDObjectHashMap = Record<UUID, HashId>;
7
+ export type HashedNodeMap = Record<HashId, GraphNode>;
8
+ export type GraphNode = SchemaOrRef | ResponseOrRef | HeaderOrRef | ParameterOrRef | Media | ExampleOrRef | RequestBodyOrRef | SecuritySchemeOrRef | Server | Path | Operation | SecurityRequirement | Document;
9
9
  export type SchemaObject = OpenAPIV3.SchemaObject | OpenAPIV3_1.SchemaObject;
10
- export type Schema = SchemaObject & {
11
- type: 'schema';
10
+ export type RefObject = OpenAPIV3.ReferenceObject | OpenAPIV3_1.ReferenceObject;
11
+ export type SchemaOrRefObject = SchemaObject | RefObject;
12
+ export type SchemaOrRef = (SchemaOrRefObject & {
12
13
  items?: UUID;
13
14
  properties?: {
14
15
  [name: string]: UUID;
@@ -18,68 +19,82 @@ export type Schema = SchemaObject & {
18
19
  anyOf?: UUID[];
19
20
  oneOf?: UUID[];
20
21
  not?: UUID;
21
- };
22
+ }) | (RefObject & {
23
+ $ref: UUID;
24
+ }) | HashId;
22
25
  export type ResponseObject = OpenAPIV3.ResponseObject | OpenAPIV3_1.ResponseObject;
23
- export type Response = ResponseObject & {
24
- type: 'response';
26
+ export type ResponseOrRef = (ResponseObject & {
25
27
  headers?: {
26
28
  [header: string]: UUID;
27
29
  };
28
30
  content?: {
29
- [mediaType: string]: UUID;
31
+ [contentType: string]: UUID;
30
32
  };
31
- };
33
+ links?: {
34
+ [link: string]: UUID;
35
+ };
36
+ }) | (RefObject & {
37
+ $ref: UUID;
38
+ });
39
+ export type HeaderObject = OpenAPIV3.HeaderObject | OpenAPIV3_1.HeaderObject;
40
+ export type HeaderOrRefObject = HeaderObject | RefObject;
41
+ export type HeaderOrRef = (HeaderObject & {
42
+ schema?: UUID;
43
+ examples?: {
44
+ [name: string]: UUID;
45
+ };
46
+ content?: {
47
+ [contentType: string]: UUID;
48
+ };
49
+ }) | (RefObject & {
50
+ $ref: UUID;
51
+ });
32
52
  export type ParameterObject = OpenAPIV3.ParameterObject | OpenAPIV3_1.ParameterObject;
33
- export type Parameter = ParameterObject & {
34
- type: 'parameter';
53
+ export type ParameterOrRefObject = ParameterObject | RefObject;
54
+ export type ParameterOrRef = (ParameterObject & {
35
55
  schema?: UUID;
36
56
  examples?: {
37
- [media: string]: UUID;
57
+ [name: string]: UUID;
38
58
  };
39
59
  content?: {
40
- [media: string]: UUID;
60
+ [contentType: string]: UUID;
41
61
  };
42
- };
62
+ }) | (RefObject & {
63
+ $ref: UUID;
64
+ });
43
65
  export type MediaObject = OpenAPIV3.MediaTypeObject | OpenAPIV3_1.MediaTypeObject;
44
66
  export type Media = MediaObject & {
45
- type: 'media';
46
67
  schema?: UUID;
47
68
  examples?: {
48
- [media: string]: UUID;
69
+ [name: string]: UUID;
49
70
  };
50
71
  encoding?: {
51
72
  [encoding: string]: UUID;
52
73
  };
53
74
  };
54
- export type EncodingObject = OpenAPIV3.EncodingObject | OpenAPIV3_1.EncodingObject;
55
- export type Encoding = EncodingObject & {
56
- type: 'encoding';
57
- headers?: {
58
- [header: string]: UUID;
59
- };
60
- };
61
75
  export type ExampleObject = OpenAPIV3.ExampleObject | OpenAPIV3_1.ExampleObject;
62
- export type Example = ExampleObject & {
63
- type: 'example';
64
- };
76
+ export type ExampleOrRefObject = ExampleObject | RefObject;
77
+ export type ExampleOrRef = ExampleObject | (RefObject & {
78
+ $ref: UUID;
79
+ });
65
80
  export type RequestBodyObject = OpenAPIV3.RequestBodyObject | OpenAPIV3_1.RequestBodyObject;
66
- export type RequestBody = RequestBodyObject & {
67
- type: 'requestBody';
81
+ export type RequestBodyOrRefObject = RequestBodyObject | RefObject;
82
+ export type RequestBodyOrRef = (RequestBodyObject & {
68
83
  content?: {
69
- [media: string]: UUID;
84
+ [contentType: string]: UUID;
70
85
  };
71
- };
86
+ }) | (RefObject & {
87
+ $ref: UUID;
88
+ });
72
89
  export type SecuritySchemeObject = OpenAPIV3.SecuritySchemeObject | OpenAPIV3_1.SecuritySchemeObject;
73
- export type SecurityScheme = SecuritySchemeObject & {
74
- type: 'securityScheme';
75
- };
90
+ export type SecuritySchemeOrRefObject = SecuritySchemeObject | RefObject;
91
+ export type SecuritySchemeOrRef = SecuritySchemeObject | (RefObject & {
92
+ $ref: UUID;
93
+ });
76
94
  export type ServerObject = OpenAPIV3.ServerObject | OpenAPIV3_1.ServerObject;
77
- export type Server = ServerObject & {
78
- type: 'server';
79
- };
95
+ export type Server = ServerObject;
80
96
  export type PathObject = OpenAPIV3.PathItemObject | OpenAPIV3_1.PathItemObject;
81
97
  export type Path = PathObject & {
82
- type: 'path';
83
98
  pattern: string;
84
99
  parameters?: UUID[];
85
100
  } & {
@@ -95,7 +110,6 @@ export type OperationExtensions = {
95
110
  'x-code-samples'?: string[];
96
111
  };
97
112
  export type Operation = OperationObject & {
98
- type: 'operation';
99
113
  parameters?: UUID[];
100
114
  requestBody?: UUID;
101
115
  responses?: {
@@ -108,12 +122,9 @@ export type Operation = OperationObject & {
108
122
  servers?: UUID[];
109
123
  } & OperationExtensions;
110
124
  export type SecurityRequirementObject = OpenAPIV3.SecurityRequirementObject | OpenAPIV3_1.SecurityRequirementObject;
111
- export type SecurityRequirement = SecurityRequirementObject & {
112
- type: 'securityRequirement';
113
- };
125
+ export type SecurityRequirement = SecurityRequirementObject;
114
126
  export type DocumentObject = OpenAPIV3.Document | OpenAPIV3_1.Document;
115
127
  export type Document = DocumentObject & {
116
- type: 'document';
117
128
  servers?: UUID[];
118
129
  paths?: UUID[];
119
130
  webhooks?: UUID[];