@redocly/openapi-core 1.18.0 → 1.19.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 (151) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/lib/benchmark/benches/lint-with-many-rules.bench.js +2 -2
  3. package/lib/benchmark/benches/lint-with-nested-rule.bench.js +2 -2
  4. package/lib/benchmark/benches/lint-with-no-rules.bench.js +2 -2
  5. package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.js +2 -2
  6. package/lib/benchmark/benches/lint-with-top-level-rule.bench.js +2 -2
  7. package/lib/benchmark/benches/recommended-oas3.bench.js +2 -2
  8. package/lib/benchmark/benches/resolve-with-no-external.bench.js +2 -2
  9. package/lib/benchmark/utils.js +7 -4
  10. package/lib/bundle.d.ts +3 -3
  11. package/lib/bundle.js +128 -122
  12. package/lib/config/all.js +9 -0
  13. package/lib/config/builtIn.js +7 -1
  14. package/lib/config/config-resolvers.js +179 -138
  15. package/lib/config/config.d.ts +2 -2
  16. package/lib/config/config.js +53 -34
  17. package/lib/config/load.d.ts +1 -2
  18. package/lib/config/load.js +105 -117
  19. package/lib/config/minimal.js +9 -0
  20. package/lib/config/recommended-strict.js +9 -0
  21. package/lib/config/recommended.js +9 -0
  22. package/lib/config/rules.d.ts +3 -3
  23. package/lib/config/rules.js +1 -2
  24. package/lib/config/types.d.ts +9 -3
  25. package/lib/config/utils.js +70 -49
  26. package/lib/decorators/async3/index.d.ts +1 -0
  27. package/lib/decorators/async3/index.js +4 -0
  28. package/lib/decorators/common/filters/filter-helper.js +2 -3
  29. package/lib/decorators/common/filters/filter-in.js +1 -1
  30. package/lib/decorators/common/filters/filter-out.js +1 -1
  31. package/lib/decorators/common/info-override.js +1 -12
  32. package/lib/decorators/common/media-type-examples-override.js +8 -2
  33. package/lib/decorators/common/remove-x-internal.js +4 -5
  34. package/lib/decorators/oas2/remove-unused-components.js +1 -2
  35. package/lib/decorators/oas3/remove-unused-components.js +1 -2
  36. package/lib/env.d.ts +0 -1
  37. package/lib/env.js +1 -1
  38. package/lib/format/codeframes.js +10 -8
  39. package/lib/format/format.js +23 -15
  40. package/lib/index.d.ts +2 -1
  41. package/lib/index.js +6 -4
  42. package/lib/js-yaml/index.js +1 -1
  43. package/lib/lint.d.ts +2 -0
  44. package/lib/lint.js +92 -99
  45. package/lib/oas-types.d.ts +9 -5
  46. package/lib/oas-types.js +22 -12
  47. package/lib/redocly/domains.js +6 -6
  48. package/lib/redocly/index.js +60 -73
  49. package/lib/redocly/registry-api.js +64 -82
  50. package/lib/ref-utils.js +13 -13
  51. package/lib/resolve.js +186 -205
  52. package/lib/rules/ajv.js +10 -8
  53. package/lib/rules/async3/channels-kebab-case.d.ts +2 -0
  54. package/lib/rules/async3/channels-kebab-case.js +19 -0
  55. package/lib/rules/async3/index.d.ts +3 -0
  56. package/lib/rules/async3/index.js +22 -0
  57. package/lib/rules/async3/no-channel-trailing-slash.d.ts +2 -0
  58. package/lib/rules/async3/no-channel-trailing-slash.js +16 -0
  59. package/lib/rules/common/assertions/asserts.js +5 -5
  60. package/lib/rules/common/assertions/index.d.ts +5 -4
  61. package/lib/rules/common/assertions/utils.js +43 -28
  62. package/lib/rules/common/no-invalid-parameter-examples.js +1 -2
  63. package/lib/rules/common/no-invalid-schema-examples.js +1 -2
  64. package/lib/rules/common/no-required-schema-properties-undefined.js +1 -2
  65. package/lib/rules/common/operation-tag-defined.js +1 -2
  66. package/lib/rules/common/path-http-verbs-order.js +1 -1
  67. package/lib/rules/common/path-segment-plural.js +2 -1
  68. package/lib/rules/common/required-string-property-missing-min-length.js +2 -2
  69. package/lib/rules/common/response-contains-header.js +2 -2
  70. package/lib/rules/common/security-defined.js +3 -7
  71. package/lib/rules/common/spec.d.ts +2 -2
  72. package/lib/rules/common/spec.js +6 -7
  73. package/lib/rules/no-unresolved-refs.js +3 -4
  74. package/lib/rules/oas2/response-contains-property.js +1 -2
  75. package/lib/rules/oas3/array-parameter-serialization.js +1 -2
  76. package/lib/rules/oas3/component-name-unique.js +2 -4
  77. package/lib/rules/oas3/no-invalid-media-type-examples.js +1 -2
  78. package/lib/rules/oas3/no-server-variables-empty-enum.js +1 -2
  79. package/lib/rules/oas3/no-undefined-server-variable.js +2 -3
  80. package/lib/rules/oas3/no-unused-components.js +1 -2
  81. package/lib/rules/oas3/response-contains-property.js +1 -2
  82. package/lib/rules/utils.js +14 -12
  83. package/lib/types/arazzo.d.ts +1299 -73
  84. package/lib/types/arazzo.js +41 -36
  85. package/lib/types/asyncapi2.d.ts +17 -0
  86. package/lib/types/{asyncapi.js → asyncapi2.js} +71 -93
  87. package/lib/types/asyncapi3.d.ts +2 -0
  88. package/lib/types/asyncapi3.js +347 -0
  89. package/lib/types/index.js +19 -10
  90. package/lib/types/json-schema-adapter.js +4 -18
  91. package/lib/types/oas2.js +6 -6
  92. package/lib/types/oas3.js +10 -10
  93. package/lib/types/oas3_1.js +15 -9
  94. package/lib/types/redocly-yaml.d.ts +3 -1
  95. package/lib/types/redocly-yaml.js +131 -35
  96. package/lib/typings/arazzo.d.ts +28 -1
  97. package/lib/typings/asyncapi3.d.ts +53 -0
  98. package/lib/typings/asyncapi3.js +2 -0
  99. package/lib/utils.d.ts +12 -7
  100. package/lib/utils.js +91 -77
  101. package/lib/visitors.d.ts +11 -0
  102. package/lib/visitors.js +21 -8
  103. package/lib/walk.js +30 -23
  104. package/package.json +3 -3
  105. package/src/__tests__/bundle.test.ts +142 -0
  106. package/src/__tests__/lint.test.ts +0 -50
  107. package/src/bundle.ts +19 -6
  108. package/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +22 -0
  109. package/src/config/__tests__/__snapshots__/config.test.ts.snap +24 -0
  110. package/src/config/__tests__/config.test.ts +11 -0
  111. package/src/config/all.ts +9 -0
  112. package/src/config/builtIn.ts +6 -0
  113. package/src/config/config-resolvers.ts +15 -2
  114. package/src/config/config.ts +24 -5
  115. package/src/config/load.ts +1 -2
  116. package/src/config/minimal.ts +9 -0
  117. package/src/config/recommended-strict.ts +9 -0
  118. package/src/config/recommended.ts +9 -0
  119. package/src/config/rules.ts +12 -4
  120. package/src/config/types.ts +15 -2
  121. package/src/config/utils.ts +15 -0
  122. package/src/decorators/async3/index.ts +1 -0
  123. package/src/decorators/common/remove-x-internal.ts +2 -2
  124. package/src/index.ts +2 -1
  125. package/src/lint.ts +26 -3
  126. package/src/oas-types.ts +31 -13
  127. package/src/rules/arazzo/index.ts +1 -1
  128. package/src/rules/async2/index.ts +5 -5
  129. package/src/rules/async3/__tests__/channels-kebab-case.test.ts +141 -0
  130. package/src/rules/async3/__tests__/no-channel-trailing-slash.test.ts +96 -0
  131. package/src/rules/async3/channels-kebab-case.ts +19 -0
  132. package/src/rules/async3/index.ts +23 -0
  133. package/src/rules/async3/no-channel-trailing-slash.ts +16 -0
  134. package/src/rules/common/__tests__/spec.test.ts +47 -0
  135. package/src/rules/common/assertions/index.ts +13 -4
  136. package/src/rules/common/no-invalid-schema-examples.ts +3 -2
  137. package/src/rules/common/path-segment-plural.ts +3 -2
  138. package/src/rules/common/spec.ts +2 -2
  139. package/src/rules/oas2/index.ts +4 -4
  140. package/src/rules/oas3/index.ts +39 -37
  141. package/src/types/arazzo.ts +28 -23
  142. package/src/types/{asyncapi.ts → asyncapi2.ts} +58 -76
  143. package/src/types/asyncapi3.ts +381 -0
  144. package/src/types/oas3_1.ts +3 -2
  145. package/src/types/redocly-yaml.ts +14 -0
  146. package/src/typings/arazzo.ts +41 -1
  147. package/src/typings/asyncapi3.ts +61 -0
  148. package/src/utils.ts +46 -11
  149. package/src/visitors.ts +18 -0
  150. package/tsconfig.tsbuildinfo +1 -1
  151. package/lib/types/asyncapi.d.ts +0 -2
@@ -1,17 +1,16 @@
1
1
  "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.deepCloneMapWithJSON = exports.ConfigValidationError = exports.getUniquePlugins = exports.getResolveConfig = exports.transformConfig = exports.checkForDeprecatedFields = exports.getMergedConfig = exports.mergeExtends = exports.prefixRules = exports.transformApiDefinitionsToApis = exports.parsePresetName = void 0;
3
+ exports.ConfigValidationError = void 0;
4
+ exports.parsePresetName = parsePresetName;
5
+ exports.transformApiDefinitionsToApis = transformApiDefinitionsToApis;
6
+ exports.prefixRules = prefixRules;
7
+ exports.mergeExtends = mergeExtends;
8
+ exports.getMergedConfig = getMergedConfig;
9
+ exports.checkForDeprecatedFields = checkForDeprecatedFields;
10
+ exports.transformConfig = transformConfig;
11
+ exports.getResolveConfig = getResolveConfig;
12
+ exports.getUniquePlugins = getUniquePlugins;
13
+ exports.deepCloneMapWithJSON = deepCloneMapWithJSON;
15
14
  const utils_1 = require("../utils");
16
15
  const config_1 = require("./config");
17
16
  const logger_1 = require("../logger");
@@ -24,7 +23,6 @@ function parsePresetName(presetName) {
24
23
  return { pluginId: '', configName: presetName };
25
24
  }
26
25
  }
27
- exports.parsePresetName = parsePresetName;
28
26
  function transformApiDefinitionsToApis(apiDefinitions) {
29
27
  if (!apiDefinitions)
30
28
  return undefined;
@@ -34,10 +32,7 @@ function transformApiDefinitionsToApis(apiDefinitions) {
34
32
  }
35
33
  return apis;
36
34
  }
37
- exports.transformApiDefinitionsToApis = transformApiDefinitionsToApis;
38
- function extractFlatConfig(_a) {
39
- var _b;
40
- var { plugins, extends: _extends, rules, oas2Rules, oas3_0Rules, oas3_1Rules, async2Rules, arazzoRules, preprocessors, oas2Preprocessors, oas3_0Preprocessors, oas3_1Preprocessors, async2Preprocessors, arazzoPreprocessors, decorators, oas2Decorators, oas3_0Decorators, oas3_1Decorators, async2Decorators, arazzoDecorators } = _a, rawConfigRest = __rest(_a, ["plugins", "extends", "rules", "oas2Rules", "oas3_0Rules", "oas3_1Rules", "async2Rules", "arazzoRules", "preprocessors", "oas2Preprocessors", "oas3_0Preprocessors", "oas3_1Preprocessors", "async2Preprocessors", "arazzoPreprocessors", "decorators", "oas2Decorators", "oas3_0Decorators", "oas3_1Decorators", "async2Decorators", "arazzoDecorators"]);
35
+ function extractFlatConfig({ plugins, extends: _extends, rules, oas2Rules, oas3_0Rules, oas3_1Rules, async2Rules, async3Rules, arazzoRules, preprocessors, oas2Preprocessors, oas3_0Preprocessors, oas3_1Preprocessors, async2Preprocessors, async3Preprocessors, arazzoPreprocessors, decorators, oas2Decorators, oas3_0Decorators, oas3_1Decorators, async2Decorators, async3Decorators, arazzoDecorators, ...rawConfigRest }) {
41
36
  const styleguideConfig = {
42
37
  plugins,
43
38
  extends: _extends,
@@ -46,20 +41,23 @@ function extractFlatConfig(_a) {
46
41
  oas3_0Rules,
47
42
  oas3_1Rules,
48
43
  async2Rules,
44
+ async3Rules,
49
45
  arazzoRules,
50
46
  preprocessors,
51
47
  oas2Preprocessors,
52
48
  oas3_0Preprocessors,
53
49
  oas3_1Preprocessors,
54
50
  async2Preprocessors,
51
+ async3Preprocessors,
55
52
  arazzoPreprocessors,
56
53
  decorators,
57
54
  oas2Decorators,
58
55
  oas3_0Decorators,
59
56
  oas3_1Decorators,
60
57
  async2Decorators,
58
+ async3Decorators,
61
59
  arazzoDecorators,
62
- doNotResolveExamples: (_b = rawConfigRest.resolve) === null || _b === void 0 ? void 0 : _b.doNotResolveExamples,
60
+ doNotResolveExamples: rawConfigRest.resolve?.doNotResolveExamples,
63
61
  };
64
62
  if ((rawConfigRest.lint && rawConfigRest.styleguide) ||
65
63
  (Object.values(styleguideConfig).some(utils_1.isDefined) &&
@@ -77,10 +75,12 @@ function transformApis(legacyApis) {
77
75
  if (!legacyApis)
78
76
  return undefined;
79
77
  const apis = {};
80
- for (let _a of Object.entries(legacyApis)) {
81
- const [apiName, _b] = _a, { lint } = _b, apiContent = __rest(_b, ["lint"]);
78
+ for (const [apiName, { lint, ...apiContent }] of Object.entries(legacyApis)) {
82
79
  const { styleguideConfig, rawConfigRest } = extractFlatConfig(apiContent);
83
- apis[apiName] = Object.assign({ styleguide: styleguideConfig || lint }, rawConfigRest);
80
+ apis[apiName] = {
81
+ styleguide: styleguideConfig || lint,
82
+ ...rawConfigRest,
83
+ };
84
84
  }
85
85
  return apis;
86
86
  }
@@ -93,7 +93,6 @@ function prefixRules(rules, prefix) {
93
93
  }
94
94
  return res;
95
95
  }
96
- exports.prefixRules = prefixRules;
97
96
  function mergeExtends(rulesConfList) {
98
97
  const result = {
99
98
  rules: {},
@@ -101,18 +100,21 @@ function mergeExtends(rulesConfList) {
101
100
  oas3_0Rules: {},
102
101
  oas3_1Rules: {},
103
102
  async2Rules: {},
103
+ async3Rules: {},
104
104
  arazzoRules: {},
105
105
  preprocessors: {},
106
106
  oas2Preprocessors: {},
107
107
  oas3_0Preprocessors: {},
108
108
  oas3_1Preprocessors: {},
109
109
  async2Preprocessors: {},
110
+ async3Preprocessors: {},
110
111
  arazzoPreprocessors: {},
111
112
  decorators: {},
112
113
  oas2Decorators: {},
113
114
  oas3_0Decorators: {},
114
115
  oas3_1Decorators: {},
115
116
  async2Decorators: {},
117
+ async3Decorators: {},
116
118
  arazzoDecorators: {},
117
119
  plugins: [],
118
120
  pluginPaths: [],
@@ -131,6 +133,8 @@ function mergeExtends(rulesConfList) {
131
133
  (0, utils_1.assignExisting)(result.oas3_1Rules, rulesConf.rules || {});
132
134
  Object.assign(result.async2Rules, rulesConf.async2Rules);
133
135
  (0, utils_1.assignExisting)(result.async2Rules, rulesConf.rules || {});
136
+ Object.assign(result.async3Rules, rulesConf.async3Rules);
137
+ (0, utils_1.assignExisting)(result.async3Rules, rulesConf.rules || {});
134
138
  Object.assign(result.arazzoRules, rulesConf.arazzoRules);
135
139
  (0, utils_1.assignExisting)(result.arazzoRules, rulesConf.rules || {});
136
140
  Object.assign(result.preprocessors, rulesConf.preprocessors);
@@ -142,6 +146,8 @@ function mergeExtends(rulesConfList) {
142
146
  (0, utils_1.assignExisting)(result.oas3_1Preprocessors, rulesConf.preprocessors || {});
143
147
  Object.assign(result.async2Preprocessors, rulesConf.async2Preprocessors);
144
148
  (0, utils_1.assignExisting)(result.async2Preprocessors, rulesConf.preprocessors || {});
149
+ Object.assign(result.async3Preprocessors, rulesConf.async3Preprocessors);
150
+ (0, utils_1.assignExisting)(result.async3Preprocessors, rulesConf.preprocessors || {});
145
151
  Object.assign(result.arazzoPreprocessors, rulesConf.arazzoPreprocessors);
146
152
  (0, utils_1.assignExisting)(result.arazzoPreprocessors, rulesConf.preprocessors || {});
147
153
  Object.assign(result.decorators, rulesConf.decorators);
@@ -153,6 +159,8 @@ function mergeExtends(rulesConfList) {
153
159
  (0, utils_1.assignExisting)(result.oas3_1Decorators, rulesConf.decorators || {});
154
160
  Object.assign(result.async2Decorators, rulesConf.async2Decorators);
155
161
  (0, utils_1.assignExisting)(result.async2Decorators, rulesConf.decorators || {});
162
+ Object.assign(result.async3Decorators, rulesConf.async3Decorators);
163
+ (0, utils_1.assignExisting)(result.async3Decorators, rulesConf.decorators || {});
156
164
  Object.assign(result.arazzoDecorators, rulesConf.arazzoDecorators);
157
165
  (0, utils_1.assignExisting)(result.arazzoDecorators, rulesConf.decorators || {});
158
166
  result.plugins.push(...(rulesConf.plugins || []));
@@ -161,29 +169,38 @@ function mergeExtends(rulesConfList) {
161
169
  }
162
170
  return result;
163
171
  }
164
- exports.mergeExtends = mergeExtends;
165
172
  function getMergedConfig(config, apiName) {
166
- var _a, _b, _c, _d, _e, _f, _g, _h;
167
173
  const extendPaths = [
168
- ...Object.values(config.apis).map((api) => { var _a; return (_a = api === null || api === void 0 ? void 0 : api.styleguide) === null || _a === void 0 ? void 0 : _a.extendPaths; }),
169
- (_b = (_a = config.rawConfig) === null || _a === void 0 ? void 0 : _a.styleguide) === null || _b === void 0 ? void 0 : _b.extendPaths,
174
+ ...Object.values(config.apis).map((api) => api?.styleguide?.extendPaths),
175
+ config.rawConfig?.styleguide?.extendPaths,
170
176
  ]
171
177
  .flat()
172
178
  .filter(utils_1.isTruthy);
173
179
  const pluginPaths = [
174
- ...Object.values(config.apis).map((api) => { var _a; return (_a = api === null || api === void 0 ? void 0 : api.styleguide) === null || _a === void 0 ? void 0 : _a.pluginPaths; }),
175
- (_d = (_c = config.rawConfig) === null || _c === void 0 ? void 0 : _c.styleguide) === null || _d === void 0 ? void 0 : _d.pluginPaths,
180
+ ...Object.values(config.apis).map((api) => api?.styleguide?.pluginPaths),
181
+ config.rawConfig?.styleguide?.pluginPaths,
176
182
  ]
177
183
  .flat()
178
184
  .filter(utils_1.isTruthy);
179
185
  return apiName
180
- ? new config_1.Config(Object.assign(Object.assign({}, config.rawConfig), { styleguide: Object.assign(Object.assign({}, (config.apis[apiName]
181
- ? config.apis[apiName].styleguide
182
- : config.rawConfig.styleguide)), { extendPaths,
183
- pluginPaths }), theme: Object.assign(Object.assign({}, config.rawConfig.theme), (_e = config.apis[apiName]) === null || _e === void 0 ? void 0 : _e.theme), files: [...config.files, ...((_h = (_g = (_f = config.apis) === null || _f === void 0 ? void 0 : _f[apiName]) === null || _g === void 0 ? void 0 : _g.files) !== null && _h !== void 0 ? _h : [])] }), config.configFile)
186
+ ? new config_1.Config({
187
+ ...config.rawConfig,
188
+ styleguide: {
189
+ ...(config.apis[apiName]
190
+ ? config.apis[apiName].styleguide
191
+ : config.rawConfig.styleguide),
192
+ extendPaths,
193
+ pluginPaths,
194
+ },
195
+ theme: {
196
+ ...config.rawConfig.theme,
197
+ ...config.apis[apiName]?.theme,
198
+ },
199
+ files: [...config.files, ...(config.apis?.[apiName]?.files ?? [])],
200
+ // TODO: merge everything else here
201
+ }, config.configFile)
184
202
  : config;
185
203
  }
186
- exports.getMergedConfig = getMergedConfig;
187
204
  function checkForDeprecatedFields(deprecatedField, updatedField, rawConfig, updatedObject) {
188
205
  const isDeprecatedFieldInApis = rawConfig.apis &&
189
206
  Object.values(rawConfig.apis).some((api) => api[deprecatedField]);
@@ -200,9 +217,7 @@ function checkForDeprecatedFields(deprecatedField, updatedField, rawConfig, upda
200
217
  (0, utils_1.showWarningForDeprecatedField)(deprecatedField, updatedField, updatedObject);
201
218
  }
202
219
  }
203
- exports.checkForDeprecatedFields = checkForDeprecatedFields;
204
220
  function transformConfig(rawConfig) {
205
- var _a, _b;
206
221
  const migratedFields = [
207
222
  ['apiDefinitions', 'apis', undefined],
208
223
  ['referenceDocs', 'openapi', 'theme'],
@@ -213,21 +228,31 @@ function transformConfig(rawConfig) {
213
228
  for (const [deprecatedField, updatedField, updatedObject] of migratedFields) {
214
229
  checkForDeprecatedFields(deprecatedField, updatedField, rawConfig, updatedObject);
215
230
  }
216
- const { apis, apiDefinitions, referenceDocs, lint } = rawConfig, rest = __rest(rawConfig, ["apis", "apiDefinitions", "referenceDocs", "lint"]);
231
+ const { apis, apiDefinitions, referenceDocs, lint, ...rest } = rawConfig;
217
232
  const { styleguideConfig, rawConfigRest } = extractFlatConfig(rest);
218
- const transformedConfig = Object.assign({ theme: {
219
- openapi: Object.assign(Object.assign(Object.assign({}, referenceDocs), rawConfig['features.openapi']), (_a = rawConfig.theme) === null || _a === void 0 ? void 0 : _a.openapi),
220
- mockServer: Object.assign(Object.assign({}, rawConfig['features.mockServer']), (_b = rawConfig.theme) === null || _b === void 0 ? void 0 : _b.mockServer),
221
- }, apis: transformApis(apis) || transformApiDefinitionsToApis(apiDefinitions), styleguide: styleguideConfig || lint }, rawConfigRest);
233
+ const transformedConfig = {
234
+ theme: {
235
+ openapi: {
236
+ ...referenceDocs,
237
+ ...rawConfig['features.openapi'],
238
+ ...rawConfig.theme?.openapi,
239
+ },
240
+ mockServer: {
241
+ ...rawConfig['features.mockServer'],
242
+ ...rawConfig.theme?.mockServer,
243
+ },
244
+ },
245
+ apis: transformApis(apis) || transformApiDefinitionsToApis(apiDefinitions),
246
+ styleguide: styleguideConfig || lint,
247
+ ...rawConfigRest,
248
+ };
222
249
  showDeprecationMessages(transformedConfig);
223
250
  return transformedConfig;
224
251
  }
225
- exports.transformConfig = transformConfig;
226
252
  function showDeprecationMessages(config) {
227
- var _a, _b;
228
- let allRules = Object.assign({}, (_a = config.styleguide) === null || _a === void 0 ? void 0 : _a.rules);
253
+ let allRules = { ...config.styleguide?.rules };
229
254
  for (const api of Object.values(config.apis || {})) {
230
- allRules = Object.assign(Object.assign({}, allRules), (_b = api === null || api === void 0 ? void 0 : api.styleguide) === null || _b === void 0 ? void 0 : _b.rules);
255
+ allRules = { ...allRules, ...api?.styleguide?.rules };
231
256
  }
232
257
  for (const ruleKey of Object.keys(allRules)) {
233
258
  if (ruleKey.startsWith('assert/')) {
@@ -236,15 +261,13 @@ function showDeprecationMessages(config) {
236
261
  }
237
262
  }
238
263
  function getResolveConfig(resolve) {
239
- var _a, _b;
240
264
  return {
241
265
  http: {
242
- headers: (_b = (_a = resolve === null || resolve === void 0 ? void 0 : resolve.http) === null || _a === void 0 ? void 0 : _a.headers) !== null && _b !== void 0 ? _b : [],
266
+ headers: resolve?.http?.headers ?? [],
243
267
  customFetch: undefined,
244
268
  },
245
269
  };
246
270
  }
247
- exports.getResolveConfig = getResolveConfig;
248
271
  function getUniquePlugins(plugins) {
249
272
  const seen = new Set();
250
273
  const results = [];
@@ -259,11 +282,9 @@ function getUniquePlugins(plugins) {
259
282
  }
260
283
  return results;
261
284
  }
262
- exports.getUniquePlugins = getUniquePlugins;
263
285
  class ConfigValidationError extends Error {
264
286
  }
265
287
  exports.ConfigValidationError = ConfigValidationError;
266
288
  function deepCloneMapWithJSON(originalMap) {
267
289
  return new Map(JSON.parse(JSON.stringify([...originalMap])));
268
290
  }
269
- exports.deepCloneMapWithJSON = deepCloneMapWithJSON;
@@ -0,0 +1 @@
1
+ export declare const decorators: {};
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decorators = void 0;
4
+ exports.decorators = {};
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkIfMatchByStrategy = exports.filter = void 0;
3
+ exports.filter = filter;
4
+ exports.checkIfMatchByStrategy = checkIfMatchByStrategy;
4
5
  const ref_utils_1 = require("../../../ref-utils");
5
6
  const utils_1 = require("../../../utils");
6
7
  function filter(node, ctx, criteria) {
@@ -43,7 +44,6 @@ function filter(node, ctx, criteria) {
43
44
  delete parent[key];
44
45
  }
45
46
  }
46
- exports.filter = filter;
47
47
  function checkIfMatchByStrategy(nodeValue, decoratorValue, strategy) {
48
48
  if (nodeValue === undefined || decoratorValue === undefined) {
49
49
  return false;
@@ -61,7 +61,6 @@ function checkIfMatchByStrategy(nodeValue, decoratorValue, strategy) {
61
61
  }
62
62
  return false;
63
63
  }
64
- exports.checkIfMatchByStrategy = checkIfMatchByStrategy;
65
64
  function toArrayIfNeeded(value) {
66
65
  return Array.isArray(value) ? value : [value];
67
66
  }
@@ -5,7 +5,7 @@ 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]) && !(0, filter_helper_1.checkIfMatchByStrategy)(item === null || item === void 0 ? void 0 : item[property], value, strategy);
8
+ const filterInCriteria = (item) => item?.[property] && !(0, filter_helper_1.checkIfMatchByStrategy)(item?.[property], value, strategy);
9
9
  return {
10
10
  any: {
11
11
  enter: (node, ctx) => {
@@ -5,7 +5,7 @@ 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) => (0, 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?.[property], value, strategy);
9
9
  return {
10
10
  any: {
11
11
  enter: (node, ctx) => {
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
3
  exports.InfoOverride = void 0;
15
4
  const InfoOverride = (newInfo) => {
@@ -19,7 +8,7 @@ const InfoOverride = (newInfo) => {
19
8
  if (typeof newInfo !== 'object' || Array.isArray(newInfo) || newInfo === null) {
20
9
  throw new Error(`"info-override" decorator should be called with an object`);
21
10
  }
22
- const { severity: _ } = newInfo, rest = __rest(newInfo, ["severity"]);
11
+ const { severity: _, ...rest } = newInfo;
23
12
  Object.assign(info, rest);
24
13
  },
25
14
  },
@@ -23,7 +23,10 @@ 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: (0, utils_1.yamlAndJsonSyncReader)(properties.responses[responseCode][mimeType]) });
26
+ resolvedResponse.content[mimeType] = {
27
+ ...resolvedResponse.content[mimeType],
28
+ examples: (0, utils_1.yamlAndJsonSyncReader)(properties.responses[responseCode][mimeType]),
29
+ };
27
30
  });
28
31
  operation.responses[responseCode] = resolvedResponse;
29
32
  }
@@ -35,7 +38,10 @@ const MediaTypeExamplesOverride = ({ operationIds }) => {
35
38
  }
36
39
  resolvedRequest.content = resolvedRequest.content ? resolvedRequest.content : {};
37
40
  Object.keys(properties.request).forEach((mimeType) => {
38
- resolvedRequest.content[mimeType] = Object.assign(Object.assign({}, resolvedRequest.content[mimeType]), { examples: (0, utils_1.yamlAndJsonSyncReader)(properties.request[mimeType]) });
41
+ resolvedRequest.content[mimeType] = {
42
+ ...resolvedRequest.content[mimeType],
43
+ examples: (0, utils_1.yamlAndJsonSyncReader)(properties.request[mimeType]),
44
+ };
39
45
  });
40
46
  operation.requestBody = resolvedRequest;
41
47
  }
@@ -7,20 +7,19 @@ const DEFAULT_INTERNAL_PROPERTY_NAME = 'x-internal';
7
7
  const RemoveXInternal = ({ internalFlagProperty }) => {
8
8
  const hiddenTag = internalFlagProperty || DEFAULT_INTERNAL_PROPERTY_NAME;
9
9
  function removeInternal(node, ctx) {
10
- var _a, _b, _c, _d;
11
10
  const { parent, key } = ctx;
12
11
  let didDelete = false;
13
12
  if (Array.isArray(node)) {
14
13
  for (let i = 0; i < node.length; i++) {
15
14
  if ((0, ref_utils_1.isRef)(node[i])) {
16
15
  const resolved = ctx.resolve(node[i]);
17
- if ((_a = resolved.node) === null || _a === void 0 ? void 0 : _a[hiddenTag]) {
16
+ if (resolved.node?.[hiddenTag]) {
18
17
  node.splice(i, 1);
19
18
  didDelete = true;
20
19
  i--;
21
20
  }
22
21
  }
23
- if ((_b = node[i]) === null || _b === void 0 ? void 0 : _b[hiddenTag]) {
22
+ if (node[i]?.[hiddenTag]) {
24
23
  node.splice(i, 1);
25
24
  didDelete = true;
26
25
  i--;
@@ -32,12 +31,12 @@ const RemoveXInternal = ({ internalFlagProperty }) => {
32
31
  node = node;
33
32
  if ((0, ref_utils_1.isRef)(node[key])) {
34
33
  const resolved = ctx.resolve(node[key]);
35
- if ((_c = resolved.node) === null || _c === void 0 ? void 0 : _c[hiddenTag]) {
34
+ if (resolved.node?.[hiddenTag]) {
36
35
  delete node[key];
37
36
  didDelete = true;
38
37
  }
39
38
  }
40
- if ((_d = node[key]) === null || _d === void 0 ? void 0 : _d[hiddenTag]) {
39
+ if (node[key]?.[hiddenTag]) {
41
40
  delete node[key];
42
41
  didDelete = true;
43
42
  }
@@ -5,9 +5,8 @@ const utils_1 = require("../../utils");
5
5
  const RemoveUnusedComponents = () => {
6
6
  const components = new Map();
7
7
  function registerComponent(location, componentType, name) {
8
- var _a, _b;
9
8
  components.set(location.absolutePointer, {
10
- usedIn: (_b = (_a = components.get(location.absolutePointer)) === null || _a === void 0 ? void 0 : _a.usedIn) !== null && _b !== void 0 ? _b : [],
9
+ usedIn: components.get(location.absolutePointer)?.usedIn ?? [],
11
10
  componentType,
12
11
  name,
13
12
  });
@@ -5,9 +5,8 @@ const utils_1 = require("../../utils");
5
5
  const RemoveUnusedComponents = () => {
6
6
  const components = new Map();
7
7
  function registerComponent(location, componentType, name) {
8
- var _a, _b;
9
8
  components.set(location.absolutePointer, {
10
- usedIn: (_b = (_a = components.get(location.absolutePointer)) === null || _a === void 0 ? void 0 : _a.usedIn) !== null && _b !== void 0 ? _b : [],
9
+ usedIn: components.get(location.absolutePointer)?.usedIn ?? [],
11
10
  componentType,
12
11
  name,
13
12
  });
package/lib/env.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- /// <reference types="node" />
2
1
  export declare const isBrowser: boolean;
3
2
  export declare const env: NodeJS.ProcessEnv;
package/lib/env.js CHANGED
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.env = exports.isBrowser = void 0;
4
4
  exports.isBrowser = typeof window !== 'undefined' ||
5
5
  typeof process === 'undefined' ||
6
- (process === null || process === void 0 ? void 0 : process.platform) === 'browser'; // main and worker thread
6
+ process?.platform === 'browser'; // main and worker thread
7
7
  exports.env = exports.isBrowser ? {} : process.env || {};
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAstNodeByPointer = exports.getLineColLocation = exports.getCodeframe = void 0;
3
+ exports.getCodeframe = getCodeframe;
4
+ exports.getLineColLocation = getLineColLocation;
5
+ exports.getAstNodeByPointer = getAstNodeByPointer;
4
6
  const yamlAst = require("yaml-ast-parser");
5
7
  const ref_utils_1 = require("../ref-utils");
6
8
  const logger_1 = require("../logger");
@@ -66,7 +68,6 @@ function getCodeframe(location, color) {
66
68
  return (line.substr(0, startIdx) + variant(line.substring(startIdx, endIdx)) + line.substr(endIdx));
67
69
  }
68
70
  }
69
- exports.getCodeframe = getCodeframe;
70
71
  function printPrefixedLines(lines) {
71
72
  const existingLines = lines.filter(([_, line]) => line !== undefined);
72
73
  const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length));
@@ -107,15 +108,17 @@ function padSize(line) {
107
108
  return line.length;
108
109
  }
109
110
  function getLineColLocation(location) {
110
- var _a, _b;
111
111
  if (location.pointer === undefined)
112
112
  return location;
113
113
  const { source, pointer, reportOnKey } = location;
114
114
  const ast = source.getAst(yamlAst.safeLoad);
115
115
  const astNode = getAstNodeByPointer(ast, pointer, !!reportOnKey);
116
- return Object.assign(Object.assign(Object.assign({}, location), { pointer: undefined }), positionsToLoc(source.body, (_a = astNode === null || astNode === void 0 ? void 0 : astNode.startPosition) !== null && _a !== void 0 ? _a : 1, (_b = astNode === null || astNode === void 0 ? void 0 : astNode.endPosition) !== null && _b !== void 0 ? _b : 1));
116
+ return {
117
+ ...location,
118
+ pointer: undefined,
119
+ ...positionsToLoc(source.body, astNode?.startPosition ?? 1, astNode?.endPosition ?? 1),
120
+ };
117
121
  }
118
- exports.getLineColLocation = getLineColLocation;
119
122
  function positionsToLoc(source, startPos, endPos) {
120
123
  let currentLine = 1;
121
124
  let currentCol = 1;
@@ -136,7 +139,7 @@ function positionsToLoc(source, startPos, endPos) {
136
139
  }
137
140
  currentCol++;
138
141
  }
139
- const end = startPos === endPos ? Object.assign({}, start) : { line: currentLine, col: currentCol + 1 };
142
+ const end = startPos === endPos ? { ...start } : { line: currentLine, col: currentCol + 1 };
140
143
  return { start, end };
141
144
  }
142
145
  function getAstNodeByPointer(root, pointer, reportOnKey) {
@@ -151,7 +154,7 @@ function getAstNodeByPointer(root, pointer, reportOnKey) {
151
154
  if (!mapping)
152
155
  break;
153
156
  currentNode = mapping;
154
- if (!(mapping === null || mapping === void 0 ? void 0 : mapping.value))
157
+ if (!mapping?.value)
155
158
  break; // If node has value - return value, if not - return node itself
156
159
  currentNode = mapping.value;
157
160
  }
@@ -180,4 +183,3 @@ function getAstNodeByPointer(root, pointer, reportOnKey) {
180
183
  }
181
184
  }
182
185
  }
183
- exports.getAstNodeByPointer = getAstNodeByPointer;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatProblems = exports.getTotals = void 0;
3
+ exports.getTotals = getTotals;
4
+ exports.formatProblems = formatProblems;
4
5
  const path = require("path");
5
6
  const logger_1 = require("../logger");
6
7
  const output_1 = require("../output");
@@ -51,7 +52,6 @@ function getTotals(problems) {
51
52
  ignored,
52
53
  };
53
54
  }
54
- exports.getTotals = getTotals;
55
55
  function formatProblems(problems, opts) {
56
56
  const { maxProblems = 100, cwd = env_1.isBrowser ? '' : process.cwd(), format = 'codeframe', color = logger_1.colorOptions.enabled, totals = getTotals(problems), version = coreVersion, } = opts;
57
57
  logger_1.colorOptions.enabled = color; // force colors if specified
@@ -158,17 +158,27 @@ function formatProblems(problems, opts) {
158
158
  totals,
159
159
  version,
160
160
  problems: problems.map((p) => {
161
- var _a, _b, _c;
162
- const problem = Object.assign(Object.assign({}, p), { location: p.location.map((location) => (Object.assign(Object.assign({}, location), { source: {
161
+ const problem = {
162
+ ...p,
163
+ location: p.location.map((location) => ({
164
+ ...location,
165
+ source: {
163
166
  ref: (0, ref_utils_1.isAbsoluteUrl)(location.source.absoluteRef)
164
167
  ? location.source.absoluteRef
165
168
  : path.relative(cwd, location.source.absoluteRef),
166
- } }))), from: p.from
167
- ? Object.assign(Object.assign({}, p.from), { source: {
168
- ref: (0, ref_utils_1.isAbsoluteUrl)((_a = p.from) === null || _a === void 0 ? void 0 : _a.source.absoluteRef)
169
- ? (_b = p.from) === null || _b === void 0 ? void 0 : _b.source.absoluteRef
170
- : path.relative(cwd, ((_c = p.from) === null || _c === void 0 ? void 0 : _c.source.absoluteRef) || cwd),
171
- } }) : undefined });
169
+ },
170
+ })),
171
+ from: p.from
172
+ ? {
173
+ ...p.from,
174
+ source: {
175
+ ref: (0, ref_utils_1.isAbsoluteUrl)(p.from?.source.absoluteRef)
176
+ ? p.from?.source.absoluteRef
177
+ : path.relative(cwd, p.from?.source.absoluteRef || cwd),
178
+ },
179
+ }
180
+ : undefined,
181
+ };
172
182
  if (env_1.env.FORMAT_JSON_WITH_CODEFRAMES) {
173
183
  const location = p.location[0]; // TODO: support multiple locations
174
184
  const loc = (0, codeframes_1.getLineColLocation)(location);
@@ -228,7 +238,6 @@ function formatProblems(problems, opts) {
228
238
  output_1.output.write(`<error line="${line}" column="${col}" severity="${severity}" message="${message}" source="${source}" />\n`);
229
239
  }
230
240
  }
231
- exports.formatProblems = formatProblems;
232
241
  function formatSummary(problems) {
233
242
  const counts = {};
234
243
  for (const problem of problems) {
@@ -274,7 +283,7 @@ const groupByFiles = (problems) => {
274
283
  ruleIdPad: 0,
275
284
  locationPad: 0,
276
285
  };
277
- const mappedProblem = Object.assign(Object.assign({}, problem), { location: problem.location.map(codeframes_1.getLineColLocation) });
286
+ const mappedProblem = { ...problem, location: problem.location.map(codeframes_1.getLineColLocation) };
278
287
  fileGroups[absoluteRef].fileProblems.push(mappedProblem);
279
288
  fileGroups[absoluteRef].ruleIdPad = Math.max(problem.ruleId.length, fileGroups[absoluteRef].ruleIdPad);
280
289
  fileGroups[absoluteRef].locationPad = Math.max(Math.max(...mappedProblem.location.map((loc) => `${loc.start.line}:${loc.start.col}`.length)), fileGroups[absoluteRef].locationPad);
@@ -301,7 +310,6 @@ function xmlEscape(s) {
301
310
  });
302
311
  }
303
312
  function outputForGithubActions(problems, cwd) {
304
- var _a, _b;
305
313
  for (const problem of problems) {
306
314
  for (const location of problem.location.map(codeframes_1.getLineColLocation)) {
307
315
  let command;
@@ -322,8 +330,8 @@ function outputForGithubActions(problems, cwd) {
322
330
  : path.relative(cwd, location.source.absoluteRef),
323
331
  line: location.start.line,
324
332
  col: location.start.col,
325
- endLine: (_a = location.end) === null || _a === void 0 ? void 0 : _a.line,
326
- endColumn: (_b = location.end) === null || _b === void 0 ? void 0 : _b.col,
333
+ endLine: location.end?.line,
334
+ endColumn: location.end?.col,
327
335
  };
328
336
  output_1.output.write(`::${command} ${formatProperties(properties)}::${escapeMessage(message)}\n`);
329
337
  }
package/lib/index.d.ts CHANGED
@@ -3,7 +3,8 @@ export { Oas3_1Types } from './types/oas3_1';
3
3
  export { ArazzoTypes } from './types/arazzo';
4
4
  export { Oas3Types } from './types/oas3';
5
5
  export { Oas2Types } from './types/oas2';
6
- export { AsyncApi2Types } from './types/asyncapi';
6
+ export { AsyncApi2Types } from './types/asyncapi2';
7
+ export { AsyncApi3Types } from './types/asyncapi3';
7
8
  export { ConfigTypes } from './types/redocly-yaml';
8
9
  export type { Oas3Definition, Oas3_1Definition, Oas3Components, Oas3PathItem, Oas3Paths, Oas3ComponentName, Oas3Schema, Oas3_1Schema, Oas3Tag, Oas3_1Webhooks, Referenced, OasRef, } from './typings/openapi';
9
10
  export type { Oas2Definition } from './typings/swagger';
package/lib/index.js CHANGED
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.lintDocument = exports.validate = exports.lint = exports.getTotals = exports.formatProblems = exports.getLineColLocation = exports.getAstNodeByPointer = exports.walkDocument = exports.normalizeVisitors = exports.getTypes = exports.detectSpec = exports.SpecVersion = exports.getMajorSpecVersion = exports.SpecMajorVersion = exports.isAbsoluteUrl = exports.isRef = exports.unescapePointer = exports.stringifyYaml = exports.parseYaml = exports.makeDocumentFromString = exports.YamlParseError = exports.ResolveError = exports.resolveDocument = exports.BaseResolver = exports.Source = exports.RedoclyClient = exports.createConfig = exports.CONFIG_FILE_NAMES = exports.findConfig = exports.getConfig = exports.loadConfig = exports.transformConfig = exports.getMergedConfig = exports.IGNORE_FILE = exports.StyleguideConfig = exports.Config = exports.Stats = exports.normalizeTypes = exports.ConfigTypes = exports.AsyncApi2Types = exports.Oas2Types = exports.Oas3Types = exports.ArazzoTypes = exports.Oas3_1Types = exports.pause = exports.getProxyAgent = exports.isTruthy = exports.doesYamlFileExist = exports.slash = exports.readFileFromUrl = void 0;
18
- exports.bundleFromString = exports.mapTypeToComponent = exports.bundleDocument = exports.bundle = exports.lintConfig = exports.lintFromString = void 0;
17
+ exports.validate = exports.lint = exports.getTotals = exports.formatProblems = exports.getLineColLocation = exports.getAstNodeByPointer = exports.walkDocument = exports.normalizeVisitors = exports.getTypes = exports.detectSpec = exports.SpecVersion = exports.getMajorSpecVersion = exports.SpecMajorVersion = exports.isAbsoluteUrl = exports.isRef = exports.unescapePointer = exports.stringifyYaml = exports.parseYaml = exports.makeDocumentFromString = exports.YamlParseError = exports.ResolveError = exports.resolveDocument = exports.BaseResolver = exports.Source = exports.RedoclyClient = exports.createConfig = exports.CONFIG_FILE_NAMES = exports.findConfig = exports.getConfig = exports.loadConfig = exports.transformConfig = exports.getMergedConfig = exports.IGNORE_FILE = exports.StyleguideConfig = exports.Config = exports.Stats = exports.normalizeTypes = exports.ConfigTypes = exports.AsyncApi3Types = exports.AsyncApi2Types = exports.Oas2Types = exports.Oas3Types = exports.ArazzoTypes = exports.Oas3_1Types = exports.pause = exports.getProxyAgent = exports.isTruthy = exports.doesYamlFileExist = exports.slash = exports.readFileFromUrl = void 0;
18
+ exports.bundleFromString = exports.mapTypeToComponent = exports.bundleDocument = exports.bundle = exports.lintConfig = exports.lintFromString = exports.lintDocument = void 0;
19
19
  var utils_1 = require("./utils");
20
20
  Object.defineProperty(exports, "readFileFromUrl", { enumerable: true, get: function () { return utils_1.readFileFromUrl; } });
21
21
  Object.defineProperty(exports, "slash", { enumerable: true, get: function () { return utils_1.slash; } });
@@ -31,8 +31,10 @@ var oas3_1 = require("./types/oas3");
31
31
  Object.defineProperty(exports, "Oas3Types", { enumerable: true, get: function () { return oas3_1.Oas3Types; } });
32
32
  var oas2_1 = require("./types/oas2");
33
33
  Object.defineProperty(exports, "Oas2Types", { enumerable: true, get: function () { return oas2_1.Oas2Types; } });
34
- var asyncapi_1 = require("./types/asyncapi");
35
- Object.defineProperty(exports, "AsyncApi2Types", { enumerable: true, get: function () { return asyncapi_1.AsyncApi2Types; } });
34
+ var asyncapi2_1 = require("./types/asyncapi2");
35
+ Object.defineProperty(exports, "AsyncApi2Types", { enumerable: true, get: function () { return asyncapi2_1.AsyncApi2Types; } });
36
+ var asyncapi3_1 = require("./types/asyncapi3");
37
+ Object.defineProperty(exports, "AsyncApi3Types", { enumerable: true, get: function () { return asyncapi3_1.AsyncApi3Types; } });
36
38
  var redocly_yaml_1 = require("./types/redocly-yaml");
37
39
  Object.defineProperty(exports, "ConfigTypes", { enumerable: true, get: function () { return redocly_yaml_1.ConfigTypes; } });
38
40
  var types_1 = require("./types");