@mintlify/validation 0.1.29 → 0.1.31

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.
@@ -0,0 +1,33 @@
1
+ /*!
2
+ * decimal.js v10.4.3
3
+ * An arbitrary-precision Decimal type for JavaScript.
4
+ * https://github.com/MikeMcl/decimal.js
5
+ * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
6
+ * MIT Licence
7
+ */
8
+
9
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
10
+
11
+ /**
12
+ * @license
13
+ * Lodash <https://lodash.com/>
14
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
15
+ * Released under MIT license <https://lodash.com/license>
16
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
17
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
18
+ */
19
+
20
+ /**
21
+ * @license Complex.js v2.1.1 12/05/2020
22
+ *
23
+ * Copyright (c) 2020, Robert Eisele (robert@xarg.org)
24
+ * Dual licensed under the MIT or GPL Version 2 licenses.
25
+ **/
26
+
27
+ /**
28
+ * @license Fraction.js v4.2.0 05/03/2022
29
+ * https://www.xarg.org/2014/03/rational-numbers-in-javascript/
30
+ *
31
+ * Copyright (c) 2021, Robert Eisele (robert@xarg.org)
32
+ * Dual licensed under the MIT or GPL Version 2 licenses.
33
+ **/
@@ -63,16 +63,15 @@ export type ResponseSchema = {
63
63
  [code: string]: BodySchema;
64
64
  };
65
65
  export type DataSchemaArray = [DataSchema, ...DataSchema[]];
66
- export declare const typeList: readonly ["boolean", "string", "number", "integer", "object", "array", "stringEnum", "numberEnum", "integerEnum"];
66
+ export declare const typeList: readonly ["boolean", "string", "number", "integer", "object", "array", "stringEnum", "numberEnum", "integerEnum", "null"];
67
67
  export type SchemaType = typeof typeList[number];
68
- export type DataSchema = BooleanSchema | StringSchema | NumberSchema | ObjectSchema | ArraySchema | StringEnumSchema | NumberEnumSchema;
68
+ export type DataSchema = BooleanSchema | StringSchema | NumberSchema | ObjectSchema | ArraySchema | StringEnumSchema | NumberEnumSchema | NullSchema;
69
69
  export type BaseSchema<T> = {
70
70
  type: SchemaType;
71
71
  title?: string;
72
72
  description?: string;
73
73
  default?: T;
74
74
  example?: T;
75
- nullable?: boolean;
76
75
  required?: boolean;
77
76
  readOnly?: boolean;
78
77
  writeOnly?: boolean;
@@ -120,4 +119,7 @@ export type NumberEnumSchema = {
120
119
  type: 'numberEnum' | 'integerEnum';
121
120
  enum: number[];
122
121
  } & BaseSchema<number>;
122
+ export type NullSchema = {
123
+ type: 'null';
124
+ } & BaseSchema<null>;
123
125
  export {};
@@ -1,34 +1,43 @@
1
- import { OpenAPIV3 } from 'openapi-types';
1
+ import { OpenAPIV3_1 } from 'openapi-types';
2
2
  import type { BodySchema, DataSchemaArray, Endpoint, HttpMethod, ParameterSections, ResponseSchema, SecurityOption, Server } from '../types/endpoint';
3
- type ConvertServersParams = OpenAPIV3.ServerObject[] | undefined;
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;
4
13
  type ConvertServersType = Server[] | undefined;
5
14
  export declare const convertServers: (servers: ConvertServersParams) => ConvertServersType;
6
15
  type ConvertParametersParams = {
7
- pathParameters?: OpenAPIV3.ParameterObject[];
8
- operationParameters?: OpenAPIV3.ParameterObject[];
16
+ pathParameters?: OpenAPIV3_1.ParameterObject[];
17
+ operationParameters?: OpenAPIV3_1.ParameterObject[];
9
18
  };
10
19
  export declare const convertParameters: ({ pathParameters, operationParameters, }: ConvertParametersParams) => ParameterSections;
11
- export declare const convertSchema: (schema?: OpenAPIV3.SchemaObject, required?: boolean) => DataSchemaArray;
12
- export declare const combineTopLevelSchemas: (schema1: OpenAPIV3.SchemaObject, schema2: OpenAPIV3.SchemaObject) => OpenAPIV3.SchemaObject;
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;
13
22
  export declare const convertProperties: (properties?: {
14
- [key: string]: OpenAPIV3.SchemaObject;
23
+ [key: string]: OpenAPIV3_1.SchemaObject;
15
24
  } | undefined, required?: string[]) => {
16
25
  [key: string]: DataSchemaArray;
17
26
  };
18
27
  type ConvertSecurityParams = {
19
- securityRequirements?: OpenAPIV3.SecurityRequirementObject[];
20
- securitySchemes: OpenAPIV3.ComponentsObject['securitySchemes'];
28
+ securityRequirements?: OpenAPIV3_1.SecurityRequirementObject[];
29
+ securitySchemes: OpenAPIV3_1.ComponentsObject['securitySchemes'];
21
30
  };
22
31
  export declare const convertSecurity: ({ securityRequirements, securitySchemes, }: ConvertSecurityParams) => SecurityOption[];
23
32
  type AddSecurityParametersParams = {
24
- securityScheme: OpenAPIV3.SecuritySchemeObject;
33
+ securityScheme: OpenAPIV3_1.SecuritySchemeObject;
25
34
  parameterSections: SecurityOption;
26
35
  };
27
36
  export declare const addSecurityParameters: ({ securityScheme, parameterSections, }: AddSecurityParametersParams) => void;
28
- export declare const convertBody: (body?: OpenAPIV3.RequestBodyObject) => BodySchema;
29
- export declare const convertResponses: (responses: OpenAPIV3.ResponsesObject) => ResponseSchema;
30
- export declare const convertResponse: (response: OpenAPIV3.ResponseObject) => {
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) => {
31
40
  [contentType: string]: DataSchemaArray;
32
41
  };
33
- export declare const convertOpenAPIV3ToEndpoint: (spec: OpenAPIV3.Document, path: string, method: HttpMethod) => Endpoint | undefined;
42
+ export declare const convertOpenAPIV3_1ToEndpoint: (spec: OpenAPIV3_1.Document, path: string, method: HttpMethod) => Endpoint | undefined;
34
43
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/validation",
3
- "version": "0.1.29",
3
+ "version": "0.1.31",
4
4
  "description": "Validates mint.json files",
5
5
  "author": "Mintlify, Inc.",
6
6
  "repository": {
@@ -68,5 +68,5 @@
68
68
  "webpack": "^5.75.0",
69
69
  "webpack-cli": "^5.0.1"
70
70
  },
71
- "gitHead": "a68d3d4f994f666a683237611ac40fdddfd365d6"
71
+ "gitHead": "9a666a6dfb5214b9a2490ef11930354a3af3bb04"
72
72
  }