@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.
Files changed (190) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/benchmark/benches/lint-with-many-rules.bench.js +4 -4
  3. package/lib/benchmark/benches/lint-with-nested-rule.bench.js +4 -4
  4. package/lib/benchmark/benches/lint-with-no-rules.bench.js +4 -4
  5. package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.js +4 -4
  6. package/lib/benchmark/benches/lint-with-top-level-rule.bench.js +4 -4
  7. package/lib/benchmark/benches/recommended-oas3.bench.js +4 -4
  8. package/lib/benchmark/benches/resolve-with-no-external.bench.js +3 -3
  9. package/lib/benchmark/utils.js +3 -3
  10. package/lib/bundle.d.ts +4 -4
  11. package/lib/bundle.js +23 -23
  12. package/lib/config/all.d.ts +2 -2
  13. package/lib/config/all.js +44 -8
  14. package/lib/config/builtIn.js +2 -0
  15. package/lib/config/config-resolvers.js +25 -25
  16. package/lib/config/config.js +9 -9
  17. package/lib/config/index.js +5 -1
  18. package/lib/config/load.d.ts +1 -1
  19. package/lib/config/load.js +6 -6
  20. package/lib/config/minimal.d.ts +2 -2
  21. package/lib/config/minimal.js +34 -3
  22. package/lib/config/recommended-strict.d.ts +3 -0
  23. package/lib/config/recommended-strict.js +92 -0
  24. package/lib/config/recommended.d.ts +2 -2
  25. package/lib/config/recommended.js +34 -3
  26. package/lib/config/rules.d.ts +1 -1
  27. package/lib/config/types.d.ts +47 -46
  28. package/lib/config/types.js +2 -2
  29. package/lib/config/utils.js +26 -14
  30. package/lib/decorators/common/filters/filter-helper.js +4 -4
  31. package/lib/decorators/common/filters/filter-in.js +2 -2
  32. package/lib/decorators/common/filters/filter-out.js +2 -2
  33. package/lib/decorators/common/info-description-override.js +1 -1
  34. package/lib/decorators/common/media-type-examples-override.js +3 -3
  35. package/lib/decorators/common/operation-description-override.js +1 -1
  36. package/lib/decorators/common/registry-dependencies.js +1 -1
  37. package/lib/decorators/common/remove-x-internal.js +4 -4
  38. package/lib/decorators/common/tag-description-override.js +1 -1
  39. package/lib/format/codeframes.d.ts +6 -6
  40. package/lib/format/format.d.ts +2 -2
  41. package/lib/format/format.js +12 -12
  42. package/lib/js-yaml/index.d.ts +2 -2
  43. package/lib/js-yaml/index.js +2 -2
  44. package/lib/lint.js +18 -18
  45. package/lib/oas-types.d.ts +12 -10
  46. package/lib/oas-types.js +2 -2
  47. package/lib/redocly/index.js +10 -10
  48. package/lib/redocly/registry-api.js +2 -2
  49. package/lib/resolve.d.ts +4 -4
  50. package/lib/resolve.js +18 -18
  51. package/lib/rules/ajv.js +1 -1
  52. package/lib/rules/async2/index.d.ts +2 -11
  53. package/lib/rules/common/assertions/asserts.d.ts +3 -3
  54. package/lib/rules/common/assertions/asserts.js +21 -21
  55. package/lib/rules/common/assertions/index.d.ts +4 -4
  56. package/lib/rules/common/assertions/index.js +3 -3
  57. package/lib/rules/common/assertions/utils.d.ts +4 -4
  58. package/lib/rules/common/assertions/utils.js +3 -3
  59. package/lib/rules/common/info-contact.js +1 -1
  60. package/lib/rules/common/info-license-url.js +1 -1
  61. package/lib/rules/common/info-license.js +1 -1
  62. package/lib/rules/common/no-enum-type-mismatch.js +3 -3
  63. package/lib/rules/common/no-http-verbs-in-paths.js +2 -2
  64. package/lib/rules/common/no-invalid-parameter-examples.js +3 -3
  65. package/lib/rules/common/no-invalid-schema-examples.js +3 -3
  66. package/lib/rules/common/operation-2xx-response.js +2 -2
  67. package/lib/rules/common/operation-4xx-response.js +2 -2
  68. package/lib/rules/common/operation-description.js +1 -1
  69. package/lib/rules/common/operation-operationId.js +1 -1
  70. package/lib/rules/common/operation-summary.js +1 -1
  71. package/lib/rules/common/path-segment-plural.js +1 -1
  72. package/lib/rules/common/response-contains-header.js +2 -2
  73. package/lib/rules/common/spec-strict-refs.js +1 -1
  74. package/lib/rules/common/spec.js +11 -11
  75. package/lib/rules/common/tag-description.js +1 -1
  76. package/lib/rules/oas2/boolean-parameter-prefixes.d.ts +1 -1
  77. package/lib/rules/oas2/index.d.ts +2 -46
  78. package/lib/rules/oas2/remove-unused-components.js +1 -1
  79. package/lib/rules/oas2/request-mime-type.js +2 -2
  80. package/lib/rules/oas2/response-contains-property.js +2 -2
  81. package/lib/rules/oas2/response-mime-type.js +2 -2
  82. package/lib/rules/oas3/boolean-parameter-prefixes.d.ts +1 -1
  83. package/lib/rules/oas3/index.d.ts +1 -1
  84. package/lib/rules/oas3/index.js +1 -1
  85. package/lib/rules/oas3/no-invalid-media-type-examples.js +3 -3
  86. package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +3 -3
  87. package/lib/rules/oas3/remove-unused-components.js +2 -2
  88. package/lib/rules/oas3/request-mime-type.js +3 -3
  89. package/lib/rules/oas3/response-contains-property.js +2 -2
  90. package/lib/rules/oas3/response-mime-type.js +3 -3
  91. package/lib/rules/utils.js +3 -3
  92. package/lib/types/asyncapi.js +21 -21
  93. package/lib/types/index.d.ts +8 -8
  94. package/lib/types/oas2.js +14 -14
  95. package/lib/types/oas3.js +27 -27
  96. package/lib/types/oas3_1.js +6 -6
  97. package/lib/types/redocly-yaml.d.ts +11 -0
  98. package/lib/types/redocly-yaml.js +71 -53
  99. package/lib/types/theme-config.js +1 -1
  100. package/lib/typings/common.d.ts +2 -2
  101. package/lib/typings/openapi.d.ts +6 -6
  102. package/lib/typings/swagger.d.ts +3 -3
  103. package/lib/utils.d.ts +5 -5
  104. package/lib/utils.js +3 -3
  105. package/lib/visitors.d.ts +40 -40
  106. package/lib/walk.d.ts +14 -15
  107. package/lib/walk.js +11 -11
  108. package/package.json +2 -2
  109. package/src/__tests__/lint.test.ts +40 -40
  110. package/src/__tests__/normalizeVisitors.test.ts +23 -5
  111. package/src/__tests__/ref-utils.test.ts +7 -7
  112. package/src/__tests__/resolve-http.test.ts +10 -10
  113. package/src/__tests__/resolve.test.ts +39 -39
  114. package/src/__tests__/walk.test.ts +48 -48
  115. package/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +95 -32
  116. package/src/config/__tests__/__snapshots__/config.test.ts.snap +81 -81
  117. package/src/config/__tests__/config-resolvers.test.ts +30 -1
  118. package/src/config/__tests__/config.test.ts +88 -88
  119. package/src/config/__tests__/load.test.ts +12 -8
  120. package/src/config/__tests__/utils.test.ts +18 -18
  121. package/src/config/all.ts +46 -9
  122. package/src/config/builtIn.ts +2 -0
  123. package/src/config/minimal.ts +36 -4
  124. package/src/config/recommended-strict.ts +93 -0
  125. package/src/config/recommended.ts +36 -4
  126. package/src/config/types.ts +22 -8
  127. package/src/config/utils.ts +15 -0
  128. package/src/decorators/common/media-type-examples-override.ts +2 -2
  129. package/src/lint.ts +3 -3
  130. package/src/oas-types.ts +26 -3
  131. package/src/rules/__tests__/no-unresolved-refs.test.ts +26 -26
  132. package/src/rules/async2/__tests__/channels-kebab-case.test.ts +12 -12
  133. package/src/rules/async2/__tests__/no-channel-trailing-slash.test.ts +7 -7
  134. package/src/rules/async2/index.ts +2 -1
  135. package/src/rules/common/__tests__/info-license.test.ts +6 -6
  136. package/src/rules/common/__tests__/license-url.test.ts +6 -6
  137. package/src/rules/common/__tests__/no-ambiguous-paths.test.ts +13 -13
  138. package/src/rules/common/__tests__/no-enum-type-mismatch.test.ts +18 -18
  139. package/src/rules/common/__tests__/no-identical-paths.test.ts +5 -5
  140. package/src/rules/common/__tests__/no-path-trailing-slash.test.ts +12 -12
  141. package/src/rules/common/__tests__/operation-2xx-response.test.ts +18 -18
  142. package/src/rules/common/__tests__/operation-4xx-response.test.ts +23 -23
  143. package/src/rules/common/__tests__/operation-operationId-unique.test.ts +6 -6
  144. package/src/rules/common/__tests__/operation-operationId-url-safe.test.ts +5 -5
  145. package/src/rules/common/__tests__/operation-parameters-unique.test.ts +16 -16
  146. package/src/rules/common/__tests__/operation-singular-tag.test.ts +6 -6
  147. package/src/rules/common/__tests__/path-http-verbs-order.test.ts +10 -10
  148. package/src/rules/common/__tests__/path-not-include-query.test.ts +6 -6
  149. package/src/rules/common/__tests__/path-params-defined.test.ts +21 -21
  150. package/src/rules/common/__tests__/paths-kebab-case.test.ts +11 -11
  151. package/src/rules/common/__tests__/scalar-property-missing-example.test.ts +18 -18
  152. package/src/rules/common/__tests__/security-defined.test.ts +21 -21
  153. package/src/rules/common/__tests__/spec-strict-refs.test.ts +9 -9
  154. package/src/rules/common/__tests__/spec.test.ts +102 -102
  155. package/src/rules/common/__tests__/tag-description.test.ts +6 -6
  156. package/src/rules/common/__tests__/tags-alphabetical.test.ts +12 -12
  157. package/src/rules/common/assertions/__tests__/index.test.ts +15 -15
  158. package/src/rules/common/assertions/__tests__/utils.test.ts +9 -9
  159. package/src/rules/oas2/__tests__/boolean-parameter-prefixes.test.ts +7 -7
  160. package/src/rules/oas2/__tests__/response-contains-header.test.ts +13 -13
  161. package/src/rules/oas2/__tests__/response-contains-property.test.ts +8 -8
  162. package/src/rules/oas2/__tests__/spec/info.test.ts +21 -21
  163. package/src/rules/oas2/__tests__/spec/operation.test.ts +4 -4
  164. package/src/rules/oas2/__tests__/spec/paths.test.ts +12 -12
  165. package/src/rules/oas2/__tests__/spec/referenceableScalars.test.ts +1 -1
  166. package/src/rules/oas2/index.ts +3 -1
  167. package/src/rules/oas3/__tests__/boolean-parameter-prefixes.test.ts +7 -7
  168. package/src/rules/oas3/__tests__/component-name-unique.test.ts +186 -186
  169. package/src/rules/oas3/__tests__/no-empty-enum-servers.com.test.ts +18 -18
  170. package/src/rules/oas3/__tests__/no-example-value-and-externalValue.test.ts +6 -6
  171. package/src/rules/oas3/__tests__/no-invalid-media-type-examples.test.ts +36 -36
  172. package/src/rules/oas3/__tests__/no-server-example.com.test.ts +11 -11
  173. package/src/rules/oas3/__tests__/no-server-trailing-slash.test.ts +7 -7
  174. package/src/rules/oas3/__tests__/no-unused-components.test.ts +31 -31
  175. package/src/rules/oas3/__tests__/operation-4xx-problem-details-rfc7807.test.ts +15 -15
  176. package/src/rules/oas3/__tests__/response-contains-header.test.ts +26 -26
  177. package/src/rules/oas3/__tests__/response-contains-property.test.ts +27 -27
  178. package/src/rules/oas3/__tests__/spec/callbacks.test.ts +1 -1
  179. package/src/rules/oas3/__tests__/spec/info.test.ts +21 -21
  180. package/src/rules/oas3/__tests__/spec/operation.test.ts +10 -10
  181. package/src/rules/oas3/__tests__/spec/paths.test.ts +13 -13
  182. package/src/rules/oas3/__tests__/spec/referenceableScalars.test.ts +2 -2
  183. package/src/rules/oas3/__tests__/spec/servers.test.ts +25 -25
  184. package/src/rules/oas3/__tests__/spec/spec.test.ts +56 -56
  185. package/src/rules/oas3/__tests__/spec-components-invalid-map-name.test.ts +28 -28
  186. package/src/rules/oas3/index.ts +3 -3
  187. package/src/types/redocly-yaml.ts +75 -40
  188. package/src/visitors.ts +3 -3
  189. package/src/walk.ts +23 -10
  190. package/tsconfig.tsbuildinfo +1 -1
@@ -1,30 +1,31 @@
1
1
  import type { ProblemSeverity, UserContext } from '../walk';
2
- import type { Oas3PreprocessorsSet, SpecMajorVersion, Oas3DecoratorsSet, Oas2RuleSet, Oas2PreprocessorsSet, Oas2DecoratorsSet, Oas3RuleSet, SpecVersion, Async2PreprocessorsSet, Async2DecoratorsSet, Async2RuleSet } from '../oas-types';
2
+ import type { Oas3PreprocessorsSet, SpecMajorVersion, Oas3DecoratorsSet, Oas2RuleSet, Oas2PreprocessorsSet, Oas2DecoratorsSet, Oas3RuleSet, SpecVersion, Async2PreprocessorsSet, Async2DecoratorsSet, Async2RuleSet, RuleMap } from '../oas-types';
3
3
  import type { NodeType } from '../types';
4
4
  import { Location } from '../ref-utils';
5
5
  import type { SkipFunctionContext } from '../visitors';
6
- export declare type RuleSeverity = ProblemSeverity | 'off';
7
- export declare type RuleSettings = {
6
+ import { BuiltInAsync2RuleId, BuiltInCommonOASRuleId, BuiltInCommonRuleId, BuiltInOAS2RuleId, BuiltInOAS3RuleId } from '../types/redocly-yaml';
7
+ export type RuleSeverity = ProblemSeverity | 'off';
8
+ export type RuleSettings = {
8
9
  severity: RuleSeverity;
9
10
  };
10
- export declare type PreprocessorSeverity = RuleSeverity | 'on';
11
- export declare type RuleConfig = RuleSeverity | ({
11
+ export type PreprocessorSeverity = RuleSeverity | 'on';
12
+ export type RuleConfig = RuleSeverity | ({
12
13
  severity?: ProblemSeverity;
13
14
  } & Record<string, any>);
14
- export declare type PreprocessorConfig = PreprocessorSeverity | ({
15
+ export type PreprocessorConfig = PreprocessorSeverity | ({
15
16
  severity?: ProblemSeverity;
16
17
  } & Record<string, any>);
17
- export declare type DecoratorConfig = PreprocessorConfig;
18
- export declare type StyleguideRawConfig = {
18
+ export type DecoratorConfig = PreprocessorConfig;
19
+ export type StyleguideRawConfig<T = undefined> = {
19
20
  plugins?: (string | Plugin)[];
20
21
  extends?: string[];
21
22
  doNotResolveExamples?: boolean;
22
23
  recommendedFallback?: boolean;
23
- rules?: Record<string, RuleConfig>;
24
- oas2Rules?: Record<string, RuleConfig>;
25
- oas3_0Rules?: Record<string, RuleConfig>;
26
- oas3_1Rules?: Record<string, RuleConfig>;
27
- async2Rules?: Record<string, RuleConfig>;
24
+ rules?: RuleMap<BuiltInCommonRuleId | BuiltInCommonOASRuleId, RuleConfig, T>;
25
+ oas2Rules?: RuleMap<BuiltInOAS2RuleId, RuleConfig, T>;
26
+ oas3_0Rules?: RuleMap<BuiltInOAS3RuleId, RuleConfig, T>;
27
+ oas3_1Rules?: RuleMap<BuiltInOAS3RuleId, RuleConfig, T>;
28
+ async2Rules?: RuleMap<BuiltInAsync2RuleId, RuleConfig, T>;
28
29
  preprocessors?: Record<string, PreprocessorConfig>;
29
30
  oas2Preprocessors?: Record<string, PreprocessorConfig>;
30
31
  oas3_0Preprocessors?: Record<string, PreprocessorConfig>;
@@ -36,41 +37,41 @@ export declare type StyleguideRawConfig = {
36
37
  oas3_1Decorators?: Record<string, DecoratorConfig>;
37
38
  async2Decorators?: Record<string, DecoratorConfig>;
38
39
  };
39
- export declare type ApiStyleguideRawConfig = Omit<StyleguideRawConfig, 'plugins'>;
40
- export declare type ResolvedStyleguideConfig = PluginStyleguideConfig & {
40
+ export type ApiStyleguideRawConfig = Omit<StyleguideRawConfig, 'plugins'>;
41
+ export type ResolvedStyleguideConfig = PluginStyleguideConfig & {
41
42
  plugins?: Plugin[];
42
43
  recommendedFallback?: boolean;
43
44
  extends?: void | never;
44
45
  extendPaths?: string[];
45
46
  pluginPaths?: string[];
46
47
  };
47
- export declare type PreprocessorsConfig = {
48
+ export type PreprocessorsConfig = {
48
49
  oas3?: Oas3PreprocessorsSet;
49
50
  oas2?: Oas2PreprocessorsSet;
50
51
  async2?: Async2PreprocessorsSet;
51
52
  };
52
- export declare type DecoratorsConfig = {
53
+ export type DecoratorsConfig = {
53
54
  oas3?: Oas3DecoratorsSet;
54
55
  oas2?: Oas2DecoratorsSet;
55
56
  async2?: Async2DecoratorsSet;
56
57
  };
57
- export declare type TypesExtensionFn = (types: Record<string, NodeType>, oasVersion: SpecVersion) => Record<string, NodeType>;
58
- export declare type TypeExtensionsConfig = Partial<Record<SpecMajorVersion, TypesExtensionFn>>;
59
- export declare type CustomRulesConfig = {
58
+ export type TypesExtensionFn = (types: Record<string, NodeType>, oasVersion: SpecVersion) => Record<string, NodeType>;
59
+ export type TypeExtensionsConfig = Partial<Record<SpecMajorVersion, TypesExtensionFn>>;
60
+ export type CustomRulesConfig = {
60
61
  oas3?: Oas3RuleSet;
61
62
  oas2?: Oas2RuleSet;
62
63
  async2?: Async2RuleSet;
63
64
  };
64
- export declare type AssertionContext = Partial<UserContext> & SkipFunctionContext & {
65
+ export type AssertionContext = Partial<UserContext> & SkipFunctionContext & {
65
66
  node: any;
66
67
  };
67
- export declare type AssertResult = {
68
+ export type AssertResult = {
68
69
  message?: string;
69
70
  location?: Location;
70
71
  };
71
- export declare type CustomFunction = (value: any, options: unknown, baseLocation: Location) => AssertResult[];
72
- export declare type AssertionsConfig = Record<string, CustomFunction>;
73
- export declare type Plugin = {
72
+ export type CustomFunction = (value: any, options: unknown, baseLocation: Location) => AssertResult[];
73
+ export type AssertionsConfig = Record<string, CustomFunction>;
74
+ export type Plugin = {
74
75
  id: string;
75
76
  configs?: Record<string, PluginStyleguideConfig>;
76
77
  rules?: CustomRulesConfig;
@@ -79,8 +80,8 @@ export declare type Plugin = {
79
80
  typeExtension?: TypeExtensionsConfig;
80
81
  assertions?: AssertionsConfig;
81
82
  };
82
- export declare type PluginStyleguideConfig = Omit<StyleguideRawConfig, 'plugins' | 'extends'>;
83
- export declare type ResolveHeader = {
83
+ export type PluginStyleguideConfig<T = undefined> = Omit<StyleguideRawConfig<T>, 'plugins' | 'extends'>;
84
+ export type ResolveHeader = {
84
85
  name: string;
85
86
  envVariable?: undefined;
86
87
  value: string;
@@ -91,41 +92,41 @@ export declare type ResolveHeader = {
91
92
  envVariable: string;
92
93
  matches: string;
93
94
  };
94
- export declare type RawResolveConfig = {
95
+ export type RawResolveConfig = {
95
96
  http?: Partial<HttpResolveConfig>;
96
97
  doNotResolveExamples?: boolean;
97
98
  };
98
- export declare type HttpResolveConfig = {
99
+ export type HttpResolveConfig = {
99
100
  headers: ResolveHeader[];
100
101
  customFetch?: Function;
101
102
  };
102
- export declare type ResolveConfig = {
103
+ export type ResolveConfig = {
103
104
  http: HttpResolveConfig;
104
105
  };
105
- export declare type Region = 'us' | 'eu';
106
- export declare type Telemetry = 'on' | 'off';
107
- export declare type AccessTokens = {
106
+ export type Region = 'us' | 'eu';
107
+ export type Telemetry = 'on' | 'off';
108
+ export type AccessTokens = {
108
109
  [region in Region]?: string;
109
110
  };
110
- export declare type DeprecatedInRawConfig = {
111
+ export type DeprecatedInRawConfig = {
111
112
  apiDefinitions?: Record<string, string>;
112
113
  lint?: StyleguideRawConfig;
113
114
  styleguide?: StyleguideRawConfig;
114
115
  referenceDocs?: Record<string, any>;
115
116
  apis?: Record<string, Api & DeprecatedInApi>;
116
117
  } & DeprecatedFeaturesConfig;
117
- export declare type Api = {
118
+ export type Api = {
118
119
  root: string;
119
120
  styleguide?: ApiStyleguideRawConfig;
120
121
  } & ThemeConfig;
121
- export declare type DeprecatedInApi = {
122
+ export type DeprecatedInApi = {
122
123
  lint?: ApiStyleguideRawConfig;
123
124
  } & DeprecatedFeaturesConfig;
124
- export declare type ResolvedApi = Omit<Api, 'styleguide'> & {
125
+ export type ResolvedApi = Omit<Api, 'styleguide'> & {
125
126
  styleguide: ResolvedStyleguideConfig;
126
127
  files?: string[];
127
128
  };
128
- export declare type RawConfig = {
129
+ export type RawConfig = {
129
130
  apis?: Record<string, Api>;
130
131
  styleguide?: StyleguideRawConfig;
131
132
  resolve?: RawResolveConfig;
@@ -134,28 +135,28 @@ export declare type RawConfig = {
134
135
  files?: string[];
135
136
  telemetry?: Telemetry;
136
137
  } & ThemeConfig;
137
- export declare type RawUniversalConfig = Omit<RawConfig, 'styleguide'> & StyleguideRawConfig;
138
- export declare type FlatApi = Omit<Api, 'styleguide'> & Omit<ApiStyleguideRawConfig, 'doNotResolveExamples'>;
139
- export declare type FlatRawConfig = Omit<RawConfig, 'styleguide' | 'resolve' | 'apis'> & Omit<StyleguideRawConfig, 'doNotResolveExamples'> & {
138
+ export type RawUniversalConfig = Omit<RawConfig, 'styleguide'> & StyleguideRawConfig;
139
+ export type FlatApi = Omit<Api, 'styleguide'> & Omit<ApiStyleguideRawConfig, 'doNotResolveExamples'>;
140
+ export type FlatRawConfig = Omit<RawConfig, 'styleguide' | 'resolve' | 'apis'> & Omit<StyleguideRawConfig, 'doNotResolveExamples'> & {
140
141
  resolve?: RawResolveConfig;
141
142
  apis?: Record<string, FlatApi>;
142
143
  } & ThemeRawConfig;
143
- export declare type ResolvedConfig = Omit<RawConfig, 'apis' | 'styleguide'> & {
144
+ export type ResolvedConfig = Omit<RawConfig, 'apis' | 'styleguide'> & {
144
145
  apis: Record<string, ResolvedApi>;
145
146
  styleguide: ResolvedStyleguideConfig;
146
147
  };
147
- declare type DeprecatedFeaturesConfig = {
148
+ type DeprecatedFeaturesConfig = {
148
149
  'features.openapi'?: Record<string, any>;
149
150
  'features.mockServer'?: Record<string, any>;
150
151
  };
151
- export declare type ThemeConfig = {
152
+ export type ThemeConfig = {
152
153
  theme?: ThemeRawConfig;
153
154
  };
154
- export declare type ThemeRawConfig = {
155
+ export type ThemeRawConfig = {
155
156
  openapi?: Record<string, any>;
156
157
  mockServer?: Record<string, any>;
157
158
  };
158
- export declare type RulesFields = 'rules' | 'oas2Rules' | 'oas3_0Rules' | 'oas3_1Rules' | 'preprocessors' | 'oas2Preprocessors' | 'oas3_0Preprocessors' | 'oas3_1Preprocessors' | 'decorators' | 'oas2Decorators' | 'oas3_0Decorators' | 'oas3_1Decorators';
159
+ export type RulesFields = 'rules' | 'oas2Rules' | 'oas3_0Rules' | 'oas3_1Rules' | 'async2Rules' | 'preprocessors' | 'oas2Preprocessors' | 'oas3_0Preprocessors' | 'oas3_1Preprocessors' | 'async2Preprocessors' | 'decorators' | 'oas2Decorators' | 'oas3_0Decorators' | 'oas3_1Decorators' | 'async2Decorators';
159
160
  export declare enum AuthProviderType {
160
161
  OIDC = "OIDC",
161
162
  SAML2 = "SAML2",
@@ -6,10 +6,10 @@ var AuthProviderType;
6
6
  AuthProviderType["OIDC"] = "OIDC";
7
7
  AuthProviderType["SAML2"] = "SAML2";
8
8
  AuthProviderType["BASIC"] = "BASIC";
9
- })(AuthProviderType = exports.AuthProviderType || (exports.AuthProviderType = {}));
9
+ })(AuthProviderType || (exports.AuthProviderType = AuthProviderType = {}));
10
10
  var ApigeeDevOnboardingIntegrationAuthType;
11
11
  (function (ApigeeDevOnboardingIntegrationAuthType) {
12
12
  ApigeeDevOnboardingIntegrationAuthType["SERVICE_ACCOUNT"] = "SERVICE_ACCOUNT";
13
13
  ApigeeDevOnboardingIntegrationAuthType["OAUTH2"] = "OAUTH2";
14
- })(ApigeeDevOnboardingIntegrationAuthType = exports.ApigeeDevOnboardingIntegrationAuthType || (exports.ApigeeDevOnboardingIntegrationAuthType = {}));
14
+ })(ApigeeDevOnboardingIntegrationAuthType || (exports.ApigeeDevOnboardingIntegrationAuthType = ApigeeDevOnboardingIntegrationAuthType = {}));
15
15
  exports.DEFAULT_TEAM_CLAIM_NAME = 'https://redocly.com/sso/teams';
@@ -37,7 +37,7 @@ function transformApiDefinitionsToApis(apiDefinitions) {
37
37
  exports.transformApiDefinitionsToApis = transformApiDefinitionsToApis;
38
38
  function extractFlatConfig(_a) {
39
39
  var _b;
40
- var { plugins, extends: _extends, rules, oas2Rules, oas3_0Rules, oas3_1Rules, preprocessors, oas2Preprocessors, oas3_0Preprocessors, oas3_1Preprocessors, decorators, oas2Decorators, oas3_0Decorators, oas3_1Decorators } = _a, rawConfigRest = __rest(_a, ["plugins", "extends", "rules", "oas2Rules", "oas3_0Rules", "oas3_1Rules", "preprocessors", "oas2Preprocessors", "oas3_0Preprocessors", "oas3_1Preprocessors", "decorators", "oas2Decorators", "oas3_0Decorators", "oas3_1Decorators"]);
40
+ var { plugins, extends: _extends, rules, oas2Rules, oas3_0Rules, oas3_1Rules, async2Rules, preprocessors, oas2Preprocessors, oas3_0Preprocessors, oas3_1Preprocessors, async2Preprocessors, decorators, oas2Decorators, oas3_0Decorators, oas3_1Decorators, async2Decorators } = _a, rawConfigRest = __rest(_a, ["plugins", "extends", "rules", "oas2Rules", "oas3_0Rules", "oas3_1Rules", "async2Rules", "preprocessors", "oas2Preprocessors", "oas3_0Preprocessors", "oas3_1Preprocessors", "async2Preprocessors", "decorators", "oas2Decorators", "oas3_0Decorators", "oas3_1Decorators", "async2Decorators"]);
41
41
  const styleguideConfig = {
42
42
  plugins,
43
43
  extends: _extends,
@@ -45,14 +45,17 @@ function extractFlatConfig(_a) {
45
45
  oas2Rules,
46
46
  oas3_0Rules,
47
47
  oas3_1Rules,
48
+ async2Rules,
48
49
  preprocessors,
49
50
  oas2Preprocessors,
50
51
  oas3_0Preprocessors,
51
52
  oas3_1Preprocessors,
53
+ async2Preprocessors,
52
54
  decorators,
53
55
  oas2Decorators,
54
56
  oas3_0Decorators,
55
57
  oas3_1Decorators,
58
+ async2Decorators,
56
59
  doNotResolveExamples: (_b = rawConfigRest.resolve) === null || _b === void 0 ? void 0 : _b.doNotResolveExamples,
57
60
  };
58
61
  if ((rawConfigRest.lint && rawConfigRest.styleguide) ||
@@ -94,14 +97,17 @@ function mergeExtends(rulesConfList) {
94
97
  oas2Rules: {},
95
98
  oas3_0Rules: {},
96
99
  oas3_1Rules: {},
100
+ async2Rules: {},
97
101
  preprocessors: {},
98
102
  oas2Preprocessors: {},
99
103
  oas3_0Preprocessors: {},
100
104
  oas3_1Preprocessors: {},
105
+ async2Preprocessors: {},
101
106
  decorators: {},
102
107
  oas2Decorators: {},
103
108
  oas3_0Decorators: {},
104
109
  oas3_1Decorators: {},
110
+ async2Decorators: {},
105
111
  plugins: [],
106
112
  pluginPaths: [],
107
113
  extendPaths: [],
@@ -112,25 +118,31 @@ function mergeExtends(rulesConfList) {
112
118
  }
113
119
  Object.assign(result.rules, rulesConf.rules);
114
120
  Object.assign(result.oas2Rules, rulesConf.oas2Rules);
115
- utils_1.assignExisting(result.oas2Rules, rulesConf.rules || {});
121
+ (0, utils_1.assignExisting)(result.oas2Rules, rulesConf.rules || {});
116
122
  Object.assign(result.oas3_0Rules, rulesConf.oas3_0Rules);
117
- utils_1.assignExisting(result.oas3_0Rules, rulesConf.rules || {});
123
+ (0, utils_1.assignExisting)(result.oas3_0Rules, rulesConf.rules || {});
118
124
  Object.assign(result.oas3_1Rules, rulesConf.oas3_1Rules);
119
- utils_1.assignExisting(result.oas3_1Rules, rulesConf.rules || {});
125
+ (0, utils_1.assignExisting)(result.oas3_1Rules, rulesConf.rules || {});
126
+ Object.assign(result.async2Rules, rulesConf.async2Rules);
127
+ (0, utils_1.assignExisting)(result.async2Rules, rulesConf.rules || {});
120
128
  Object.assign(result.preprocessors, rulesConf.preprocessors);
121
129
  Object.assign(result.oas2Preprocessors, rulesConf.oas2Preprocessors);
122
- utils_1.assignExisting(result.oas2Preprocessors, rulesConf.preprocessors || {});
130
+ (0, utils_1.assignExisting)(result.oas2Preprocessors, rulesConf.preprocessors || {});
123
131
  Object.assign(result.oas3_0Preprocessors, rulesConf.oas3_0Preprocessors);
124
- utils_1.assignExisting(result.oas3_0Preprocessors, rulesConf.preprocessors || {});
132
+ (0, utils_1.assignExisting)(result.oas3_0Preprocessors, rulesConf.preprocessors || {});
125
133
  Object.assign(result.oas3_1Preprocessors, rulesConf.oas3_1Preprocessors);
126
- utils_1.assignExisting(result.oas3_1Preprocessors, rulesConf.preprocessors || {});
134
+ (0, utils_1.assignExisting)(result.oas3_1Preprocessors, rulesConf.preprocessors || {});
135
+ Object.assign(result.async2Preprocessors, rulesConf.async2Preprocessors);
136
+ (0, utils_1.assignExisting)(result.async2Preprocessors, rulesConf.preprocessors || {});
127
137
  Object.assign(result.decorators, rulesConf.decorators);
128
138
  Object.assign(result.oas2Decorators, rulesConf.oas2Decorators);
129
- utils_1.assignExisting(result.oas2Decorators, rulesConf.decorators || {});
139
+ (0, utils_1.assignExisting)(result.oas2Decorators, rulesConf.decorators || {});
130
140
  Object.assign(result.oas3_0Decorators, rulesConf.oas3_0Decorators);
131
- utils_1.assignExisting(result.oas3_0Decorators, rulesConf.decorators || {});
141
+ (0, utils_1.assignExisting)(result.oas3_0Decorators, rulesConf.decorators || {});
132
142
  Object.assign(result.oas3_1Decorators, rulesConf.oas3_1Decorators);
133
- utils_1.assignExisting(result.oas3_1Decorators, rulesConf.decorators || {});
143
+ (0, utils_1.assignExisting)(result.oas3_1Decorators, rulesConf.decorators || {});
144
+ Object.assign(result.async2Decorators, rulesConf.async2Decorators);
145
+ (0, utils_1.assignExisting)(result.async2Decorators, rulesConf.decorators || {});
134
146
  result.plugins.push(...(rulesConf.plugins || []));
135
147
  result.pluginPaths.push(...(rulesConf.pluginPaths || []));
136
148
  result.extendPaths.push(...new Set(rulesConf.extendPaths));
@@ -164,16 +176,16 @@ function checkForDeprecatedFields(deprecatedField, updatedField, rawConfig, upda
164
176
  const isDeprecatedFieldInApis = rawConfig.apis &&
165
177
  Object.values(rawConfig.apis).some((api) => api[deprecatedField]);
166
178
  if (rawConfig[deprecatedField] && updatedField === null) {
167
- utils_1.showWarningForDeprecatedField(deprecatedField);
179
+ (0, utils_1.showWarningForDeprecatedField)(deprecatedField);
168
180
  }
169
181
  if (rawConfig[deprecatedField] && updatedField && rawConfig[updatedField]) {
170
- utils_1.showErrorForDeprecatedField(deprecatedField, updatedField);
182
+ (0, utils_1.showErrorForDeprecatedField)(deprecatedField, updatedField);
171
183
  }
172
184
  if (rawConfig[deprecatedField] && updatedObject && rawConfig[updatedObject]) {
173
- utils_1.showErrorForDeprecatedField(deprecatedField, updatedField, updatedObject);
185
+ (0, utils_1.showErrorForDeprecatedField)(deprecatedField, updatedField, updatedObject);
174
186
  }
175
187
  if (rawConfig[deprecatedField] || isDeprecatedFieldInApis) {
176
- utils_1.showWarningForDeprecatedField(deprecatedField, updatedField, updatedObject);
188
+ (0, utils_1.showWarningForDeprecatedField)(deprecatedField, updatedField, updatedObject);
177
189
  }
178
190
  }
179
191
  exports.checkForDeprecatedFields = checkForDeprecatedFields;
@@ -8,7 +8,7 @@ function filter(node, ctx, criteria) {
8
8
  let didDelete = false;
9
9
  if (Array.isArray(node)) {
10
10
  for (let i = 0; i < node.length; i++) {
11
- if (ref_utils_1.isRef(node[i])) {
11
+ if ((0, ref_utils_1.isRef)(node[i])) {
12
12
  const resolved = ctx.resolve(node[i]);
13
13
  if (criteria(resolved.node)) {
14
14
  node.splice(i, 1);
@@ -23,10 +23,10 @@ function filter(node, ctx, criteria) {
23
23
  }
24
24
  }
25
25
  }
26
- else if (utils_1.isPlainObject(node)) {
26
+ else if ((0, utils_1.isPlainObject)(node)) {
27
27
  for (const key of Object.keys(node)) {
28
28
  node = node;
29
- if (ref_utils_1.isRef(node[key])) {
29
+ if ((0, ref_utils_1.isRef)(node[key])) {
30
30
  const resolved = ctx.resolve(node[key]);
31
31
  if (criteria(resolved.node)) {
32
32
  delete node[key];
@@ -39,7 +39,7 @@ function filter(node, ctx, criteria) {
39
39
  }
40
40
  }
41
41
  }
42
- if (didDelete && (utils_1.isEmptyObject(node) || utils_1.isEmptyArray(node))) {
42
+ if (didDelete && ((0, utils_1.isEmptyObject)(node) || (0, utils_1.isEmptyArray)(node))) {
43
43
  delete parent[key];
44
44
  }
45
45
  }
@@ -5,11 +5,11 @@ const filter_helper_1 = require("./filter-helper");
5
5
  const DEFAULT_STRATEGY = 'any';
6
6
  const FilterIn = ({ property, value, matchStrategy }) => {
7
7
  const strategy = matchStrategy || DEFAULT_STRATEGY;
8
- const filterInCriteria = (item) => (item === null || item === void 0 ? void 0 : item[property]) && !filter_helper_1.checkIfMatchByStrategy(item === null || item === void 0 ? void 0 : item[property], value, strategy);
8
+ const filterInCriteria = (item) => (item === null || item === void 0 ? void 0 : item[property]) && !(0, filter_helper_1.checkIfMatchByStrategy)(item === null || item === void 0 ? void 0 : item[property], value, strategy);
9
9
  return {
10
10
  any: {
11
11
  enter: (node, ctx) => {
12
- filter_helper_1.filter(node, ctx, filterInCriteria);
12
+ (0, filter_helper_1.filter)(node, ctx, filterInCriteria);
13
13
  },
14
14
  },
15
15
  };
@@ -5,11 +5,11 @@ const filter_helper_1 = require("./filter-helper");
5
5
  const DEFAULT_STRATEGY = 'any';
6
6
  const FilterOut = ({ property, value, matchStrategy }) => {
7
7
  const strategy = matchStrategy || DEFAULT_STRATEGY;
8
- const filterOutCriteria = (item) => filter_helper_1.checkIfMatchByStrategy(item === null || item === void 0 ? void 0 : item[property], value, strategy);
8
+ const filterOutCriteria = (item) => (0, filter_helper_1.checkIfMatchByStrategy)(item === null || item === void 0 ? void 0 : item[property], value, strategy);
9
9
  return {
10
10
  any: {
11
11
  enter: (node, ctx) => {
12
- filter_helper_1.filter(node, ctx, filterOutCriteria);
12
+ (0, filter_helper_1.filter)(node, ctx, filterOutCriteria);
13
13
  },
14
14
  },
15
15
  };
@@ -9,7 +9,7 @@ const InfoDescriptionOverride = ({ filePath }) => {
9
9
  if (!filePath)
10
10
  throw new Error(`Parameter "filePath" is not provided for "info-description-override" rule`);
11
11
  try {
12
- info.description = utils_1.readFileAsStringSync(filePath);
12
+ info.description = (0, utils_1.readFileAsStringSync)(filePath);
13
13
  }
14
14
  catch (e) {
15
15
  report({
@@ -23,7 +23,7 @@ const MediaTypeExamplesOverride = ({ operationIds }) => {
23
23
  }
24
24
  resolvedResponse.content = resolvedResponse.content ? resolvedResponse.content : {};
25
25
  Object.keys(properties.responses[responseCode]).forEach((mimeType) => {
26
- resolvedResponse.content[mimeType] = Object.assign(Object.assign({}, resolvedResponse.content[mimeType]), { examples: utils_1.yamlAndJsonSyncReader(properties.responses[responseCode][mimeType]) });
26
+ resolvedResponse.content[mimeType] = Object.assign(Object.assign({}, resolvedResponse.content[mimeType]), { examples: (0, utils_1.yamlAndJsonSyncReader)(properties.responses[responseCode][mimeType]) });
27
27
  });
28
28
  operation.responses[responseCode] = resolvedResponse;
29
29
  }
@@ -35,7 +35,7 @@ const MediaTypeExamplesOverride = ({ operationIds }) => {
35
35
  }
36
36
  resolvedRequest.content = resolvedRequest.content ? resolvedRequest.content : {};
37
37
  Object.keys(properties.request).forEach((mimeType) => {
38
- resolvedRequest.content[mimeType] = Object.assign(Object.assign({}, resolvedRequest.content[mimeType]), { examples: utils_1.yamlAndJsonSyncReader(properties.request[mimeType]) });
38
+ resolvedRequest.content[mimeType] = Object.assign(Object.assign({}, resolvedRequest.content[mimeType]), { examples: (0, utils_1.yamlAndJsonSyncReader)(properties.request[mimeType]) });
39
39
  });
40
40
  operation.requestBody = resolvedRequest;
41
41
  }
@@ -45,7 +45,7 @@ const MediaTypeExamplesOverride = ({ operationIds }) => {
45
45
  };
46
46
  exports.MediaTypeExamplesOverride = MediaTypeExamplesOverride;
47
47
  function checkAndResolveRef(node, resolver) {
48
- if (!ref_utils_1.isRef(node)) {
48
+ if (!(0, ref_utils_1.isRef)(node)) {
49
49
  return node;
50
50
  }
51
51
  const resolved = resolver(node);
@@ -13,7 +13,7 @@ const OperationDescriptionOverride = ({ operationIds }) => {
13
13
  const operationId = operation.operationId;
14
14
  if (operationIds[operationId]) {
15
15
  try {
16
- operation.description = utils_1.readFileAsStringSync(operationIds[operationId]);
16
+ operation.description = (0, utils_1.readFileAsStringSync)(operationIds[operationId]);
17
17
  }
18
18
  catch (e) {
19
19
  report({
@@ -14,7 +14,7 @@ const RegistryDependencies = () => {
14
14
  ref(node) {
15
15
  if (node.$ref) {
16
16
  const link = node.$ref.split('#/')[0];
17
- if (redocly_1.isRedoclyRegistryURL(link)) {
17
+ if ((0, redocly_1.isRedoclyRegistryURL)(link)) {
18
18
  registryDependencies.add(link);
19
19
  }
20
20
  }
@@ -12,7 +12,7 @@ const RemoveXInternal = ({ internalFlagProperty }) => {
12
12
  let didDelete = false;
13
13
  if (Array.isArray(node)) {
14
14
  for (let i = 0; i < node.length; i++) {
15
- if (ref_utils_1.isRef(node[i])) {
15
+ if ((0, ref_utils_1.isRef)(node[i])) {
16
16
  const resolved = ctx.resolve(node[i]);
17
17
  if ((_a = resolved.node) === null || _a === void 0 ? void 0 : _a[hiddenTag]) {
18
18
  node.splice(i, 1);
@@ -27,10 +27,10 @@ const RemoveXInternal = ({ internalFlagProperty }) => {
27
27
  }
28
28
  }
29
29
  }
30
- else if (utils_1.isPlainObject(node)) {
30
+ else if ((0, utils_1.isPlainObject)(node)) {
31
31
  for (const key of Object.keys(node)) {
32
32
  node = node;
33
- if (ref_utils_1.isRef(node[key])) {
33
+ if ((0, ref_utils_1.isRef)(node[key])) {
34
34
  const resolved = ctx.resolve(node[key]);
35
35
  if ((_c = resolved.node) === null || _c === void 0 ? void 0 : _c[hiddenTag]) {
36
36
  delete node[key];
@@ -43,7 +43,7 @@ const RemoveXInternal = ({ internalFlagProperty }) => {
43
43
  }
44
44
  }
45
45
  }
46
- if (didDelete && (utils_1.isEmptyObject(node) || utils_1.isEmptyArray(node))) {
46
+ if (didDelete && ((0, utils_1.isEmptyObject)(node) || (0, utils_1.isEmptyArray)(node))) {
47
47
  delete parent[key];
48
48
  }
49
49
  }
@@ -10,7 +10,7 @@ const TagDescriptionOverride = ({ tagNames }) => {
10
10
  throw new Error(`Parameter "tagNames" is not provided for "tag-description-override" rule`);
11
11
  if (tagNames[tag.name]) {
12
12
  try {
13
- tag.description = utils_1.readFileAsStringSync(tagNames[tag.name]);
13
+ tag.description = (0, utils_1.readFileAsStringSync)(tagNames[tag.name]);
14
14
  }
15
15
  catch (e) {
16
16
  report({
@@ -1,21 +1,21 @@
1
1
  import * as yamlAst from 'yaml-ast-parser';
2
2
  import { LineColLocationObject, LocationObject } from '../walk';
3
- declare type YAMLMapping = yamlAst.YAMLMapping & {
3
+ type YAMLMapping = yamlAst.YAMLMapping & {
4
4
  kind: yamlAst.Kind.MAPPING;
5
5
  };
6
- declare type YAMLMap = yamlAst.YamlMap & {
6
+ type YAMLMap = yamlAst.YamlMap & {
7
7
  kind: yamlAst.Kind.MAP;
8
8
  };
9
- declare type YAMLAnchorReference = yamlAst.YAMLAnchorReference & {
9
+ type YAMLAnchorReference = yamlAst.YAMLAnchorReference & {
10
10
  kind: yamlAst.Kind.ANCHOR_REF;
11
11
  };
12
- declare type YAMLSequence = yamlAst.YAMLSequence & {
12
+ type YAMLSequence = yamlAst.YAMLSequence & {
13
13
  kind: yamlAst.Kind.SEQ;
14
14
  };
15
- declare type YAMLScalar = yamlAst.YAMLScalar & {
15
+ type YAMLScalar = yamlAst.YAMLScalar & {
16
16
  kind: yamlAst.Kind.SCALAR;
17
17
  };
18
- declare type YAMLNode = YAMLMapping | YAMLMap | YAMLAnchorReference | YAMLSequence | YAMLScalar;
18
+ type YAMLNode = YAMLMapping | YAMLMap | YAMLAnchorReference | YAMLSequence | YAMLScalar;
19
19
  export declare function getCodeframe(location: LineColLocationObject, color: boolean): string;
20
20
  export declare function getLineColLocation(location: LocationObject): LineColLocationObject;
21
21
  export declare function getAstNodeByPointer(root: YAMLNode, pointer: string, reportOnKey: boolean): YAMLMapping | YAMLMap | YAMLAnchorReference | YAMLSequence | yamlAst.YAMLScalar | undefined;
@@ -1,10 +1,10 @@
1
1
  import { NormalizedProblem } from '../walk';
2
- export declare type Totals = {
2
+ export type Totals = {
3
3
  errors: number;
4
4
  warnings: number;
5
5
  ignored: number;
6
6
  };
7
- export declare type OutputFormat = 'codeframe' | 'stylish' | 'json' | 'checkstyle' | 'codeclimate' | 'summary';
7
+ export type OutputFormat = 'codeframe' | 'stylish' | 'json' | 'checkstyle' | 'codeclimate' | 'summary';
8
8
  export declare function getTotals(problems: (NormalizedProblem & {
9
9
  ignored?: boolean;
10
10
  })[]): Totals;
@@ -76,7 +76,7 @@ function formatProblems(problems, opts) {
76
76
  case 'stylish': {
77
77
  const groupedByFile = groupByFiles(problems);
78
78
  for (const [file, { ruleIdPad, locationPad: positionPad, fileProblems }] of Object.entries(groupedByFile)) {
79
- logger_1.logger.info(`${logger_1.colorize.blue(ref_utils_1.isAbsoluteUrl(file) ? file : path.relative(cwd, file))}:\n`);
79
+ logger_1.logger.info(`${logger_1.colorize.blue((0, ref_utils_1.isAbsoluteUrl)(file) ? file : path.relative(cwd, file))}:\n`);
80
80
  for (let i = 0; i < fileProblems.length; i++) {
81
81
  const problem = fileProblems[i];
82
82
  logger_1.logger.info(`${formatStylish(problem, positionPad, ruleIdPad)}\n`);
@@ -90,7 +90,7 @@ function formatProblems(problems, opts) {
90
90
  output_1.output.write('<?xml version="1.0" encoding="UTF-8"?>\n');
91
91
  output_1.output.write('<checkstyle version="4.3">\n');
92
92
  for (const [file, { fileProblems }] of Object.entries(groupedByFile)) {
93
- output_1.output.write(`<file name="${xmlEscape(ref_utils_1.isAbsoluteUrl(file) ? file : path.relative(cwd, file))}">\n`);
93
+ output_1.output.write(`<file name="${xmlEscape((0, ref_utils_1.isAbsoluteUrl)(file) ? file : path.relative(cwd, file))}">\n`);
94
94
  fileProblems.forEach(formatCheckstyle);
95
95
  output_1.output.write(`</file>\n`);
96
96
  }
@@ -110,11 +110,11 @@ function formatProblems(problems, opts) {
110
110
  function outputForCodeClimate() {
111
111
  const issues = problems.map((p) => {
112
112
  const location = p.location[0]; // TODO: support multiple location
113
- const lineCol = codeframes_1.getLineColLocation(location);
113
+ const lineCol = (0, codeframes_1.getLineColLocation)(location);
114
114
  return {
115
115
  description: p.message,
116
116
  location: {
117
- path: ref_utils_1.isAbsoluteUrl(location.source.absoluteRef)
117
+ path: (0, ref_utils_1.isAbsoluteUrl)(location.source.absoluteRef)
118
118
  ? location.source.absoluteRef
119
119
  : path.relative(cwd, location.source.absoluteRef),
120
120
  lines: {
@@ -134,19 +134,19 @@ function formatProblems(problems, opts) {
134
134
  problems: problems.map((p) => {
135
135
  var _a, _b, _c;
136
136
  const problem = Object.assign(Object.assign({}, p), { location: p.location.map((location) => (Object.assign(Object.assign({}, location), { source: {
137
- ref: ref_utils_1.isAbsoluteUrl(location.source.absoluteRef)
137
+ ref: (0, ref_utils_1.isAbsoluteUrl)(location.source.absoluteRef)
138
138
  ? location.source.absoluteRef
139
139
  : path.relative(cwd, location.source.absoluteRef),
140
140
  } }))), from: p.from
141
141
  ? Object.assign(Object.assign({}, p.from), { source: {
142
- ref: ref_utils_1.isAbsoluteUrl((_a = p.from) === null || _a === void 0 ? void 0 : _a.source.absoluteRef)
142
+ ref: (0, ref_utils_1.isAbsoluteUrl)((_a = p.from) === null || _a === void 0 ? void 0 : _a.source.absoluteRef)
143
143
  ? (_b = p.from) === null || _b === void 0 ? void 0 : _b.source.absoluteRef
144
144
  : path.relative(cwd, ((_c = p.from) === null || _c === void 0 ? void 0 : _c.source.absoluteRef) || cwd),
145
145
  } }) : undefined });
146
146
  if (env_1.env.FORMAT_JSON_WITH_CODEFRAMES) {
147
147
  const location = p.location[0]; // TODO: support multiple locations
148
- const loc = codeframes_1.getLineColLocation(location);
149
- problem.codeframe = codeframes_1.getCodeframe(loc, color);
148
+ const loc = (0, codeframes_1.getLineColLocation)(location);
149
+ problem.codeframe = (0, codeframes_1.getCodeframe)(loc, color);
150
150
  }
151
151
  return problem;
152
152
  }),
@@ -163,16 +163,16 @@ function formatProblems(problems, opts) {
163
163
  function formatCodeframe(problem, idx) {
164
164
  const bgColor = getBgColor(problem);
165
165
  const location = problem.location[0]; // TODO: support multiple locations
166
- const relativePath = ref_utils_1.isAbsoluteUrl(location.source.absoluteRef)
166
+ const relativePath = (0, ref_utils_1.isAbsoluteUrl)(location.source.absoluteRef)
167
167
  ? location.source.absoluteRef
168
168
  : path.relative(cwd, location.source.absoluteRef);
169
- const loc = codeframes_1.getLineColLocation(location);
169
+ const loc = (0, codeframes_1.getLineColLocation)(location);
170
170
  const atPointer = location.pointer ? logger_1.colorize.gray(`at ${location.pointer}`) : '';
171
171
  const fileWithLoc = `${relativePath}:${loc.start.line}:${loc.start.col}`;
172
172
  return (`[${idx + 1}] ${bgColor(fileWithLoc)} ${atPointer}\n\n` +
173
173
  `${problem.message}\n\n` +
174
174
  formatDidYouMean(problem) +
175
- codeframes_1.getCodeframe(loc, color) +
175
+ (0, codeframes_1.getCodeframe)(loc, color) +
176
176
  '\n\n' +
177
177
  formatFrom(cwd, problem.from) +
178
178
  `${SEVERITY_NAMES[problem.severity]} was generated by the ${logger_1.colorize.blue(problem.ruleId)} rule.\n\n`);
@@ -216,7 +216,7 @@ function formatFrom(cwd, location) {
216
216
  if (!location)
217
217
  return '';
218
218
  const relativePath = path.relative(cwd, location.source.absoluteRef);
219
- const loc = codeframes_1.getLineColLocation(location);
219
+ const loc = (0, codeframes_1.getLineColLocation)(location);
220
220
  const fileWithLoc = `${relativePath}:${loc.start.line}:${loc.start.col}`;
221
221
  const atPointer = location.pointer ? logger_1.colorize.gray(`at ${location.pointer}`) : '';
222
222
  return `referenced from ${logger_1.colorize.blue(fileWithLoc)} ${atPointer} \n\n`;
@@ -1,3 +1,3 @@
1
1
  import { LoadOptions, DumpOptions } from 'js-yaml';
2
- export declare const parseYaml: (str: string, opts?: LoadOptions | undefined) => unknown;
3
- export declare const stringifyYaml: (obj: any, opts?: DumpOptions | undefined) => string;
2
+ export declare const parseYaml: (str: string, opts?: LoadOptions) => unknown;
3
+ export declare const stringifyYaml: (obj: any, opts?: DumpOptions) => string;
@@ -9,7 +9,7 @@ const DEFAULT_SCHEMA_WITHOUT_TIMESTAMP = js_yaml_1.JSON_SCHEMA.extend({
9
9
  implicit: [js_yaml_1.types.merge],
10
10
  explicit: [js_yaml_1.types.binary, js_yaml_1.types.omap, js_yaml_1.types.pairs, js_yaml_1.types.set],
11
11
  });
12
- const parseYaml = (str, opts) => js_yaml_1.load(str, Object.assign({ schema: DEFAULT_SCHEMA_WITHOUT_TIMESTAMP }, opts));
12
+ const parseYaml = (str, opts) => (0, js_yaml_1.load)(str, Object.assign({ schema: DEFAULT_SCHEMA_WITHOUT_TIMESTAMP }, opts));
13
13
  exports.parseYaml = parseYaml;
14
- const stringifyYaml = (obj, opts) => js_yaml_1.dump(obj, opts);
14
+ const stringifyYaml = (obj, opts) => (0, js_yaml_1.dump)(obj, opts);
15
15
  exports.stringifyYaml = stringifyYaml;