@redocly/openapi-core 1.3.0 → 1.4.0
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/CHANGELOG.md +6 -0
- package/lib/benchmark/benches/lint-with-many-rules.bench.js +4 -4
- package/lib/benchmark/benches/lint-with-nested-rule.bench.js +4 -4
- package/lib/benchmark/benches/lint-with-no-rules.bench.js +4 -4
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.js +4 -4
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.js +4 -4
- package/lib/benchmark/benches/recommended-oas3.bench.js +4 -4
- package/lib/benchmark/benches/resolve-with-no-external.bench.js +3 -3
- package/lib/benchmark/utils.js +3 -3
- package/lib/bundle.d.ts +4 -4
- package/lib/bundle.js +23 -23
- package/lib/config/all.d.ts +2 -2
- package/lib/config/all.js +44 -8
- package/lib/config/builtIn.js +2 -0
- package/lib/config/config-resolvers.js +25 -25
- package/lib/config/config.js +9 -9
- package/lib/config/index.js +5 -1
- package/lib/config/load.d.ts +1 -1
- package/lib/config/load.js +6 -6
- package/lib/config/minimal.d.ts +2 -2
- package/lib/config/minimal.js +34 -3
- package/lib/config/recommended-strict.d.ts +3 -0
- package/lib/config/recommended-strict.js +92 -0
- package/lib/config/recommended.d.ts +2 -2
- package/lib/config/recommended.js +34 -3
- package/lib/config/rules.d.ts +1 -1
- package/lib/config/types.d.ts +47 -46
- package/lib/config/types.js +2 -2
- package/lib/config/utils.js +26 -14
- package/lib/decorators/common/filters/filter-helper.js +4 -4
- package/lib/decorators/common/filters/filter-in.js +2 -2
- package/lib/decorators/common/filters/filter-out.js +2 -2
- package/lib/decorators/common/info-description-override.js +1 -1
- package/lib/decorators/common/media-type-examples-override.js +3 -3
- package/lib/decorators/common/operation-description-override.js +1 -1
- package/lib/decorators/common/registry-dependencies.js +1 -1
- package/lib/decorators/common/remove-x-internal.js +4 -4
- package/lib/decorators/common/tag-description-override.js +1 -1
- package/lib/format/codeframes.d.ts +6 -6
- package/lib/format/format.d.ts +2 -2
- package/lib/format/format.js +12 -12
- package/lib/js-yaml/index.d.ts +2 -2
- package/lib/js-yaml/index.js +2 -2
- package/lib/lint.js +18 -18
- package/lib/oas-types.d.ts +12 -10
- package/lib/oas-types.js +2 -2
- package/lib/redocly/index.js +10 -10
- package/lib/redocly/registry-api.js +2 -2
- package/lib/resolve.d.ts +4 -4
- package/lib/resolve.js +18 -18
- package/lib/rules/ajv.js +1 -1
- package/lib/rules/async2/index.d.ts +2 -11
- package/lib/rules/common/assertions/asserts.d.ts +3 -3
- package/lib/rules/common/assertions/asserts.js +21 -21
- package/lib/rules/common/assertions/index.d.ts +4 -4
- package/lib/rules/common/assertions/index.js +3 -3
- package/lib/rules/common/assertions/utils.d.ts +4 -4
- package/lib/rules/common/assertions/utils.js +3 -3
- package/lib/rules/common/info-contact.js +1 -1
- package/lib/rules/common/info-license-url.js +1 -1
- package/lib/rules/common/info-license.js +1 -1
- package/lib/rules/common/no-enum-type-mismatch.js +3 -3
- package/lib/rules/common/no-http-verbs-in-paths.js +2 -2
- package/lib/rules/common/no-invalid-parameter-examples.js +3 -3
- package/lib/rules/common/no-invalid-schema-examples.js +3 -3
- package/lib/rules/common/operation-2xx-response.js +2 -2
- package/lib/rules/common/operation-4xx-response.js +2 -2
- package/lib/rules/common/operation-description.js +1 -1
- package/lib/rules/common/operation-operationId.js +1 -1
- package/lib/rules/common/operation-summary.js +1 -1
- package/lib/rules/common/path-segment-plural.js +1 -1
- package/lib/rules/common/response-contains-header.js +2 -2
- package/lib/rules/common/spec-strict-refs.js +1 -1
- package/lib/rules/common/spec.js +11 -11
- package/lib/rules/common/tag-description.js +1 -1
- package/lib/rules/oas2/boolean-parameter-prefixes.d.ts +1 -1
- package/lib/rules/oas2/index.d.ts +2 -46
- package/lib/rules/oas2/remove-unused-components.js +1 -1
- package/lib/rules/oas2/request-mime-type.js +2 -2
- package/lib/rules/oas2/response-contains-property.js +2 -2
- package/lib/rules/oas2/response-mime-type.js +2 -2
- package/lib/rules/oas3/boolean-parameter-prefixes.d.ts +1 -1
- package/lib/rules/oas3/index.d.ts +1 -1
- package/lib/rules/oas3/index.js +1 -1
- package/lib/rules/oas3/no-invalid-media-type-examples.js +3 -3
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +3 -3
- package/lib/rules/oas3/remove-unused-components.js +2 -2
- package/lib/rules/oas3/request-mime-type.js +3 -3
- package/lib/rules/oas3/response-contains-property.js +2 -2
- package/lib/rules/oas3/response-mime-type.js +3 -3
- package/lib/rules/utils.js +3 -3
- package/lib/types/asyncapi.js +21 -21
- package/lib/types/index.d.ts +8 -8
- package/lib/types/oas2.js +14 -14
- package/lib/types/oas3.js +27 -27
- package/lib/types/oas3_1.js +6 -6
- package/lib/types/redocly-yaml.d.ts +11 -0
- package/lib/types/redocly-yaml.js +71 -53
- package/lib/types/theme-config.js +1 -1
- package/lib/typings/common.d.ts +2 -2
- package/lib/typings/openapi.d.ts +6 -6
- package/lib/typings/swagger.d.ts +3 -3
- package/lib/utils.d.ts +5 -5
- package/lib/utils.js +3 -3
- package/lib/visitors.d.ts +40 -40
- package/lib/walk.d.ts +14 -15
- package/lib/walk.js +11 -11
- package/package.json +2 -2
- package/src/__tests__/lint.test.ts +40 -40
- package/src/__tests__/normalizeVisitors.test.ts +23 -5
- package/src/__tests__/ref-utils.test.ts +7 -7
- package/src/__tests__/resolve-http.test.ts +10 -10
- package/src/__tests__/resolve.test.ts +39 -39
- package/src/__tests__/walk.test.ts +48 -48
- package/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +95 -32
- package/src/config/__tests__/__snapshots__/config.test.ts.snap +81 -81
- package/src/config/__tests__/config-resolvers.test.ts +30 -1
- package/src/config/__tests__/config.test.ts +88 -88
- package/src/config/__tests__/load.test.ts +12 -8
- package/src/config/__tests__/utils.test.ts +18 -18
- package/src/config/all.ts +46 -9
- package/src/config/builtIn.ts +2 -0
- package/src/config/minimal.ts +36 -4
- package/src/config/recommended-strict.ts +93 -0
- package/src/config/recommended.ts +36 -4
- package/src/config/types.ts +22 -8
- package/src/config/utils.ts +15 -0
- package/src/decorators/common/media-type-examples-override.ts +2 -2
- package/src/lint.ts +3 -3
- package/src/oas-types.ts +26 -3
- package/src/rules/__tests__/no-unresolved-refs.test.ts +26 -26
- package/src/rules/async2/__tests__/channels-kebab-case.test.ts +12 -12
- package/src/rules/async2/__tests__/no-channel-trailing-slash.test.ts +7 -7
- package/src/rules/async2/index.ts +2 -1
- package/src/rules/common/__tests__/info-license.test.ts +6 -6
- package/src/rules/common/__tests__/license-url.test.ts +6 -6
- package/src/rules/common/__tests__/no-ambiguous-paths.test.ts +13 -13
- package/src/rules/common/__tests__/no-enum-type-mismatch.test.ts +18 -18
- package/src/rules/common/__tests__/no-identical-paths.test.ts +5 -5
- package/src/rules/common/__tests__/no-path-trailing-slash.test.ts +12 -12
- package/src/rules/common/__tests__/operation-2xx-response.test.ts +18 -18
- package/src/rules/common/__tests__/operation-4xx-response.test.ts +23 -23
- package/src/rules/common/__tests__/operation-operationId-unique.test.ts +6 -6
- package/src/rules/common/__tests__/operation-operationId-url-safe.test.ts +5 -5
- package/src/rules/common/__tests__/operation-parameters-unique.test.ts +16 -16
- package/src/rules/common/__tests__/operation-singular-tag.test.ts +6 -6
- package/src/rules/common/__tests__/path-http-verbs-order.test.ts +10 -10
- package/src/rules/common/__tests__/path-not-include-query.test.ts +6 -6
- package/src/rules/common/__tests__/path-params-defined.test.ts +21 -21
- package/src/rules/common/__tests__/paths-kebab-case.test.ts +11 -11
- package/src/rules/common/__tests__/scalar-property-missing-example.test.ts +18 -18
- package/src/rules/common/__tests__/security-defined.test.ts +21 -21
- package/src/rules/common/__tests__/spec-strict-refs.test.ts +9 -9
- package/src/rules/common/__tests__/spec.test.ts +102 -102
- package/src/rules/common/__tests__/tag-description.test.ts +6 -6
- package/src/rules/common/__tests__/tags-alphabetical.test.ts +12 -12
- package/src/rules/common/assertions/__tests__/index.test.ts +15 -15
- package/src/rules/common/assertions/__tests__/utils.test.ts +9 -9
- package/src/rules/oas2/__tests__/boolean-parameter-prefixes.test.ts +7 -7
- package/src/rules/oas2/__tests__/response-contains-header.test.ts +13 -13
- package/src/rules/oas2/__tests__/response-contains-property.test.ts +8 -8
- package/src/rules/oas2/__tests__/spec/info.test.ts +21 -21
- package/src/rules/oas2/__tests__/spec/operation.test.ts +4 -4
- package/src/rules/oas2/__tests__/spec/paths.test.ts +12 -12
- package/src/rules/oas2/__tests__/spec/referenceableScalars.test.ts +1 -1
- package/src/rules/oas2/index.ts +3 -1
- package/src/rules/oas3/__tests__/boolean-parameter-prefixes.test.ts +7 -7
- package/src/rules/oas3/__tests__/component-name-unique.test.ts +186 -186
- package/src/rules/oas3/__tests__/no-empty-enum-servers.com.test.ts +18 -18
- package/src/rules/oas3/__tests__/no-example-value-and-externalValue.test.ts +6 -6
- package/src/rules/oas3/__tests__/no-invalid-media-type-examples.test.ts +36 -36
- package/src/rules/oas3/__tests__/no-server-example.com.test.ts +11 -11
- package/src/rules/oas3/__tests__/no-server-trailing-slash.test.ts +7 -7
- package/src/rules/oas3/__tests__/no-unused-components.test.ts +31 -31
- package/src/rules/oas3/__tests__/operation-4xx-problem-details-rfc7807.test.ts +15 -15
- package/src/rules/oas3/__tests__/response-contains-header.test.ts +26 -26
- package/src/rules/oas3/__tests__/response-contains-property.test.ts +27 -27
- package/src/rules/oas3/__tests__/spec/callbacks.test.ts +1 -1
- package/src/rules/oas3/__tests__/spec/info.test.ts +21 -21
- package/src/rules/oas3/__tests__/spec/operation.test.ts +10 -10
- package/src/rules/oas3/__tests__/spec/paths.test.ts +13 -13
- package/src/rules/oas3/__tests__/spec/referenceableScalars.test.ts +2 -2
- package/src/rules/oas3/__tests__/spec/servers.test.ts +25 -25
- package/src/rules/oas3/__tests__/spec/spec.test.ts +56 -56
- package/src/rules/oas3/__tests__/spec-components-invalid-map-name.test.ts +28 -28
- package/src/rules/oas3/index.ts +3 -3
- package/src/types/redocly-yaml.ts +75 -40
- package/src/visitors.ts +3 -3
- package/src/walk.ts +23 -10
- package/tsconfig.tsbuildinfo +1 -1
package/lib/types/asyncapi.js
CHANGED
|
@@ -351,15 +351,15 @@ const Schema = {
|
|
|
351
351
|
};
|
|
352
352
|
}
|
|
353
353
|
},
|
|
354
|
-
allOf: _1.listOf('Schema'),
|
|
355
|
-
anyOf: _1.listOf('Schema'),
|
|
356
|
-
oneOf: _1.listOf('Schema'),
|
|
354
|
+
allOf: (0, _1.listOf)('Schema'),
|
|
355
|
+
anyOf: (0, _1.listOf)('Schema'),
|
|
356
|
+
oneOf: (0, _1.listOf)('Schema'),
|
|
357
357
|
not: 'Schema',
|
|
358
358
|
if: 'Schema',
|
|
359
359
|
then: 'Schema',
|
|
360
360
|
else: 'Schema',
|
|
361
|
-
dependentSchemas: _1.listOf('Schema'),
|
|
362
|
-
prefixItems: _1.listOf('Schema'),
|
|
361
|
+
dependentSchemas: (0, _1.listOf)('Schema'),
|
|
362
|
+
prefixItems: (0, _1.listOf)('Schema'),
|
|
363
363
|
contains: 'Schema',
|
|
364
364
|
minContains: { type: 'integer', minimum: 0 },
|
|
365
365
|
maxContains: { type: 'integer', minimum: 0 },
|
|
@@ -422,7 +422,7 @@ const SchemaProperties = {
|
|
|
422
422
|
const DiscriminatorMapping = {
|
|
423
423
|
properties: {},
|
|
424
424
|
additionalProperties: (value) => {
|
|
425
|
-
if (ref_utils_1.isMappingRef(value)) {
|
|
425
|
+
if ((0, ref_utils_1.isMappingRef)(value)) {
|
|
426
426
|
return { type: 'string', directResolveAs: 'Schema' };
|
|
427
427
|
}
|
|
428
428
|
else {
|
|
@@ -863,7 +863,7 @@ const SolaceDestination = {
|
|
|
863
863
|
const SolaceOperationBinding = {
|
|
864
864
|
properties: {
|
|
865
865
|
bindingVersion: { type: 'string' },
|
|
866
|
-
destinations: _1.listOf('SolaceDestination'),
|
|
866
|
+
destinations: (0, _1.listOf)('SolaceDestination'),
|
|
867
867
|
},
|
|
868
868
|
};
|
|
869
869
|
OperationBindings.properties.solace = SolaceOperationBinding;
|
|
@@ -926,14 +926,14 @@ OperationBindings.properties.mercure = MercureOperationBinding;
|
|
|
926
926
|
exports.AsyncApi2Types = {
|
|
927
927
|
Root,
|
|
928
928
|
Tag,
|
|
929
|
-
TagList: _1.listOf('Tag'),
|
|
929
|
+
TagList: (0, _1.listOf)('Tag'),
|
|
930
930
|
ServerMap,
|
|
931
931
|
ExternalDocs,
|
|
932
932
|
Server,
|
|
933
933
|
ServerVariable,
|
|
934
|
-
ServerVariablesMap: _1.mapOf('ServerVariable'),
|
|
934
|
+
ServerVariablesMap: (0, _1.mapOf)('ServerVariable'),
|
|
935
935
|
SecurityRequirement,
|
|
936
|
-
SecurityRequirementList: _1.listOf('SecurityRequirement'),
|
|
936
|
+
SecurityRequirementList: (0, _1.listOf)('SecurityRequirement'),
|
|
937
937
|
Info,
|
|
938
938
|
Contact,
|
|
939
939
|
License,
|
|
@@ -1001,7 +1001,7 @@ exports.AsyncApi2Types = {
|
|
|
1001
1001
|
ChannelMap,
|
|
1002
1002
|
Channel,
|
|
1003
1003
|
Parameter,
|
|
1004
|
-
ParametersMap: _1.mapOf('Parameter'),
|
|
1004
|
+
ParametersMap: (0, _1.mapOf)('Parameter'),
|
|
1005
1005
|
Operation,
|
|
1006
1006
|
Schema,
|
|
1007
1007
|
MessageExample,
|
|
@@ -1009,14 +1009,14 @@ exports.AsyncApi2Types = {
|
|
|
1009
1009
|
DiscriminatorMapping,
|
|
1010
1010
|
Discriminator,
|
|
1011
1011
|
Components,
|
|
1012
|
-
NamedSchemas: _1.mapOf('Schema'),
|
|
1013
|
-
NamedMessages: _1.mapOf('Message'),
|
|
1014
|
-
NamedMessageTraits: _1.mapOf('MessageTrait'),
|
|
1015
|
-
NamedOperationTraits: _1.mapOf('OperationTrait'),
|
|
1016
|
-
NamedParameters: _1.mapOf('Parameter'),
|
|
1017
|
-
NamedSecuritySchemes: _1.mapOf('SecurityScheme'),
|
|
1018
|
-
NamedCorrelationIds: _1.mapOf('CorrelationId'),
|
|
1019
|
-
NamedStreamHeaders: _1.mapOf('StreamHeader'),
|
|
1012
|
+
NamedSchemas: (0, _1.mapOf)('Schema'),
|
|
1013
|
+
NamedMessages: (0, _1.mapOf)('Message'),
|
|
1014
|
+
NamedMessageTraits: (0, _1.mapOf)('MessageTrait'),
|
|
1015
|
+
NamedOperationTraits: (0, _1.mapOf)('OperationTrait'),
|
|
1016
|
+
NamedParameters: (0, _1.mapOf)('Parameter'),
|
|
1017
|
+
NamedSecuritySchemes: (0, _1.mapOf)('SecurityScheme'),
|
|
1018
|
+
NamedCorrelationIds: (0, _1.mapOf)('CorrelationId'),
|
|
1019
|
+
NamedStreamHeaders: (0, _1.mapOf)('StreamHeader'),
|
|
1020
1020
|
ImplicitFlow,
|
|
1021
1021
|
PasswordFlow,
|
|
1022
1022
|
ClientCredentials,
|
|
@@ -1027,8 +1027,8 @@ exports.AsyncApi2Types = {
|
|
|
1027
1027
|
MessageBindings,
|
|
1028
1028
|
OperationBindings,
|
|
1029
1029
|
OperationTrait,
|
|
1030
|
-
OperationTraitList: _1.listOf('OperationTrait'),
|
|
1030
|
+
OperationTraitList: (0, _1.listOf)('OperationTrait'),
|
|
1031
1031
|
MessageTrait,
|
|
1032
|
-
MessageTraitList: _1.listOf('MessageTrait'),
|
|
1032
|
+
MessageTraitList: (0, _1.listOf)('MessageTrait'),
|
|
1033
1033
|
CorrelationId,
|
|
1034
1034
|
};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ScalarSchema = {
|
|
2
2
|
name?: never;
|
|
3
3
|
type?: 'string' | 'boolean' | 'number' | 'integer' | 'object' | 'array';
|
|
4
4
|
items?: ScalarSchema;
|
|
@@ -7,7 +7,7 @@ export declare type ScalarSchema = {
|
|
|
7
7
|
directResolveAs?: string;
|
|
8
8
|
minimum?: number;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type NormalizedScalarSchema = {
|
|
11
11
|
name?: never;
|
|
12
12
|
type?: 'string' | 'boolean' | 'number' | 'integer' | 'object' | 'array';
|
|
13
13
|
items?: ScalarSchema;
|
|
@@ -16,7 +16,7 @@ export declare type NormalizedScalarSchema = {
|
|
|
16
16
|
resolvable: boolean;
|
|
17
17
|
minimum?: number;
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type NodeType = {
|
|
20
20
|
properties: Record<string, PropType | ResolveTypeFn>;
|
|
21
21
|
additionalProperties?: PropType | ResolveTypeFn;
|
|
22
22
|
items?: string;
|
|
@@ -25,9 +25,9 @@ export declare type NodeType = {
|
|
|
25
25
|
allowed?: (value: any) => string[] | undefined;
|
|
26
26
|
extensionsPrefix?: string;
|
|
27
27
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export
|
|
28
|
+
type PropType = string | NodeType | ScalarSchema | undefined | null;
|
|
29
|
+
type ResolveTypeFn = (value: any, key: string) => string | PropType;
|
|
30
|
+
export type NormalizedNodeType = {
|
|
31
31
|
name: string;
|
|
32
32
|
properties: Record<string, NormalizedPropType | NormalizedResolveTypeFn>;
|
|
33
33
|
additionalProperties?: NormalizedPropType | NormalizedResolveTypeFn;
|
|
@@ -37,8 +37,8 @@ export declare type NormalizedNodeType = {
|
|
|
37
37
|
allowed?: (value: any) => string[] | undefined;
|
|
38
38
|
extensionsPrefix?: string;
|
|
39
39
|
};
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
type NormalizedPropType = NormalizedNodeType | NormalizedScalarSchema | undefined | null;
|
|
41
|
+
type NormalizedResolveTypeFn = (value: any, key: string) => NormalizedNodeType | NormalizedScalarSchema | undefined | null;
|
|
42
42
|
export declare function listOf(typeName: string): {
|
|
43
43
|
name: string;
|
|
44
44
|
properties: {};
|
package/lib/types/oas2.js
CHANGED
|
@@ -212,7 +212,7 @@ const Response = {
|
|
|
212
212
|
properties: {
|
|
213
213
|
description: { type: 'string' },
|
|
214
214
|
schema: 'Schema',
|
|
215
|
-
headers: _1.mapOf('Header'),
|
|
215
|
+
headers: (0, _1.mapOf)('Header'),
|
|
216
216
|
examples: 'Examples',
|
|
217
217
|
'x-summary': { type: 'string' },
|
|
218
218
|
},
|
|
@@ -298,13 +298,13 @@ const Schema = {
|
|
|
298
298
|
},
|
|
299
299
|
items: (value) => {
|
|
300
300
|
if (Array.isArray(value)) {
|
|
301
|
-
return _1.listOf('Schema');
|
|
301
|
+
return (0, _1.listOf)('Schema');
|
|
302
302
|
}
|
|
303
303
|
else {
|
|
304
304
|
return 'Schema';
|
|
305
305
|
}
|
|
306
306
|
},
|
|
307
|
-
allOf: _1.listOf('Schema'),
|
|
307
|
+
allOf: (0, _1.listOf)('Schema'),
|
|
308
308
|
properties: 'SchemaProperties',
|
|
309
309
|
additionalProperties: (value) => {
|
|
310
310
|
if (typeof value === 'boolean') {
|
|
@@ -418,15 +418,15 @@ const Example = {
|
|
|
418
418
|
exports.Oas2Types = {
|
|
419
419
|
Root,
|
|
420
420
|
Tag,
|
|
421
|
-
TagList: _1.listOf('Tag'),
|
|
422
|
-
TagGroups: _1.listOf('TagGroup'),
|
|
421
|
+
TagList: (0, _1.listOf)('Tag'),
|
|
422
|
+
TagGroups: (0, _1.listOf)('TagGroup'),
|
|
423
423
|
TagGroup,
|
|
424
424
|
ExternalDocs,
|
|
425
425
|
Example,
|
|
426
|
-
ExamplesMap: _1.mapOf('Example'),
|
|
426
|
+
ExamplesMap: (0, _1.mapOf)('Example'),
|
|
427
427
|
EnumDescriptions,
|
|
428
428
|
SecurityRequirement,
|
|
429
|
-
SecurityRequirementList: _1.listOf('SecurityRequirement'),
|
|
429
|
+
SecurityRequirementList: (0, _1.listOf)('SecurityRequirement'),
|
|
430
430
|
Info,
|
|
431
431
|
Contact,
|
|
432
432
|
License,
|
|
@@ -435,7 +435,7 @@ exports.Oas2Types = {
|
|
|
435
435
|
PathItem,
|
|
436
436
|
Parameter,
|
|
437
437
|
ParameterItems,
|
|
438
|
-
ParameterList: _1.listOf('Parameter'),
|
|
438
|
+
ParameterList: (0, _1.listOf)('Parameter'),
|
|
439
439
|
Operation,
|
|
440
440
|
Examples,
|
|
441
441
|
Header,
|
|
@@ -444,13 +444,13 @@ exports.Oas2Types = {
|
|
|
444
444
|
Schema,
|
|
445
445
|
Xml,
|
|
446
446
|
SchemaProperties,
|
|
447
|
-
NamedSchemas: _1.mapOf('Schema'),
|
|
448
|
-
NamedResponses: _1.mapOf('Response'),
|
|
449
|
-
NamedParameters: _1.mapOf('Parameter'),
|
|
450
|
-
NamedSecuritySchemes: _1.mapOf('SecurityScheme'),
|
|
447
|
+
NamedSchemas: (0, _1.mapOf)('Schema'),
|
|
448
|
+
NamedResponses: (0, _1.mapOf)('Response'),
|
|
449
|
+
NamedParameters: (0, _1.mapOf)('Parameter'),
|
|
450
|
+
NamedSecuritySchemes: (0, _1.mapOf)('SecurityScheme'),
|
|
451
451
|
SecurityScheme,
|
|
452
452
|
XCodeSample,
|
|
453
|
-
XCodeSampleList: _1.listOf('XCodeSample'),
|
|
454
|
-
XServerList: _1.listOf('XServer'),
|
|
453
|
+
XCodeSampleList: (0, _1.listOf)('XCodeSample'),
|
|
454
|
+
XServerList: (0, _1.listOf)('XServer'),
|
|
455
455
|
XServer,
|
|
456
456
|
};
|
package/lib/types/oas3.js
CHANGED
|
@@ -303,14 +303,14 @@ const Schema = {
|
|
|
303
303
|
type: {
|
|
304
304
|
enum: ['object', 'array', 'string', 'number', 'integer', 'boolean', 'null'],
|
|
305
305
|
},
|
|
306
|
-
allOf: _1.listOf('Schema'),
|
|
307
|
-
anyOf: _1.listOf('Schema'),
|
|
308
|
-
oneOf: _1.listOf('Schema'),
|
|
306
|
+
allOf: (0, _1.listOf)('Schema'),
|
|
307
|
+
anyOf: (0, _1.listOf)('Schema'),
|
|
308
|
+
oneOf: (0, _1.listOf)('Schema'),
|
|
309
309
|
not: 'Schema',
|
|
310
310
|
properties: 'SchemaProperties',
|
|
311
311
|
items: (value) => {
|
|
312
312
|
if (Array.isArray(value)) {
|
|
313
|
-
return _1.listOf('Schema');
|
|
313
|
+
return (0, _1.listOf)('Schema');
|
|
314
314
|
}
|
|
315
315
|
else {
|
|
316
316
|
return 'Schema';
|
|
@@ -364,7 +364,7 @@ const SchemaProperties = {
|
|
|
364
364
|
const DiscriminatorMapping = {
|
|
365
365
|
properties: {},
|
|
366
366
|
additionalProperties: (value) => {
|
|
367
|
-
if (ref_utils_1.isMappingRef(value)) {
|
|
367
|
+
if ((0, ref_utils_1.isMappingRef)(value)) {
|
|
368
368
|
return { type: 'string', directResolveAs: 'Schema' };
|
|
369
369
|
}
|
|
370
370
|
else {
|
|
@@ -499,36 +499,36 @@ const XUsePkce = {
|
|
|
499
499
|
exports.Oas3Types = {
|
|
500
500
|
Root,
|
|
501
501
|
Tag,
|
|
502
|
-
TagList: _1.listOf('Tag'),
|
|
503
|
-
TagGroups: _1.listOf('TagGroup'),
|
|
502
|
+
TagList: (0, _1.listOf)('Tag'),
|
|
503
|
+
TagGroups: (0, _1.listOf)('TagGroup'),
|
|
504
504
|
TagGroup,
|
|
505
505
|
ExternalDocs,
|
|
506
506
|
Server,
|
|
507
|
-
ServerList: _1.listOf('Server'),
|
|
507
|
+
ServerList: (0, _1.listOf)('Server'),
|
|
508
508
|
ServerVariable,
|
|
509
|
-
ServerVariablesMap: _1.mapOf('ServerVariable'),
|
|
509
|
+
ServerVariablesMap: (0, _1.mapOf)('ServerVariable'),
|
|
510
510
|
SecurityRequirement,
|
|
511
|
-
SecurityRequirementList: _1.listOf('SecurityRequirement'),
|
|
511
|
+
SecurityRequirementList: (0, _1.listOf)('SecurityRequirement'),
|
|
512
512
|
Info,
|
|
513
513
|
Contact,
|
|
514
514
|
License,
|
|
515
515
|
Paths,
|
|
516
516
|
PathItem,
|
|
517
517
|
Parameter,
|
|
518
|
-
ParameterList: _1.listOf('Parameter'),
|
|
518
|
+
ParameterList: (0, _1.listOf)('Parameter'),
|
|
519
519
|
Operation,
|
|
520
|
-
Callback: _1.mapOf('PathItem'),
|
|
521
|
-
CallbacksMap: _1.mapOf('Callback'),
|
|
520
|
+
Callback: (0, _1.mapOf)('PathItem'),
|
|
521
|
+
CallbacksMap: (0, _1.mapOf)('Callback'),
|
|
522
522
|
RequestBody,
|
|
523
523
|
MediaTypesMap,
|
|
524
524
|
MediaType,
|
|
525
525
|
Example,
|
|
526
|
-
ExamplesMap: _1.mapOf('Example'),
|
|
526
|
+
ExamplesMap: (0, _1.mapOf)('Example'),
|
|
527
527
|
Encoding,
|
|
528
|
-
EncodingMap: _1.mapOf('Encoding'),
|
|
528
|
+
EncodingMap: (0, _1.mapOf)('Encoding'),
|
|
529
529
|
EnumDescriptions,
|
|
530
530
|
Header,
|
|
531
|
-
HeadersMap: _1.mapOf('Header'),
|
|
531
|
+
HeadersMap: (0, _1.mapOf)('Header'),
|
|
532
532
|
Responses,
|
|
533
533
|
Response,
|
|
534
534
|
Link,
|
|
@@ -539,16 +539,16 @@ exports.Oas3Types = {
|
|
|
539
539
|
DiscriminatorMapping,
|
|
540
540
|
Discriminator,
|
|
541
541
|
Components,
|
|
542
|
-
LinksMap: _1.mapOf('Link'),
|
|
543
|
-
NamedSchemas: _1.mapOf('Schema'),
|
|
544
|
-
NamedResponses: _1.mapOf('Response'),
|
|
545
|
-
NamedParameters: _1.mapOf('Parameter'),
|
|
546
|
-
NamedExamples: _1.mapOf('Example'),
|
|
547
|
-
NamedRequestBodies: _1.mapOf('RequestBody'),
|
|
548
|
-
NamedHeaders: _1.mapOf('Header'),
|
|
549
|
-
NamedSecuritySchemes: _1.mapOf('SecurityScheme'),
|
|
550
|
-
NamedLinks: _1.mapOf('Link'),
|
|
551
|
-
NamedCallbacks: _1.mapOf('Callback'),
|
|
542
|
+
LinksMap: (0, _1.mapOf)('Link'),
|
|
543
|
+
NamedSchemas: (0, _1.mapOf)('Schema'),
|
|
544
|
+
NamedResponses: (0, _1.mapOf)('Response'),
|
|
545
|
+
NamedParameters: (0, _1.mapOf)('Parameter'),
|
|
546
|
+
NamedExamples: (0, _1.mapOf)('Example'),
|
|
547
|
+
NamedRequestBodies: (0, _1.mapOf)('RequestBody'),
|
|
548
|
+
NamedHeaders: (0, _1.mapOf)('Header'),
|
|
549
|
+
NamedSecuritySchemes: (0, _1.mapOf)('SecurityScheme'),
|
|
550
|
+
NamedLinks: (0, _1.mapOf)('Link'),
|
|
551
|
+
NamedCallbacks: (0, _1.mapOf)('Callback'),
|
|
552
552
|
ImplicitFlow,
|
|
553
553
|
PasswordFlow,
|
|
554
554
|
ClientCredentials,
|
|
@@ -556,7 +556,7 @@ exports.Oas3Types = {
|
|
|
556
556
|
OAuth2Flows,
|
|
557
557
|
SecurityScheme,
|
|
558
558
|
XCodeSample,
|
|
559
|
-
XCodeSampleList: _1.listOf('XCodeSample'),
|
|
559
|
+
XCodeSampleList: (0, _1.listOf)('XCodeSample'),
|
|
560
560
|
XUsePkce,
|
|
561
561
|
WebhooksMap,
|
|
562
562
|
};
|
package/lib/types/oas3_1.js
CHANGED
|
@@ -121,15 +121,15 @@ const Schema = {
|
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
|
-
allOf: _1.listOf('Schema'),
|
|
125
|
-
anyOf: _1.listOf('Schema'),
|
|
126
|
-
oneOf: _1.listOf('Schema'),
|
|
124
|
+
allOf: (0, _1.listOf)('Schema'),
|
|
125
|
+
anyOf: (0, _1.listOf)('Schema'),
|
|
126
|
+
oneOf: (0, _1.listOf)('Schema'),
|
|
127
127
|
not: 'Schema',
|
|
128
128
|
if: 'Schema',
|
|
129
129
|
then: 'Schema',
|
|
130
130
|
else: 'Schema',
|
|
131
|
-
dependentSchemas: _1.listOf('Schema'),
|
|
132
|
-
prefixItems: _1.listOf('Schema'),
|
|
131
|
+
dependentSchemas: (0, _1.listOf)('Schema'),
|
|
132
|
+
prefixItems: (0, _1.listOf)('Schema'),
|
|
133
133
|
contains: 'Schema',
|
|
134
134
|
minContains: { type: 'integer', minimum: 0 },
|
|
135
135
|
maxContains: { type: 'integer', minimum: 0 },
|
|
@@ -254,5 +254,5 @@ exports.Oas3_1Types = Object.assign(Object.assign({}, oas3_1.Oas3Types), { Info,
|
|
|
254
254
|
Root,
|
|
255
255
|
Schema,
|
|
256
256
|
License,
|
|
257
|
-
Components, NamedPathItems: _1.mapOf('PathItem'), SecurityScheme,
|
|
257
|
+
Components, NamedPathItems: (0, _1.mapOf)('PathItem'), SecurityScheme,
|
|
258
258
|
Operation });
|
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
import { NodeType } from '.';
|
|
2
|
+
declare const builtInCommonRules: readonly ["spec", "info-contact", "operation-operationId", "tag-description", "tags-alphabetical"];
|
|
3
|
+
export type BuiltInCommonRuleId = typeof builtInCommonRules[number];
|
|
4
|
+
declare const builtInCommonOASRules: readonly ["info-license-url", "info-license", "no-ambiguous-paths", "no-enum-type-mismatch", "no-http-verbs-in-paths", "no-identical-paths", "no-invalid-parameter-examples", "no-invalid-schema-examples", "no-path-trailing-slash", "operation-2xx-response", "operation-4xx-response", "operation-description", "operation-operationId-unique", "operation-operationId-url-safe", "operation-parameters-unique", "operation-singular-tag", "operation-summary", "operation-tag-defined", "parameter-description", "path-declaration-must-exist", "path-excludes-patterns", "path-http-verbs-order", "path-not-include-query", "path-params-defined", "path-parameters-defined", "path-segment-plural", "paths-kebab-case", "required-string-property-missing-min-length", "response-contains-header", "scalar-property-missing-example", "security-defined", "spec-strict-refs", "no-unresolved-refs"];
|
|
5
|
+
export type BuiltInCommonOASRuleId = typeof builtInCommonOASRules[number];
|
|
6
|
+
declare const builtInOAS2Rules: readonly ["boolean-parameter-prefixes", "request-mime-type", "response-contains-property", "response-mime-type"];
|
|
7
|
+
export type BuiltInOAS2RuleId = typeof builtInOAS2Rules[number];
|
|
8
|
+
declare const builtInOAS3Rules: readonly ["boolean-parameter-prefixes", "component-name-unique", "no-empty-servers", "no-example-value-and-externalValue", "no-invalid-media-type-examples", "no-server-example.com", "no-server-trailing-slash", "no-server-variables-empty-enum", "no-undefined-server-variable", "no-unused-components", "operation-4xx-problem-details-rfc7807", "request-mime-type", "response-contains-property", "response-mime-type", "spec-components-invalid-map-name"];
|
|
9
|
+
export type BuiltInOAS3RuleId = typeof builtInOAS3Rules[number];
|
|
10
|
+
declare const builtInAsync2Rules: readonly ["channels-kebab-case", "no-channel-trailing-slash"];
|
|
11
|
+
export type BuiltInAsync2RuleId = typeof builtInAsync2Rules[number];
|
|
2
12
|
export declare const ConfigTypes: Record<string, NodeType>;
|
|
13
|
+
export {};
|
|
@@ -6,63 +6,78 @@ const theme_config_1 = require("./theme-config");
|
|
|
6
6
|
const _1 = require(".");
|
|
7
7
|
const oas3_1_1 = require("./oas3_1");
|
|
8
8
|
const utils_1 = require("../utils");
|
|
9
|
-
const
|
|
9
|
+
const builtInCommonRules = [
|
|
10
10
|
'spec',
|
|
11
11
|
'info-contact',
|
|
12
|
-
'
|
|
12
|
+
'operation-operationId',
|
|
13
|
+
'tag-description',
|
|
14
|
+
'tags-alphabetical',
|
|
15
|
+
];
|
|
16
|
+
const builtInCommonOASRules = [
|
|
13
17
|
'info-license-url',
|
|
18
|
+
'info-license',
|
|
19
|
+
'no-ambiguous-paths',
|
|
20
|
+
'no-enum-type-mismatch',
|
|
21
|
+
'no-http-verbs-in-paths',
|
|
22
|
+
'no-identical-paths',
|
|
23
|
+
'no-invalid-parameter-examples',
|
|
24
|
+
'no-invalid-schema-examples',
|
|
25
|
+
'no-path-trailing-slash',
|
|
14
26
|
'operation-2xx-response',
|
|
15
27
|
'operation-4xx-response',
|
|
16
|
-
'operation-
|
|
17
|
-
'assertions',
|
|
28
|
+
'operation-description',
|
|
18
29
|
'operation-operationId-unique',
|
|
30
|
+
'operation-operationId-url-safe',
|
|
19
31
|
'operation-parameters-unique',
|
|
20
|
-
'
|
|
32
|
+
'operation-singular-tag',
|
|
33
|
+
'operation-summary',
|
|
21
34
|
'operation-tag-defined',
|
|
22
|
-
'
|
|
23
|
-
'no-enum-type-mismatch',
|
|
24
|
-
'no-path-trailing-slash',
|
|
25
|
-
'no-empty-servers',
|
|
35
|
+
'parameter-description',
|
|
26
36
|
'path-declaration-must-exist',
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'operation-summary',
|
|
30
|
-
'tags-alphabetical',
|
|
31
|
-
'no-server-example.com',
|
|
32
|
-
'no-server-trailing-slash',
|
|
33
|
-
'tag-description',
|
|
34
|
-
'operation-description',
|
|
35
|
-
'no-unused-components',
|
|
37
|
+
'path-excludes-patterns',
|
|
38
|
+
'path-http-verbs-order',
|
|
36
39
|
'path-not-include-query',
|
|
37
40
|
'path-params-defined',
|
|
38
|
-
'
|
|
39
|
-
'
|
|
41
|
+
'path-parameters-defined',
|
|
42
|
+
'path-segment-plural',
|
|
43
|
+
'paths-kebab-case',
|
|
44
|
+
'required-string-property-missing-min-length',
|
|
45
|
+
'response-contains-header',
|
|
46
|
+
'scalar-property-missing-example',
|
|
40
47
|
'security-defined',
|
|
48
|
+
'spec-strict-refs',
|
|
41
49
|
'no-unresolved-refs',
|
|
42
|
-
|
|
50
|
+
];
|
|
51
|
+
const builtInOAS2Rules = [
|
|
43
52
|
'boolean-parameter-prefixes',
|
|
44
|
-
'
|
|
53
|
+
'request-mime-type',
|
|
54
|
+
'response-contains-property',
|
|
55
|
+
'response-mime-type',
|
|
56
|
+
];
|
|
57
|
+
const builtInOAS3Rules = [
|
|
58
|
+
'boolean-parameter-prefixes',
|
|
59
|
+
'component-name-unique',
|
|
60
|
+
'no-empty-servers',
|
|
61
|
+
'no-example-value-and-externalValue',
|
|
45
62
|
'no-invalid-media-type-examples',
|
|
46
|
-
'no-
|
|
47
|
-
'no-
|
|
48
|
-
'no-undefined-server-variable',
|
|
63
|
+
'no-server-example.com',
|
|
64
|
+
'no-server-trailing-slash',
|
|
49
65
|
'no-server-variables-empty-enum',
|
|
50
|
-
'no-
|
|
51
|
-
'
|
|
66
|
+
'no-undefined-server-variable',
|
|
67
|
+
'no-unused-components',
|
|
68
|
+
'operation-4xx-problem-details-rfc7807',
|
|
52
69
|
'request-mime-type',
|
|
53
|
-
'response-mime-type',
|
|
54
|
-
'path-segment-plural',
|
|
55
|
-
'no-invalid-schema-examples',
|
|
56
|
-
'no-invalid-parameter-examples',
|
|
57
|
-
'response-contains-header',
|
|
58
70
|
'response-contains-property',
|
|
59
|
-
'
|
|
71
|
+
'response-mime-type',
|
|
60
72
|
'spec-components-invalid-map-name',
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
73
|
+
];
|
|
74
|
+
const builtInAsync2Rules = ['channels-kebab-case', 'no-channel-trailing-slash'];
|
|
75
|
+
const builtInRules = [
|
|
76
|
+
...builtInCommonRules,
|
|
77
|
+
...builtInCommonOASRules,
|
|
78
|
+
...builtInOAS2Rules,
|
|
79
|
+
...builtInOAS3Rules,
|
|
80
|
+
...builtInAsync2Rules,
|
|
66
81
|
];
|
|
67
82
|
const nodeTypesList = [
|
|
68
83
|
'any',
|
|
@@ -138,14 +153,17 @@ const ConfigStyleguide = {
|
|
|
138
153
|
oas2Rules: 'Rules',
|
|
139
154
|
oas3_0Rules: 'Rules',
|
|
140
155
|
oas3_1Rules: 'Rules',
|
|
156
|
+
async2Rules: 'Rules',
|
|
141
157
|
preprocessors: { type: 'object' },
|
|
142
158
|
oas2Preprocessors: { type: 'object' },
|
|
143
159
|
oas3_0Preprocessors: { type: 'object' },
|
|
144
160
|
oas3_1Preprocessors: { type: 'object' },
|
|
161
|
+
async2Preprocessors: { type: 'object' },
|
|
145
162
|
decorators: { type: 'object' },
|
|
146
163
|
oas2Decorators: { type: 'object' },
|
|
147
164
|
oas3_0Decorators: { type: 'object' },
|
|
148
165
|
oas3_1Decorators: { type: 'object' },
|
|
166
|
+
async2Decorators: { type: 'object' },
|
|
149
167
|
},
|
|
150
168
|
};
|
|
151
169
|
const RootConfigStyleguide = {
|
|
@@ -208,7 +226,7 @@ const Rules = {
|
|
|
208
226
|
// keep the old assert/ prefix as an alias
|
|
209
227
|
return 'Assert';
|
|
210
228
|
}
|
|
211
|
-
else if (
|
|
229
|
+
else if (builtInRules.includes(key) || (0, utils_1.isCustomRuleId)(key)) {
|
|
212
230
|
if (typeof value === 'string') {
|
|
213
231
|
return { enum: ['error', 'warn', 'off'] };
|
|
214
232
|
}
|
|
@@ -309,7 +327,7 @@ const Assert = {
|
|
|
309
327
|
properties: {
|
|
310
328
|
subject: 'AssertionDefinitionSubject',
|
|
311
329
|
assertions: 'AssertionDefinitionAssertions',
|
|
312
|
-
where: _1.listOf('AssertDefinition'),
|
|
330
|
+
where: (0, _1.listOf)('AssertDefinition'),
|
|
313
331
|
message: { type: 'string' },
|
|
314
332
|
suggest: { type: 'array', items: { type: 'string' } },
|
|
315
333
|
severity: { enum: ['error', 'warn', 'off'] },
|
|
@@ -357,8 +375,8 @@ const ConfigLabels = {
|
|
|
357
375
|
};
|
|
358
376
|
const ConfigSidebarLinks = {
|
|
359
377
|
properties: {
|
|
360
|
-
beforeInfo: _1.listOf('CommonConfigSidebarLinks'),
|
|
361
|
-
end: _1.listOf('CommonConfigSidebarLinks'),
|
|
378
|
+
beforeInfo: (0, _1.listOf)('CommonConfigSidebarLinks'),
|
|
379
|
+
end: (0, _1.listOf)('CommonConfigSidebarLinks'),
|
|
362
380
|
},
|
|
363
381
|
};
|
|
364
382
|
const CommonConfigSidebarLinks = {
|
|
@@ -386,7 +404,7 @@ const CommonColorProps = {
|
|
|
386
404
|
},
|
|
387
405
|
};
|
|
388
406
|
const BorderThemeColors = {
|
|
389
|
-
properties: utils_1.pickObjectProps(CommonThemeColors.properties, ['light', 'dark']),
|
|
407
|
+
properties: (0, utils_1.pickObjectProps)(CommonThemeColors.properties, ['light', 'dark']),
|
|
390
408
|
};
|
|
391
409
|
const HttpColors = {
|
|
392
410
|
properties: {
|
|
@@ -410,7 +428,7 @@ const ResponseColors = {
|
|
|
410
428
|
},
|
|
411
429
|
};
|
|
412
430
|
const SecondaryColors = {
|
|
413
|
-
properties: utils_1.omitObjectProps(CommonThemeColors.properties, ['dark']),
|
|
431
|
+
properties: (0, utils_1.omitObjectProps)(CommonThemeColors.properties, ['dark']),
|
|
414
432
|
};
|
|
415
433
|
const TextThemeColors = {
|
|
416
434
|
properties: {
|
|
@@ -458,10 +476,10 @@ const FontConfig = {
|
|
|
458
476
|
},
|
|
459
477
|
};
|
|
460
478
|
const ButtonsConfig = {
|
|
461
|
-
properties: Object.assign(Object.assign({}, utils_1.omitObjectProps(FontConfig.properties, ['fontSize', 'lineHeight'])), { borderRadius: { type: 'string' }, hoverStyle: { type: 'string' }, boxShadow: { type: 'string' }, hoverBoxShadow: { type: 'string' }, sizes: 'Sizes' }),
|
|
479
|
+
properties: Object.assign(Object.assign({}, (0, utils_1.omitObjectProps)(FontConfig.properties, ['fontSize', 'lineHeight'])), { borderRadius: { type: 'string' }, hoverStyle: { type: 'string' }, boxShadow: { type: 'string' }, hoverBoxShadow: { type: 'string' }, sizes: 'Sizes' }),
|
|
462
480
|
};
|
|
463
481
|
const BadgeFontConfig = {
|
|
464
|
-
properties: utils_1.pickObjectProps(FontConfig.properties, ['fontSize', 'lineHeight']),
|
|
482
|
+
properties: (0, utils_1.pickObjectProps)(FontConfig.properties, ['fontSize', 'lineHeight']),
|
|
465
483
|
};
|
|
466
484
|
const BadgeSizes = {
|
|
467
485
|
properties: {
|
|
@@ -470,7 +488,7 @@ const BadgeSizes = {
|
|
|
470
488
|
},
|
|
471
489
|
};
|
|
472
490
|
const HttpBadgesConfig = {
|
|
473
|
-
properties: Object.assign(Object.assign({}, utils_1.omitObjectProps(FontConfig.properties, ['fontSize', 'lineHeight'])), { borderRadius: { type: 'string' }, color: { type: 'string' }, sizes: 'BadgeSizes' }),
|
|
491
|
+
properties: Object.assign(Object.assign({}, (0, utils_1.omitObjectProps)(FontConfig.properties, ['fontSize', 'lineHeight'])), { borderRadius: { type: 'string' }, color: { type: 'string' }, sizes: 'BadgeSizes' }),
|
|
474
492
|
};
|
|
475
493
|
const LabelControls = {
|
|
476
494
|
properties: {
|
|
@@ -556,7 +574,7 @@ const GroupItemsConfig = {
|
|
|
556
574
|
},
|
|
557
575
|
};
|
|
558
576
|
const Level1Items = {
|
|
559
|
-
properties: utils_1.pickObjectProps(GroupItemsConfig.properties, ['textTransform']),
|
|
577
|
+
properties: (0, utils_1.pickObjectProps)(GroupItemsConfig.properties, ['textTransform']),
|
|
560
578
|
};
|
|
561
579
|
const SpacingConfig = {
|
|
562
580
|
properties: {
|
|
@@ -569,7 +587,7 @@ const SpacingConfig = {
|
|
|
569
587
|
},
|
|
570
588
|
};
|
|
571
589
|
const Sidebar = {
|
|
572
|
-
properties: Object.assign(Object.assign({}, utils_1.omitObjectProps(FontConfig.properties, ['fontWeight', 'lineHeight'])), { activeBgColor: { type: 'string' }, activeTextColor: { type: 'string' }, backgroundColor: { type: 'string' }, borderRadius: { type: 'string' }, breakPath: { type: 'boolean' }, caretColor: { type: 'string' }, caretSize: { type: 'string' }, groupItems: 'GroupItemsConfig', level1items: 'Level1Items', rightLineColor: { type: 'string' }, separatorLabelColor: { type: 'string' }, showAtBreakpoint: { type: 'string' }, spacing: 'SpacingConfig', textColor: { type: 'string' }, width: { type: 'string' } }),
|
|
590
|
+
properties: Object.assign(Object.assign({}, (0, utils_1.omitObjectProps)(FontConfig.properties, ['fontWeight', 'lineHeight'])), { activeBgColor: { type: 'string' }, activeTextColor: { type: 'string' }, backgroundColor: { type: 'string' }, borderRadius: { type: 'string' }, breakPath: { type: 'boolean' }, caretColor: { type: 'string' }, caretSize: { type: 'string' }, groupItems: 'GroupItemsConfig', level1items: 'Level1Items', rightLineColor: { type: 'string' }, separatorLabelColor: { type: 'string' }, showAtBreakpoint: { type: 'string' }, spacing: 'SpacingConfig', textColor: { type: 'string' }, width: { type: 'string' } }),
|
|
573
591
|
};
|
|
574
592
|
const Heading = {
|
|
575
593
|
properties: Object.assign(Object.assign({}, FontConfig.properties), { color: { type: 'string' }, transform: { type: 'string' } }),
|
|
@@ -589,7 +607,7 @@ const CodeConfig = {
|
|
|
589
607
|
}, wrap: { type: 'boolean' } }),
|
|
590
608
|
};
|
|
591
609
|
const HeadingsConfig = {
|
|
592
|
-
properties: utils_1.omitObjectProps(FontConfig.properties, ['fontSize']),
|
|
610
|
+
properties: (0, utils_1.omitObjectProps)(FontConfig.properties, ['fontSize']),
|
|
593
611
|
};
|
|
594
612
|
const LinksConfig = {
|
|
595
613
|
properties: {
|
|
@@ -601,10 +619,10 @@ const LinksConfig = {
|
|
|
601
619
|
},
|
|
602
620
|
};
|
|
603
621
|
const Typography = {
|
|
604
|
-
properties: Object.assign(Object.assign({ code: 'CodeConfig', fieldName: 'FontConfig' }, utils_1.pickObjectProps(FontConfig.properties, ['fontSize', 'fontFamily'])), { fontWeightBold: { type: 'string' }, fontWeightLight: { type: 'string' }, fontWeightRegular: { type: 'string' }, heading1: 'Heading', heading2: 'Heading', heading3: 'Heading', headings: 'HeadingsConfig', lineHeight: { type: 'string' }, links: 'LinksConfig', optimizeSpeed: { type: 'boolean' }, rightPanelHeading: 'Heading', smoothing: { enum: ['auto', 'none', 'antialiased', 'subpixel-antialiased', 'grayscale'] } }),
|
|
622
|
+
properties: Object.assign(Object.assign({ code: 'CodeConfig', fieldName: 'FontConfig' }, (0, utils_1.pickObjectProps)(FontConfig.properties, ['fontSize', 'fontFamily'])), { fontWeightBold: { type: 'string' }, fontWeightLight: { type: 'string' }, fontWeightRegular: { type: 'string' }, heading1: 'Heading', heading2: 'Heading', heading3: 'Heading', headings: 'HeadingsConfig', lineHeight: { type: 'string' }, links: 'LinksConfig', optimizeSpeed: { type: 'boolean' }, rightPanelHeading: 'Heading', smoothing: { enum: ['auto', 'none', 'antialiased', 'subpixel-antialiased', 'grayscale'] } }),
|
|
605
623
|
};
|
|
606
624
|
const TokenProps = {
|
|
607
|
-
properties: Object.assign({ color: { type: 'string' } }, utils_1.omitObjectProps(FontConfig.properties, ['fontWeight'])),
|
|
625
|
+
properties: Object.assign({ color: { type: 'string' } }, (0, utils_1.omitObjectProps)(FontConfig.properties, ['fontWeight'])),
|
|
608
626
|
};
|
|
609
627
|
const CodeBlock = {
|
|
610
628
|
properties: {
|
|
@@ -680,7 +698,7 @@ const ConfigTheme = {
|
|
|
680
698
|
const GenerateCodeSamples = {
|
|
681
699
|
properties: {
|
|
682
700
|
skipOptionalParameters: { type: 'boolean' },
|
|
683
|
-
languages: _1.listOf('ConfigLanguage'),
|
|
701
|
+
languages: (0, _1.listOf)('ConfigLanguage'),
|
|
684
702
|
},
|
|
685
703
|
required: ['languages'],
|
|
686
704
|
};
|
|
@@ -596,4 +596,4 @@ var ScorecardStatus;
|
|
|
596
596
|
ScorecardStatus["BelowMinimum"] = "Below minimum";
|
|
597
597
|
ScorecardStatus["Highest"] = "Highest";
|
|
598
598
|
ScorecardStatus["Minimum"] = "Minimum";
|
|
599
|
-
})(ScorecardStatus
|
|
599
|
+
})(ScorecardStatus || (exports.ScorecardStatus = ScorecardStatus = {}));
|
package/lib/typings/common.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export interface StatsRow {
|
|
|
4
4
|
color: 'red' | 'yellow' | 'green' | 'white' | 'magenta' | 'cyan';
|
|
5
5
|
items?: Set<string>;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
8
|
-
export
|
|
7
|
+
export type StatsName = 'operations' | 'refs' | 'tags' | 'externalDocs' | 'pathItems' | 'links' | 'schemas' | 'parameters';
|
|
8
|
+
export type StatsAccumulator = Record<StatsName, StatsRow>;
|