@redocly/cli 2.41.0 → 2.41.1

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/README.md CHANGED
@@ -106,7 +106,7 @@ The `stylish` output is as good as it sounds, but if you need JSON, Markdown, Ch
106
106
 
107
107
  [Learn more about API standards and configuring Redocly rules](https://redocly.com/docs/cli/api-standards).
108
108
 
109
- Looking for more examples? Check out our [Cookbook](https://github.com/Redocly/redocly-cli-cookbook).
109
+ Looking for more examples? Check out our [Cookbook](./cookbook/README.md).
110
110
 
111
111
  ### API contract testing with Respect
112
112
 
@@ -2,7 +2,7 @@ import { createRequire as __createRequire } from 'node:module';
2
2
  const require = __createRequire(import.meta.url);
3
3
  import {
4
4
  logger
5
- } from "./YK6T7IHG.js";
5
+ } from "./Z3EJWJEX.js";
6
6
 
7
7
  // src/commands/split/oas/constants.ts
8
8
  var OPENAPI3_METHOD_NAMES = [
@@ -2,7 +2,7 @@ import { createRequire as __createRequire } from 'node:module';
2
2
  const require = __createRequire(import.meta.url);
3
3
  import {
4
4
  HandledError
5
- } from "./YK6T7IHG.js";
5
+ } from "./Z3EJWJEX.js";
6
6
 
7
7
  // src/utils/error.ts
8
8
  var AbortFlowError = class extends Error {
@@ -8,7 +8,7 @@ import {
8
8
  } from "./4FB5ZIPP.js";
9
9
  import {
10
10
  version
11
- } from "./Z5H4OEIW.js";
11
+ } from "./YPFS42IW.js";
12
12
  import {
13
13
  require_undici
14
14
  } from "./XB6C62FW.js";
@@ -16,7 +16,7 @@ import {
16
16
  blue,
17
17
  green,
18
18
  logger
19
- } from "./YK6T7IHG.js";
19
+ } from "./Z3EJWJEX.js";
20
20
  import {
21
21
  __toESM
22
22
  } from "./5ILQMFXK.js";
@@ -2,24 +2,24 @@ import { createRequire as __createRequire } from 'node:module';
2
2
  const require = __createRequire(import.meta.url);
3
3
  import {
4
4
  selectTrafficParser
5
- } from "./GBUMU6BX.js";
5
+ } from "./Y7LKQTQ4.js";
6
6
  import {
7
7
  ValidationSession,
8
8
  loadOpenApiIndex,
9
9
  parseCsv,
10
10
  renderReport
11
- } from "./ZBZADNJT.js";
11
+ } from "./LZNQHR3A.js";
12
12
  import {
13
13
  listFilesRecursively,
14
14
  normalizeFsPath
15
- } from "./ER45DAHG.js";
15
+ } from "./PU67EGEM.js";
16
16
  import {
17
17
  AbortFlowError,
18
18
  exitWithError
19
- } from "./DT4UM7U4.js";
19
+ } from "./CUWLBJXP.js";
20
20
  import {
21
21
  logger
22
- } from "./YK6T7IHG.js";
22
+ } from "./Z3EJWJEX.js";
23
23
  import "./Z2I5YXYN.js";
24
24
  import "./5ILQMFXK.js";
25
25
 
@@ -17,7 +17,7 @@ import {
17
17
  lint,
18
18
  pluralize,
19
19
  require__
20
- } from "./YK6T7IHG.js";
20
+ } from "./Z3EJWJEX.js";
21
21
  import {
22
22
  __commonJS,
23
23
  __toESM
@@ -5946,7 +5946,7 @@ function resolveDescriptionNameFromPath(descriptionPath) {
5946
5946
  async function generateArazzoDescription(opts) {
5947
5947
  const { descriptionPath, outputFile, collectSpecData } = opts;
5948
5948
  const document = await bundleOpenApi(opts) || {};
5949
- collectSpecData?.(document);
5949
+ collectSpecData?.({ parsed: document });
5950
5950
  const { paths: pathsObject, info, security: rootSecurity, components } = document;
5951
5951
  const sourceDescriptionName = resolveDescriptionNameFromPath(descriptionPath);
5952
5952
  const resolvedDescriptionPath = outputFile ? path2.relative(path2.dirname(outputFile), path2.resolve(descriptionPath)) : descriptionPath;
@@ -11972,7 +11972,7 @@ async function bundleArazzo(options) {
11972
11972
  if (!isTestFile(fileName, bundledDocument.bundle.parsed)) {
11973
11973
  throw new Error(`No test files found. File ${fileName} does not follows naming pattern "*.[yaml | yml | json]" or have not valid "Arazzo" description.`);
11974
11974
  }
11975
- collectSpecData?.(bundledDocument.bundle.parsed || {});
11975
+ collectSpecData?.(bundledDocument.bundle);
11976
11976
  const errorLintProblems = lintProblems.filter((problem) => problem.severity === "error");
11977
11977
  if (errorLintProblems.length) {
11978
11978
  throw new Error(`${red("Found errors in Arazzo description")} ${bold(fileName)}`);
@@ -2,13 +2,13 @@ import { createRequire as __createRequire } from 'node:module';
2
2
  const require = __createRequire(import.meta.url);
3
3
  import {
4
4
  RedoclyOAuthClient
5
- } from "./Q3KTKRJH.js";
5
+ } from "./GCAYTKJY.js";
6
6
  import "./Y6DTFCLS.js";
7
7
  import "./4FB5ZIPP.js";
8
- import "./Z5H4OEIW.js";
8
+ import "./YPFS42IW.js";
9
9
  import "./XB6C62FW.js";
10
10
  import "./UUU33DK3.js";
11
- import "./YK6T7IHG.js";
11
+ import "./Z3EJWJEX.js";
12
12
  import "./Z2I5YXYN.js";
13
13
  import "./5ILQMFXK.js";
14
14
  export {
@@ -13,7 +13,7 @@ import {
13
13
  resolvePathForServer,
14
14
  shouldIgnoreHeaderAsUndocumented,
15
15
  splitSetCookieHeader
16
- } from "./ER45DAHG.js";
16
+ } from "./PU67EGEM.js";
17
17
  import {
18
18
  BaseResolver,
19
19
  blue,
@@ -35,7 +35,7 @@ import {
35
35
  require_dist,
36
36
  walkDocument,
37
37
  yellow
38
- } from "./YK6T7IHG.js";
38
+ } from "./Z3EJWJEX.js";
39
39
  import {
40
40
  __toESM
41
41
  } from "./5ILQMFXK.js";
@@ -1751,6 +1751,7 @@ function relaxRequiredForTarget(schema, target, ancestors = /* @__PURE__ */ new
1751
1751
  }
1752
1752
  var SchemaValidator = class {
1753
1753
  ajv;
1754
+ fallbackAjv;
1754
1755
  objectSchemaCaches = {
1755
1756
  none: /* @__PURE__ */ new WeakMap(),
1756
1757
  request: /* @__PURE__ */ new WeakMap(),
@@ -1758,10 +1759,11 @@ var SchemaValidator = class {
1758
1759
  };
1759
1760
  scalarSchemaCache = /* @__PURE__ */ new Map();
1760
1761
  constructor(options) {
1761
- this.ajv = new AjvConstructor({
1762
+ const ajvOptions = {
1762
1763
  strict: false,
1763
1764
  allErrors: true,
1764
1765
  allowUnionTypes: true,
1766
+ discriminator: true,
1765
1767
  coerceTypes: options?.coerceTypes ? "array" : false,
1766
1768
  validateFormats: true,
1767
1769
  verbose: true,
@@ -1770,8 +1772,11 @@ var SchemaValidator = class {
1770
1772
  // Treat it as a no-op format to avoid noisy unknown-format warnings.
1771
1773
  enum: true
1772
1774
  }
1773
- });
1775
+ };
1776
+ this.ajv = new AjvConstructor(ajvOptions);
1777
+ this.fallbackAjv = new AjvConstructor({ ...ajvOptions, discriminator: false });
1774
1778
  applyFormats(this.ajv);
1779
+ applyFormats(this.fallbackAjv);
1775
1780
  }
1776
1781
  validate(schema, value, target) {
1777
1782
  if (schema === void 0) {
@@ -1802,7 +1807,7 @@ var SchemaValidator = class {
1802
1807
  return cached2;
1803
1808
  }
1804
1809
  const effectiveSchema = target ? relaxRequiredForTarget(schema, target) : schema;
1805
- const compiled2 = this.ajv.compile(effectiveSchema);
1810
+ const compiled2 = this.compileSchema(effectiveSchema);
1806
1811
  cache.set(schema, compiled2);
1807
1812
  return compiled2;
1808
1813
  }
@@ -1811,10 +1816,17 @@ var SchemaValidator = class {
1811
1816
  if (cached) {
1812
1817
  return cached;
1813
1818
  }
1814
- const compiled = this.ajv.compile(schema);
1819
+ const compiled = this.compileSchema(schema);
1815
1820
  this.scalarSchemaCache.set(cacheKey, compiled);
1816
1821
  return compiled;
1817
1822
  }
1823
+ compileSchema(schema) {
1824
+ try {
1825
+ return this.ajv.compile(schema);
1826
+ } catch {
1827
+ return this.fallbackAjv.compile(schema);
1828
+ }
1829
+ }
1818
1830
  };
1819
1831
 
1820
1832
  // src/commands/drift/engine/validation-session.ts
@@ -2,7 +2,7 @@ import { createRequire as __createRequire } from 'node:module';
2
2
  const require = __createRequire(import.meta.url);
3
3
  import {
4
4
  selectTrafficParser
5
- } from "./GBUMU6BX.js";
5
+ } from "./Y7LKQTQ4.js";
6
6
  import {
7
7
  getPathWithoutTrailingSlash,
8
8
  isJsonMime,
@@ -12,14 +12,14 @@ import {
12
12
  normalizeFsPath,
13
13
  normalizeServerPrefix,
14
14
  resolvePathForServer
15
- } from "./ER45DAHG.js";
15
+ } from "./PU67EGEM.js";
16
16
  import {
17
17
  OPENAPI3_METHOD_NAMES,
18
18
  Spinner
19
- } from "./LCWGF7G6.js";
19
+ } from "./64PJUTGH.js";
20
20
  import {
21
21
  exitWithError
22
- } from "./DT4UM7U4.js";
22
+ } from "./CUWLBJXP.js";
23
23
  import {
24
24
  createConfig,
25
25
  isPlainObject,
@@ -28,7 +28,7 @@ import {
28
28
  parseYaml,
29
29
  pluralize,
30
30
  stringifyYaml
31
- } from "./YK6T7IHG.js";
31
+ } from "./Z3EJWJEX.js";
32
32
  import "./Z2I5YXYN.js";
33
33
  import "./5ILQMFXK.js";
34
34
 
@@ -10,7 +10,7 @@ import {
10
10
  } from "./Y6DTFCLS.js";
11
11
  import {
12
12
  version
13
- } from "./Z5H4OEIW.js";
13
+ } from "./YPFS42IW.js";
14
14
  import {
15
15
  diag,
16
16
  esm_exports,
@@ -2,7 +2,7 @@ import { createRequire as __createRequire } from 'node:module';
2
2
  const require = __createRequire(import.meta.url);
3
3
  import {
4
4
  isPlainObject
5
- } from "./YK6T7IHG.js";
5
+ } from "./Z3EJWJEX.js";
6
6
 
7
7
  // src/commands/drift/utils/files.ts
8
8
  import { open, readdir, stat } from "node:fs/promises";
@@ -121,11 +121,12 @@ var IGNORED_UNDOCUMENTED_HEADERS = /* @__PURE__ */ new Set([
121
121
  "upgrade-insecure-requests",
122
122
  "user-agent",
123
123
  "via",
124
- "x-amzn-trace-id",
125
124
  "x-client-trace-id",
126
125
  "x-cloud-trace-context",
127
126
  "x-correlation-id",
128
127
  "x-http-method-override",
128
+ "x-hub-signature",
129
+ "x-hub-signature-256",
129
130
  "x-method-override",
130
131
  "x-real-ip",
131
132
  "x-request-id",
@@ -138,9 +139,12 @@ var IGNORED_UNDOCUMENTED_HEADER_PREFIXES = [
138
139
  "cf-",
139
140
  "sec-ch-",
140
141
  "sec-fetch-",
142
+ "x-amz-",
143
+ "x-amzn-",
141
144
  "x-b3-",
142
145
  "x-envoy-",
143
- "x-forwarded-"
146
+ "x-forwarded-",
147
+ "x-github-"
144
148
  ];
145
149
  var SET_COOKIE_SEPARATOR = "\n";
146
150
  function splitSetCookieHeader(value) {
@@ -5,23 +5,23 @@ import {
5
5
  loadOpenApiIndex,
6
6
  parseCsv,
7
7
  renderReport
8
- } from "./ZBZADNJT.js";
8
+ } from "./LZNQHR3A.js";
9
9
  import {
10
10
  createNormalizedExchange,
11
11
  isJsonMime,
12
12
  normalizeFsPath
13
- } from "./ER45DAHG.js";
13
+ } from "./PU67EGEM.js";
14
14
  import {
15
15
  AbortFlowError,
16
16
  exitWithError
17
- } from "./DT4UM7U4.js";
17
+ } from "./CUWLBJXP.js";
18
18
  import {
19
19
  require_undici
20
20
  } from "./XB6C62FW.js";
21
21
  import {
22
22
  isPlainObject,
23
23
  logger
24
- } from "./YK6T7IHG.js";
24
+ } from "./Z3EJWJEX.js";
25
25
  import "./Z2I5YXYN.js";
26
26
  import {
27
27
  __toESM
@@ -3,17 +3,17 @@ const require = __createRequire(import.meta.url);
3
3
  import {
4
4
  getExecutionTime,
5
5
  getFallbackApisOrExit
6
- } from "./XDNYWH7V.js";
6
+ } from "./UQJWXLNC.js";
7
7
  import {
8
8
  exitWithError
9
- } from "./DT4UM7U4.js";
9
+ } from "./CUWLBJXP.js";
10
10
  import {
11
11
  require_dist
12
12
  } from "./4FB5ZIPP.js";
13
13
  import {
14
14
  redocStandaloneSri,
15
15
  redocVersion
16
- } from "./Z5H4OEIW.js";
16
+ } from "./YPFS42IW.js";
17
17
  import {
18
18
  require_json_pointer,
19
19
  require_openapi_sampler
@@ -25,7 +25,7 @@ import {
25
25
  require_fast_deep_equal,
26
26
  require_json_schema_traverse,
27
27
  require_pluralize
28
- } from "./YK6T7IHG.js";
28
+ } from "./Z3EJWJEX.js";
29
29
  import "./Z2I5YXYN.js";
30
30
  import {
31
31
  __commonJS,
@@ -92334,7 +92334,7 @@ var handlerBuildCommand = async ({
92334
92334
  const api = await import_redoc2.default.loadAndBundleSpec(
92335
92335
  isAbsoluteUrl(pathToApi) ? pathToApi : resolve2(pathToApi)
92336
92336
  );
92337
- collectSpecData?.(api);
92337
+ collectSpecData?.({ parsed: api });
92338
92338
  const pageHTML = await getPageHTML(api, pathToApi, { ...options, redocVersion }, argv.config);
92339
92339
  mkdirSync(dirname2(options.output), { recursive: true });
92340
92340
  writeFileSync(options.output, pageHTML);
@@ -3,7 +3,7 @@ const require = __createRequire(import.meta.url);
3
3
  import {
4
4
  AbortFlowError,
5
5
  exitWithError
6
- } from "./DT4UM7U4.js";
6
+ } from "./CUWLBJXP.js";
7
7
  import {
8
8
  ConfigValidationError,
9
9
  HandledError,
@@ -27,7 +27,7 @@ import {
27
27
  red,
28
28
  stringifyYaml,
29
29
  yellow
30
- } from "./YK6T7IHG.js";
30
+ } from "./Z3EJWJEX.js";
31
31
 
32
32
  // src/commands/lint.ts
33
33
  import { performance as performance3 } from "perf_hooks";
@@ -8,10 +8,10 @@ import {
8
8
  maskSecrets,
9
9
  parseRuntimeExpression,
10
10
  run
11
- } from "./6ABF7ZRJ.js";
11
+ } from "./JR2DXWZO.js";
12
12
  import "./VXIQEZPR.js";
13
13
  import "./UUU33DK3.js";
14
- import "./YK6T7IHG.js";
14
+ import "./Z3EJWJEX.js";
15
15
  import "./Z2I5YXYN.js";
16
16
  import "./5ILQMFXK.js";
17
17
  export {
@@ -10,10 +10,10 @@ import {
10
10
  pickHeaderContentType,
11
11
  readProbe,
12
12
  streamNdjsonObjects
13
- } from "./ER45DAHG.js";
13
+ } from "./PU67EGEM.js";
14
14
  import {
15
15
  isPlainObject
16
- } from "./YK6T7IHG.js";
16
+ } from "./Z3EJWJEX.js";
17
17
 
18
18
  // src/commands/drift/log-formats/har.ts
19
19
  import path from "node:path";
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
4
4
  // package.json
5
5
  var package_default = {
6
6
  name: "@redocly/cli",
7
- version: "2.41.0",
7
+ version: "2.41.1",
8
8
  description: "",
9
9
  license: "MIT",
10
10
  bin: {
@@ -49,8 +49,8 @@ var package_default = {
49
49
  "@opentelemetry/sdk-trace-node": "2.8.0",
50
50
  "@opentelemetry/semantic-conventions": "1.41.1",
51
51
  "@redocly/cli-otel": "0.3.4",
52
- "@redocly/openapi-core": "2.41.0",
53
- "@redocly/respect-core": "2.41.0",
52
+ "@redocly/openapi-core": "2.41.1",
53
+ "@redocly/respect-core": "2.41.1",
54
54
  "@types/cookie": "0.6.0",
55
55
  "@types/har-format": "^1.2.16",
56
56
  "@types/react": "^17.0.0 || ^18.2.21 || ^19.2.16",
@@ -38154,7 +38154,7 @@ async function bundle(opts) {
38154
38154
  if (document instanceof Error) {
38155
38155
  throw document;
38156
38156
  }
38157
- opts.collectSpecData?.(document.parsed);
38157
+ opts.collectSpecData?.(document);
38158
38158
  return bundleDocument({
38159
38159
  document,
38160
38160
  ...opts,
@@ -39144,7 +39144,7 @@ var redoclyConfigSchemaWithoutTheme2 = {
39144
39144
  async function lint(opts) {
39145
39145
  const { ref, externalRefResolver = new BaseResolver(opts.config.resolve) } = opts;
39146
39146
  const document = await externalRefResolver.resolveDocument(null, ref, true);
39147
- opts.collectSpecData?.(document.parsed);
39147
+ opts.collectSpecData?.(document);
39148
39148
  return lintDocument({
39149
39149
  document,
39150
39150
  ...opts,
@@ -39297,6 +39297,7 @@ export {
39297
39297
  detectSpec,
39298
39298
  require_dist,
39299
39299
  isSupportedExtension,
39300
+ isGraphqlRef,
39300
39301
  ResolveError,
39301
39302
  BaseResolver,
39302
39303
  resolveDocument,
package/lib/index.js CHANGED
@@ -28,16 +28,16 @@ import {
28
28
  saveBundle,
29
29
  sortTopLevelKeys,
30
30
  writeToFileByExtension
31
- } from "./chunks/XDNYWH7V.js";
31
+ } from "./chunks/UQJWXLNC.js";
32
32
  import {
33
33
  OPENAPI3_COMPONENT_NAMES,
34
34
  OPENAPI3_METHOD_NAMES,
35
35
  Spinner
36
- } from "./chunks/LCWGF7G6.js";
36
+ } from "./chunks/64PJUTGH.js";
37
37
  import {
38
38
  AbortFlowError,
39
39
  exitWithError
40
- } from "./chunks/DT4UM7U4.js";
40
+ } from "./chunks/CUWLBJXP.js";
41
41
  import {
42
42
  RedoclyOAuthClient,
43
43
  ReuniteApi,
@@ -47,7 +47,7 @@ import {
47
47
  getProxyUrl,
48
48
  getReuniteUrl,
49
49
  shouldBypassProxy
50
- } from "./chunks/Q3KTKRJH.js";
50
+ } from "./chunks/GCAYTKJY.js";
51
51
  import {
52
52
  ANONYMOUS_ID_CACHE_FILE,
53
53
  DEFAULT_FETCH_TIMEOUT,
@@ -58,7 +58,7 @@ import {
58
58
  engines,
59
59
  name,
60
60
  version
61
- } from "./chunks/Z5H4OEIW.js";
61
+ } from "./chunks/YPFS42IW.js";
62
62
  import {
63
63
  require_undici
64
64
  } from "./chunks/XB6C62FW.js";
@@ -66,7 +66,7 @@ import {
66
66
  RESET_ESCAPE_CODE,
67
67
  calculateTotals,
68
68
  conditionallyMaskSecrets
69
- } from "./chunks/6ABF7ZRJ.js";
69
+ } from "./chunks/JR2DXWZO.js";
70
70
  import "./chunks/VXIQEZPR.js";
71
71
  import "./chunks/UUU33DK3.js";
72
72
  import {
@@ -94,6 +94,7 @@ import {
94
94
  green,
95
95
  isAbsoluteUrl,
96
96
  isEmptyObject,
97
+ isGraphqlRef,
97
98
  isMappingRef,
98
99
  isNotEmptyObject,
99
100
  isPlainObject,
@@ -119,7 +120,7 @@ import {
119
120
  white,
120
121
  xmlEscape,
121
122
  yellow
122
- } from "./chunks/YK6T7IHG.js";
123
+ } from "./chunks/Z3EJWJEX.js";
123
124
  import "./chunks/Z2I5YXYN.js";
124
125
  import {
125
126
  __commonJS,
@@ -7714,7 +7715,7 @@ async function handleGenerateArazzo({
7714
7715
  config: config3
7715
7716
  };
7716
7717
  try {
7717
- const { generate } = await import("./chunks/VMHXZFTB.js");
7718
+ const { generate } = await import("./chunks/UV3RHVRI.js");
7718
7719
  logger.info(gray("\n Generating Arazzo description... \n"));
7719
7720
  const generatedArazzo = await generate(options);
7720
7721
  writeFileSync2(outputFile, stringifyYaml(generatedArazzo));
@@ -8396,7 +8397,7 @@ Please choose only one!`
8396
8397
  for (const document of documents) {
8397
8398
  try {
8398
8399
  const version3 = detectSpec(document.parsed);
8399
- collectSpecData?.(document.parsed);
8400
+ collectSpecData?.(document);
8400
8401
  if (version3 !== "oas3_0" && version3 !== "oas3_1" && version3 !== "oas3_2") {
8401
8402
  return exitWithError(
8402
8403
  `Only OpenAPI 3.0, 3.1, and 3.2 are supported: ${blue(document.source.absoluteRef)}.`
@@ -9166,7 +9167,7 @@ async function handleRespect({
9166
9167
  let mtlsCerts;
9167
9168
  let harLogs;
9168
9169
  try {
9169
- const { run, conditionallyMaskSecrets: conditionallyMaskSecrets2 } = await import("./chunks/VMHXZFTB.js");
9170
+ const { run, conditionallyMaskSecrets: conditionallyMaskSecrets2 } = await import("./chunks/UV3RHVRI.js");
9170
9171
  const workingDir = config3.configPath ? dirname4(config3.configPath) : process.cwd();
9171
9172
  if (argv.mtls) {
9172
9173
  mtlsCerts = resolveMtlsCertificates(argv.mtls, workingDir);
@@ -10382,7 +10383,7 @@ async function handleScore({ argv, config: config3, collectSpecData }) {
10382
10383
  const [{ path: path28 }] = await getFallbackApisOrExit(argv.api ? [argv.api] : [], config3);
10383
10384
  const externalRefResolver = new BaseResolver(config3.resolve);
10384
10385
  const { bundle: document } = await bundle({ config: config3, ref: path28 });
10385
- collectSpecData?.(document.parsed);
10386
+ collectSpecData?.(document);
10386
10387
  const specVersion = detectSpec(document.parsed);
10387
10388
  if (getMajorSpecVersion(specVersion) !== "oas3") {
10388
10389
  return exitWithError(
@@ -11212,7 +11213,7 @@ async function handleScorecardClassic({
11212
11213
  }
11213
11214
  const externalRefResolver = new BaseResolver(config3.resolve);
11214
11215
  const document = await externalRefResolver.resolveDocument(null, path28, true);
11215
- collectSpecData?.(document.parsed);
11216
+ collectSpecData?.(document);
11216
11217
  const documentInfo = document.parsed?.info;
11217
11218
  const builtInMetadata = documentInfo?.["x-metadata"] || {};
11218
11219
  const metadata = {
@@ -11851,7 +11852,7 @@ async function handleSplit({ argv, collectSpecData }) {
11851
11852
  const ext = getAndValidateFileExtension(api);
11852
11853
  if (!fs13.existsSync(api)) exitWithError(`File ${blue(api)} does not exist.`);
11853
11854
  const definition = readYaml(api);
11854
- collectSpecData?.(definition);
11855
+ collectSpecData?.({ parsed: definition });
11855
11856
  const specVersion = detectSpec(definition);
11856
11857
  switch (specVersion) {
11857
11858
  case "async2":
@@ -11991,7 +11992,7 @@ async function handleStats({ argv, config: config3, collectSpecData }) {
11991
11992
  const [{ path: path28 }] = await getFallbackApisOrExit(argv.api ? [argv.api] : [], config3);
11992
11993
  const externalRefResolver = new BaseResolver(config3.resolve);
11993
11994
  const { bundle: document } = await bundle({ config: config3, ref: path28 });
11994
- collectSpecData?.(document.parsed);
11995
+ collectSpecData?.(document);
11995
11996
  const specVersion = detectSpec(document.parsed);
11996
11997
  const types = normalizeTypes(config3.extendTypes(getTypes(specVersion), specVersion), config3);
11997
11998
  const { statsVisitor, statsAccumulator } = resolveStatsVisitorAndAccumulator(specVersion);
@@ -12642,7 +12643,7 @@ async function sendTelemetry({
12642
12643
  $0: _,
12643
12644
  ...args
12644
12645
  } = argv;
12645
- const { RedoclyOAuthClient: RedoclyOAuthClient2 } = await import("./chunks/SZLWDHZK.js");
12646
+ const { RedoclyOAuthClient: RedoclyOAuthClient2 } = await import("./chunks/KWQEC5JF.js");
12646
12647
  const oauthClient = new RedoclyOAuthClient2();
12647
12648
  const reuniteUrl = getReuniteUrl(config3, args.residency);
12648
12649
  const logged_in = await oauthClient.isAuthorized(reuniteUrl);
@@ -12690,7 +12691,7 @@ async function sendTelemetry({
12690
12691
  category: "product",
12691
12692
  data: eventData
12692
12693
  });
12693
- const { otelTelemetry } = await import("./chunks/5YSNZVUA.js");
12694
+ const { otelTelemetry } = await import("./chunks/OYU4O47C.js");
12694
12695
  otelTelemetry.send(cloudEvent);
12695
12696
  } catch (err) {
12696
12697
  }
@@ -12905,24 +12906,28 @@ function commandWrapper(commandHandler) {
12905
12906
  const respectXSecurityAuthTypes = /* @__PURE__ */ new Set();
12906
12907
  const respectSourceDescriptionTypes = /* @__PURE__ */ new Set();
12907
12908
  const respectCriterionObjectTypes = /* @__PURE__ */ new Set();
12908
- const collectSpecData = (document) => {
12909
+ const collectSpecData = ({ parsed: document, source }) => {
12910
+ specVersion = "unknown";
12911
+ specKeyword = void 0;
12912
+ specFullVersion = void 0;
12913
+ if (source?.absoluteRef && isGraphqlRef(source.absoluteRef)) {
12914
+ specVersion = "graphql";
12915
+ return;
12916
+ }
12909
12917
  try {
12910
12918
  specVersion = detectSpec(document);
12911
12919
  } catch (err) {
12912
- specVersion = `unsupported`;
12920
+ specVersion = "unsupported";
12913
12921
  }
12914
12922
  if (!isPlainObject(document)) return;
12915
12923
  specKeyword = document?.openapi ? "openapi" : document?.swagger ? "swagger" : document?.asyncapi ? "asyncapi" : document?.arazzo ? "arazzo" : document?.overlay ? "overlay" : void 0;
12916
12924
  if (specKeyword) {
12917
12925
  specFullVersion = document[specKeyword];
12918
- } else {
12919
- specFullVersion = void 0;
12920
12926
  }
12921
12927
  if (getMajorSpecVersion(specVersion) === "arazzo1") {
12922
- const arazzoDocument = document;
12923
- collectXSecurityAuthTypes(arazzoDocument, respectXSecurityAuthTypes);
12924
- collectSourceDescriptionTypes(arazzoDocument, respectSourceDescriptionTypes);
12925
- collectCriterionObjectTypes(arazzoDocument, respectCriterionObjectTypes);
12928
+ collectXSecurityAuthTypes(document, respectXSecurityAuthTypes);
12929
+ collectSourceDescriptionTypes(document, respectSourceDescriptionTypes);
12930
+ collectCriterionObjectTypes(document, respectCriterionObjectTypes);
12926
12931
  }
12927
12932
  };
12928
12933
  try {
@@ -13520,7 +13525,7 @@ yargs_default(hideBin(process.argv)).version("version", "Show version number.",
13520
13525
  return true;
13521
13526
  }),
13522
13527
  async (argv) => {
13523
- const { handlerBuildCommand } = await import("./chunks/7H6CC6CT.js");
13528
+ const { handlerBuildCommand } = await import("./chunks/RLUKQFWZ.js");
13524
13529
  commandWrapper(handlerBuildCommand)(argv);
13525
13530
  }
13526
13531
  ).command(
@@ -13741,7 +13746,7 @@ yargs_default(hideBin(process.argv)).version("version", "Show version number.",
13741
13746
  config: { describe: "Path to the config file.", type: "string" }
13742
13747
  }),
13743
13748
  async (argv) => {
13744
- const { handleGenerateSpec } = await import("./chunks/PFPGSTSG.js");
13749
+ const { handleGenerateSpec } = await import("./chunks/OFNDHNJR.js");
13745
13750
  commandWrapper(handleGenerateSpec)(argv);
13746
13751
  }
13747
13752
  ).command(
@@ -13856,7 +13861,7 @@ yargs_default(hideBin(process.argv)).version("version", "Show version number.",
13856
13861
  }
13857
13862
  }),
13858
13863
  async (argv) => {
13859
- const { handleDrift } = await import("./chunks/HQDT5XFP.js");
13864
+ const { handleDrift } = await import("./chunks/HFIKZEXG.js");
13860
13865
  commandWrapper(handleDrift)(argv);
13861
13866
  }
13862
13867
  ).command(
@@ -13924,7 +13929,7 @@ yargs_default(hideBin(process.argv)).version("version", "Show version number.",
13924
13929
  }
13925
13930
  }),
13926
13931
  async (argv) => {
13927
- const { handleProxy } = await import("./chunks/GOFLD5MJ.js");
13932
+ const { handleProxy } = await import("./chunks/Q7LC24EZ.js");
13928
13933
  commandWrapper(handleProxy)(argv);
13929
13934
  }
13930
13935
  ).completion("completion", "Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([notifyUpdateCliVersion]).strict().argv;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/cli",
3
- "version": "2.41.0",
3
+ "version": "2.41.1",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "type": "module",