@redocly/openapi-core 1.10.2 → 1.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/lib/bundle.d.ts +1 -1
- package/lib/bundle.js +2 -2
- package/lib/config/config.d.ts +6 -0
- package/lib/config/config.js +19 -1
- package/lib/config/load.js +2 -2
- package/lib/config/types.d.ts +0 -10
- package/lib/config/types.js +0 -13
- package/lib/decorators/common/registry-dependencies.js +2 -2
- package/lib/env.js +3 -1
- package/lib/index.d.ts +2 -3
- package/lib/index.js +2 -17
- package/lib/oas-types.d.ts +1 -1
- package/lib/redocly/index.d.ts +2 -1
- package/lib/redocly/index.js +24 -14
- package/lib/redocly/registry-api.d.ts +2 -2
- package/lib/redocly/registry-api.js +9 -9
- package/lib/types/redocly-yaml.js +3 -3
- package/lib/utils.d.ts +0 -2
- package/lib/utils.js +1 -7
- package/package.json +3 -4
- package/src/__tests__/lint.test.ts +2 -30
- package/src/bundle.ts +1 -1
- package/src/config/config.ts +23 -1
- package/src/config/load.ts +1 -2
- package/src/config/types.ts +0 -13
- package/src/decorators/common/registry-dependencies.ts +1 -1
- package/src/env.ts +3 -1
- package/src/index.ts +2 -11
- package/src/redocly/__tests__/redocly-client.test.ts +3 -5
- package/src/redocly/index.ts +24 -14
- package/src/redocly/registry-api.ts +31 -25
- package/src/types/redocly-yaml.ts +2 -2
- package/src/utils.ts +1 -7
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/redocly/domains.d.ts +0 -14
- package/lib/redocly/domains.js +0 -41
- package/lib/types/portal-config-schema.d.ts +0 -5299
- package/lib/types/portal-config-schema.js +0 -338
- package/lib/types/theme-config.d.ts +0 -2541
- package/lib/types/theme-config.js +0 -637
- package/src/redocly/__tests__/domains.test.ts +0 -52
- package/src/redocly/domains.ts +0 -48
- package/src/types/portal-config-schema.ts +0 -416
- package/src/types/theme-config.ts +0 -781
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @redocly/openapi-core
|
|
2
2
|
|
|
3
|
+
## 1.10.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Added a platform check so `@redocly/openapi-core` can support running inside a worker.
|
|
8
|
+
- Allowed additional properties in `theme.openapi` config schema to enable libraries that use `@redocly/openapi-core` for configuration linting to extend this part of the schema.
|
|
9
|
+
|
|
10
|
+
## 1.10.3
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Reverted "Users can run the CLI tool behind a proxy by using HTTP_PROXY or HTTPS_PROXY environment variables to configure the proxy settings" temporary.
|
|
15
|
+
|
|
3
16
|
## 1.10.2
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/lib/bundle.d.ts
CHANGED
|
@@ -47,4 +47,4 @@ export declare function bundleDocument(opts: {
|
|
|
47
47
|
removeUnusedComponents?: boolean;
|
|
48
48
|
keepUrlRefs?: boolean;
|
|
49
49
|
}): Promise<BundleResult>;
|
|
50
|
-
export declare function mapTypeToComponent(typeName: string, version: SpecMajorVersion): "
|
|
50
|
+
export declare function mapTypeToComponent(typeName: string, version: SpecMajorVersion): "definitions" | "examples" | "links" | "responses" | "parameters" | "headers" | "schemas" | "requestBodies" | "securitySchemes" | "callbacks" | null;
|
package/lib/bundle.js
CHANGED
|
@@ -20,7 +20,7 @@ const ref_utils_1 = require("./ref-utils");
|
|
|
20
20
|
const rules_1 = require("./config/rules");
|
|
21
21
|
const no_unresolved_refs_1 = require("./rules/no-unresolved-refs");
|
|
22
22
|
const utils_1 = require("./utils");
|
|
23
|
-
const
|
|
23
|
+
const redocly_1 = require("./redocly");
|
|
24
24
|
const remove_unused_components_1 = require("./decorators/oas2/remove-unused-components");
|
|
25
25
|
const remove_unused_components_2 = require("./decorators/oas3/remove-unused-components");
|
|
26
26
|
const redocly_yaml_1 = require("./types/redocly-yaml");
|
|
@@ -234,7 +234,7 @@ function makeBundleVisitor(version, dereference, skipRedoclyRegistryRefs, rootDo
|
|
|
234
234
|
return;
|
|
235
235
|
}
|
|
236
236
|
// do not bundle registry URL before push, otherwise we can't record dependencies
|
|
237
|
-
if (skipRedoclyRegistryRefs && (0,
|
|
237
|
+
if (skipRedoclyRegistryRefs && (0, redocly_1.isRedoclyRegistryURL)(node.$ref)) {
|
|
238
238
|
return;
|
|
239
239
|
}
|
|
240
240
|
if (keepUrlRefs && (0, ref_utils_1.isAbsoluteUrl)(node.$ref)) {
|
package/lib/config/config.d.ts
CHANGED
|
@@ -3,6 +3,12 @@ import { SpecVersion, SpecMajorVersion, Oas2RuleSet, Oas3RuleSet, Async2RuleSet
|
|
|
3
3
|
import type { NodeType } from '../types';
|
|
4
4
|
import type { DecoratorConfig, Plugin, PreprocessorConfig, Region, ResolveConfig, ResolvedApi, ResolvedConfig, ResolvedStyleguideConfig, RuleConfig, RuleSettings, Telemetry, ThemeRawConfig } from './types';
|
|
5
5
|
export declare const IGNORE_FILE = ".redocly.lint-ignore.yaml";
|
|
6
|
+
export declare const DEFAULT_REGION = "us";
|
|
7
|
+
export declare const DOMAINS: {
|
|
8
|
+
us: string;
|
|
9
|
+
eu: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const AVAILABLE_REGIONS: Region[];
|
|
6
12
|
export declare class StyleguideConfig {
|
|
7
13
|
rawConfig: ResolvedStyleguideConfig;
|
|
8
14
|
configFile?: string | undefined;
|
package/lib/config/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Config = exports.StyleguideConfig = exports.IGNORE_FILE = void 0;
|
|
3
|
+
exports.Config = exports.StyleguideConfig = exports.AVAILABLE_REGIONS = exports.DOMAINS = exports.DEFAULT_REGION = exports.IGNORE_FILE = void 0;
|
|
4
4
|
const fs = require("fs");
|
|
5
5
|
const path = require("path");
|
|
6
6
|
const js_yaml_1 = require("../js-yaml");
|
|
@@ -12,6 +12,22 @@ const ref_utils_1 = require("../ref-utils");
|
|
|
12
12
|
exports.IGNORE_FILE = '.redocly.lint-ignore.yaml';
|
|
13
13
|
const IGNORE_BANNER = `# This file instructs Redocly's linter to ignore the rules contained for specific parts of your API.\n` +
|
|
14
14
|
`# See https://redoc.ly/docs/cli/ for more information.\n`;
|
|
15
|
+
exports.DEFAULT_REGION = 'us';
|
|
16
|
+
function getDomains() {
|
|
17
|
+
const domains = {
|
|
18
|
+
us: 'redocly.com',
|
|
19
|
+
eu: 'eu.redocly.com',
|
|
20
|
+
};
|
|
21
|
+
// FIXME: temporary fix for our lab environments
|
|
22
|
+
const domain = env_1.env.REDOCLY_DOMAIN;
|
|
23
|
+
if (domain === null || domain === void 0 ? void 0 : domain.endsWith('.redocly.host')) {
|
|
24
|
+
domains[domain.split('.')[0]] = domain;
|
|
25
|
+
}
|
|
26
|
+
if (domain === 'redoc.online') {
|
|
27
|
+
domains[domain] = domain;
|
|
28
|
+
}
|
|
29
|
+
return domains;
|
|
30
|
+
}
|
|
15
31
|
function getIgnoreFilePath(configFile) {
|
|
16
32
|
if (configFile) {
|
|
17
33
|
return (0, utils_1.doesYamlFileExist)(configFile)
|
|
@@ -22,6 +38,8 @@ function getIgnoreFilePath(configFile) {
|
|
|
22
38
|
return env_1.isBrowser ? undefined : path.join(process.cwd(), exports.IGNORE_FILE);
|
|
23
39
|
}
|
|
24
40
|
}
|
|
41
|
+
exports.DOMAINS = getDomains();
|
|
42
|
+
exports.AVAILABLE_REGIONS = Object.keys(exports.DOMAINS);
|
|
25
43
|
class StyleguideConfig {
|
|
26
44
|
constructor(rawConfig, configFile) {
|
|
27
45
|
this.rawConfig = rawConfig;
|
package/lib/config/load.js
CHANGED
|
@@ -15,10 +15,10 @@ const path = require("path");
|
|
|
15
15
|
const redocly_1 = require("../redocly");
|
|
16
16
|
const utils_1 = require("../utils");
|
|
17
17
|
const js_yaml_1 = require("../js-yaml");
|
|
18
|
+
const config_1 = require("./config");
|
|
18
19
|
const utils_2 = require("./utils");
|
|
19
20
|
const config_resolvers_1 = require("./config-resolvers");
|
|
20
21
|
const bundle_1 = require("../bundle");
|
|
21
|
-
const domains_1 = require("../redocly/domains");
|
|
22
22
|
function addConfigMetadata({ rawConfig, customExtends, configPath, tokens, files, region, }) {
|
|
23
23
|
var _a;
|
|
24
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -36,7 +36,7 @@ function addConfigMetadata({ rawConfig, customExtends, configPath, tokens, files
|
|
|
36
36
|
rawConfig.resolve.http = {};
|
|
37
37
|
rawConfig.resolve.http.headers = [...((_a = rawConfig.resolve.http.headers) !== null && _a !== void 0 ? _a : [])];
|
|
38
38
|
for (const item of tokens) {
|
|
39
|
-
const domain =
|
|
39
|
+
const domain = config_1.DOMAINS[item.region];
|
|
40
40
|
rawConfig.resolve.http.headers.push({
|
|
41
41
|
matches: `https://api.${domain}/registry/**`,
|
|
42
42
|
name: 'Authorization',
|
package/lib/config/types.d.ts
CHANGED
|
@@ -157,14 +157,4 @@ export type ThemeRawConfig = {
|
|
|
157
157
|
mockServer?: Record<string, any>;
|
|
158
158
|
};
|
|
159
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';
|
|
160
|
-
export declare enum AuthProviderType {
|
|
161
|
-
OIDC = "OIDC",
|
|
162
|
-
SAML2 = "SAML2",
|
|
163
|
-
BASIC = "BASIC"
|
|
164
|
-
}
|
|
165
|
-
export declare enum ApigeeDevOnboardingIntegrationAuthType {
|
|
166
|
-
SERVICE_ACCOUNT = "SERVICE_ACCOUNT",
|
|
167
|
-
OAUTH2 = "OAUTH2"
|
|
168
|
-
}
|
|
169
|
-
export declare const DEFAULT_TEAM_CLAIM_NAME = "https://redocly.com/sso/teams";
|
|
170
160
|
export {};
|
package/lib/config/types.js
CHANGED
|
@@ -1,15 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_TEAM_CLAIM_NAME = exports.ApigeeDevOnboardingIntegrationAuthType = exports.AuthProviderType = void 0;
|
|
4
|
-
var AuthProviderType;
|
|
5
|
-
(function (AuthProviderType) {
|
|
6
|
-
AuthProviderType["OIDC"] = "OIDC";
|
|
7
|
-
AuthProviderType["SAML2"] = "SAML2";
|
|
8
|
-
AuthProviderType["BASIC"] = "BASIC";
|
|
9
|
-
})(AuthProviderType || (exports.AuthProviderType = AuthProviderType = {}));
|
|
10
|
-
var ApigeeDevOnboardingIntegrationAuthType;
|
|
11
|
-
(function (ApigeeDevOnboardingIntegrationAuthType) {
|
|
12
|
-
ApigeeDevOnboardingIntegrationAuthType["SERVICE_ACCOUNT"] = "SERVICE_ACCOUNT";
|
|
13
|
-
ApigeeDevOnboardingIntegrationAuthType["OAUTH2"] = "OAUTH2";
|
|
14
|
-
})(ApigeeDevOnboardingIntegrationAuthType || (exports.ApigeeDevOnboardingIntegrationAuthType = ApigeeDevOnboardingIntegrationAuthType = {}));
|
|
15
|
-
exports.DEFAULT_TEAM_CLAIM_NAME = 'https://redocly.com/sso/teams';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RegistryDependencies = void 0;
|
|
4
|
-
const
|
|
4
|
+
const redocly_1 = require("../../redocly");
|
|
5
5
|
const RegistryDependencies = () => {
|
|
6
6
|
const registryDependencies = new Set();
|
|
7
7
|
return {
|
|
@@ -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 ((0,
|
|
17
|
+
if ((0, redocly_1.isRedoclyRegistryURL)(link)) {
|
|
18
18
|
registryDependencies.add(link);
|
|
19
19
|
}
|
|
20
20
|
}
|
package/lib/env.js
CHANGED
|
@@ -4,5 +4,7 @@ exports.env = exports.isBrowser = void 0;
|
|
|
4
4
|
exports.isBrowser =
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
6
|
// @ts-ignore
|
|
7
|
-
typeof window !== 'undefined' ||
|
|
7
|
+
typeof window !== 'undefined' ||
|
|
8
|
+
typeof process === 'undefined' ||
|
|
9
|
+
(process === null || process === void 0 ? void 0 : process.platform) === 'browser'; // main and worker thread
|
|
8
10
|
exports.env = exports.isBrowser ? {} : process.env || {};
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BundleOutputFormat, readFileFromUrl, slash, doesYamlFileExist, isTruthy
|
|
1
|
+
export { BundleOutputFormat, readFileFromUrl, slash, doesYamlFileExist, isTruthy } from './utils';
|
|
2
2
|
export { Oas3_1Types } from './types/oas3_1';
|
|
3
3
|
export { Oas3Types } from './types/oas3';
|
|
4
4
|
export { Oas2Types } from './types/oas2';
|
|
@@ -10,8 +10,7 @@ export type { StatsAccumulator, StatsName } from './typings/common';
|
|
|
10
10
|
export { normalizeTypes } from './types';
|
|
11
11
|
export { Stats } from './rules/other/stats';
|
|
12
12
|
export { Config, StyleguideConfig, RawConfig, RawUniversalConfig, IGNORE_FILE, Region, getMergedConfig, transformConfig, loadConfig, getConfig, findConfig, CONFIG_FILE_NAMES, RuleSeverity, createConfig, ResolvedApi, } from './config';
|
|
13
|
-
export { RedoclyClient } from './redocly';
|
|
14
|
-
export * from './redocly/domains';
|
|
13
|
+
export { RedoclyClient, isRedoclyRegistryURL } from './redocly';
|
|
15
14
|
export { Source, BaseResolver, Document, resolveDocument, ResolveError, YamlParseError, makeDocumentFromString, } from './resolve';
|
|
16
15
|
export { parseYaml, stringifyYaml } from './js-yaml';
|
|
17
16
|
export { unescapePointer, isRef, isAbsoluteUrl } from './ref-utils';
|
package/lib/index.js
CHANGED
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.lintConfig = exports.lintFromString = 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.Oas3_1Types = exports.
|
|
3
|
+
exports.lintConfig = exports.lintFromString = 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.isRedoclyRegistryURL = 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.Oas3_1Types = exports.isTruthy = exports.doesYamlFileExist = exports.slash = exports.readFileFromUrl = void 0;
|
|
18
4
|
exports.bundleFromString = exports.mapTypeToComponent = exports.bundleDocument = exports.bundle = void 0;
|
|
19
5
|
var utils_1 = require("./utils");
|
|
20
6
|
Object.defineProperty(exports, "readFileFromUrl", { enumerable: true, get: function () { return utils_1.readFileFromUrl; } });
|
|
21
7
|
Object.defineProperty(exports, "slash", { enumerable: true, get: function () { return utils_1.slash; } });
|
|
22
8
|
Object.defineProperty(exports, "doesYamlFileExist", { enumerable: true, get: function () { return utils_1.doesYamlFileExist; } });
|
|
23
9
|
Object.defineProperty(exports, "isTruthy", { enumerable: true, get: function () { return utils_1.isTruthy; } });
|
|
24
|
-
Object.defineProperty(exports, "getProxyAgent", { enumerable: true, get: function () { return utils_1.getProxyAgent; } });
|
|
25
10
|
var oas3_1_1 = require("./types/oas3_1");
|
|
26
11
|
Object.defineProperty(exports, "Oas3_1Types", { enumerable: true, get: function () { return oas3_1_1.Oas3_1Types; } });
|
|
27
12
|
var oas3_1 = require("./types/oas3");
|
|
@@ -49,7 +34,7 @@ Object.defineProperty(exports, "CONFIG_FILE_NAMES", { enumerable: true, get: fun
|
|
|
49
34
|
Object.defineProperty(exports, "createConfig", { enumerable: true, get: function () { return config_1.createConfig; } });
|
|
50
35
|
var redocly_1 = require("./redocly");
|
|
51
36
|
Object.defineProperty(exports, "RedoclyClient", { enumerable: true, get: function () { return redocly_1.RedoclyClient; } });
|
|
52
|
-
|
|
37
|
+
Object.defineProperty(exports, "isRedoclyRegistryURL", { enumerable: true, get: function () { return redocly_1.isRedoclyRegistryURL; } });
|
|
53
38
|
var resolve_1 = require("./resolve");
|
|
54
39
|
Object.defineProperty(exports, "Source", { enumerable: true, get: function () { return resolve_1.Source; } });
|
|
55
40
|
Object.defineProperty(exports, "BaseResolver", { enumerable: true, get: function () { return resolve_1.BaseResolver; } });
|
package/lib/oas-types.d.ts
CHANGED
|
@@ -24,4 +24,4 @@ export type Oas2DecoratorsSet = Record<string, Oas2Preprocessor>;
|
|
|
24
24
|
export type Async2DecoratorsSet = Record<string, Async2Preprocessor>;
|
|
25
25
|
export declare function detectSpec(root: any): SpecVersion;
|
|
26
26
|
export declare function getMajorSpecVersion(version: SpecVersion): SpecMajorVersion;
|
|
27
|
-
export declare function getTypes(spec: SpecVersion): Record<string, import("./types").NodeType> | Record<"Root" | "Tag" | "ExternalDocs" | "SecurityRequirement" | "Info" | "Contact" | "License" | "Paths" | "PathItem" | "Parameter" | "Operation" | "Example" | "Header" | "Responses" | "Response" | "Schema" | "Xml" | "SchemaProperties" | "NamedSchemas" | "NamedResponses" | "NamedParameters" | "NamedSecuritySchemes" | "SecurityScheme" | "Examples" | "ExamplesMap" | "TagList" | "SecurityRequirementList" | "ParameterList" | "ParameterItems" | "TagGroup" | "TagGroups" | "EnumDescriptions" | "Logo" | "XCodeSample" | "XCodeSampleList" | "XServer" | "XServerList", import("./types").NodeType> | Record<"Root" | "Tag" | "ExternalDocs" | "Server" | "ServerVariable" | "SecurityRequirement" | "Info" | "Contact" | "License" | "Paths" | "PathItem" | "Callback" | "CallbacksMap" | "Parameter" | "Operation" | "RequestBody" | "MediaTypesMap" | "MediaType" | "Example" | "Encoding" | "Header" | "Responses" | "Response" | "Link" | "Schema" | "Xml" | "SchemaProperties" | "DiscriminatorMapping" | "Discriminator" | "Components" | "NamedSchemas" | "NamedResponses" | "NamedParameters" | "NamedExamples" | "NamedRequestBodies" | "NamedHeaders" | "NamedSecuritySchemes" | "NamedLinks" | "NamedCallbacks" | "ImplicitFlow" | "PasswordFlow" | "ClientCredentials" | "AuthorizationCode" | "OAuth2Flows" | "SecurityScheme" | "ServerVariablesMap" | "ExamplesMap" | "EncodingMap" | "HeadersMap" | "LinksMap" | "
|
|
27
|
+
export declare function getTypes(spec: SpecVersion): Record<string, import("./types").NodeType> | Record<"Root" | "Tag" | "ExternalDocs" | "SecurityRequirement" | "Info" | "Contact" | "License" | "Paths" | "PathItem" | "Parameter" | "Operation" | "Example" | "Header" | "Responses" | "Response" | "Schema" | "Xml" | "SchemaProperties" | "NamedSchemas" | "NamedResponses" | "NamedParameters" | "NamedSecuritySchemes" | "SecurityScheme" | "Examples" | "ExamplesMap" | "TagList" | "SecurityRequirementList" | "ParameterList" | "ParameterItems" | "TagGroup" | "TagGroups" | "EnumDescriptions" | "Logo" | "XCodeSample" | "XCodeSampleList" | "XServer" | "XServerList", import("./types").NodeType> | Record<"Root" | "Tag" | "ExternalDocs" | "Server" | "ServerVariable" | "SecurityRequirement" | "Info" | "Contact" | "License" | "Paths" | "PathItem" | "Callback" | "CallbacksMap" | "Parameter" | "Operation" | "RequestBody" | "MediaTypesMap" | "MediaType" | "Example" | "Encoding" | "Header" | "Responses" | "Response" | "Link" | "Schema" | "Xml" | "SchemaProperties" | "DiscriminatorMapping" | "Discriminator" | "Components" | "NamedSchemas" | "NamedResponses" | "NamedParameters" | "NamedExamples" | "NamedRequestBodies" | "NamedHeaders" | "NamedSecuritySchemes" | "NamedLinks" | "NamedCallbacks" | "ImplicitFlow" | "PasswordFlow" | "ClientCredentials" | "AuthorizationCode" | "OAuth2Flows" | "SecurityScheme" | "ServerVariablesMap" | "ExamplesMap" | "EncodingMap" | "HeadersMap" | "LinksMap" | "TagList" | "SecurityRequirementList" | "ParameterList" | "TagGroup" | "TagGroups" | "EnumDescriptions" | "Logo" | "XCodeSample" | "XCodeSampleList" | "ServerList" | "XUsePkce" | "WebhooksMap", import("./types").NodeType> | Record<"Root" | "Info" | "License" | "Operation" | "Schema" | "SchemaProperties" | "Components" | "SecurityScheme" | "NamedPathItems", import("./types").NodeType>;
|
package/lib/redocly/index.d.ts
CHANGED
|
@@ -21,10 +21,11 @@ export declare class RedoclyClient {
|
|
|
21
21
|
isAuthorizedWithRedoclyByRegion(): Promise<boolean>;
|
|
22
22
|
isAuthorizedWithRedocly(): Promise<boolean>;
|
|
23
23
|
readCredentialsFile(credentialsPath: string): any;
|
|
24
|
-
verifyToken(accessToken: string, verbose?: boolean): Promise<{
|
|
24
|
+
verifyToken(accessToken: string, region: Region, verbose?: boolean): Promise<{
|
|
25
25
|
viewerId: string;
|
|
26
26
|
organizations: string[];
|
|
27
27
|
}>;
|
|
28
28
|
login(accessToken: string, verbose?: boolean): Promise<void>;
|
|
29
29
|
logout(): void;
|
|
30
30
|
}
|
|
31
|
+
export declare function isRedoclyRegistryURL(link: string): boolean;
|
package/lib/redocly/index.js
CHANGED
|
@@ -9,33 +9,33 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.RedoclyClient = exports.TOKEN_FILENAME = void 0;
|
|
12
|
+
exports.isRedoclyRegistryURL = exports.RedoclyClient = exports.TOKEN_FILENAME = void 0;
|
|
13
13
|
const fs_1 = require("fs");
|
|
14
14
|
const path_1 = require("path");
|
|
15
15
|
const os_1 = require("os");
|
|
16
16
|
const registry_api_1 = require("./registry-api");
|
|
17
|
+
const config_1 = require("../config/config");
|
|
17
18
|
const env_1 = require("../env");
|
|
18
19
|
const utils_1 = require("../utils");
|
|
19
20
|
const logger_1 = require("../logger");
|
|
20
|
-
const domains_1 = require("./domains");
|
|
21
21
|
exports.TOKEN_FILENAME = '.redocly-config.json';
|
|
22
22
|
class RedoclyClient {
|
|
23
23
|
constructor(region) {
|
|
24
24
|
this.accessTokens = {};
|
|
25
25
|
this.region = this.loadRegion(region);
|
|
26
26
|
this.loadTokens();
|
|
27
|
-
this.domain = region ?
|
|
28
|
-
|
|
27
|
+
this.domain = region ? config_1.DOMAINS[region] : env_1.env.REDOCLY_DOMAIN || config_1.DOMAINS[config_1.DEFAULT_REGION];
|
|
28
|
+
env_1.env.REDOCLY_DOMAIN = this.domain; // isRedoclyRegistryURL depends on the value to be set
|
|
29
29
|
this.registryApi = new registry_api_1.RegistryApi(this.accessTokens, this.region);
|
|
30
30
|
}
|
|
31
31
|
loadRegion(region) {
|
|
32
|
-
if (region && !
|
|
32
|
+
if (region && !config_1.DOMAINS[region]) {
|
|
33
33
|
throw new Error(`Invalid argument: region in config file.\nGiven: ${logger_1.colorize.green(region)}, choices: "us", "eu".`);
|
|
34
34
|
}
|
|
35
|
-
if (
|
|
36
|
-
return (
|
|
35
|
+
if (env_1.env.REDOCLY_DOMAIN) {
|
|
36
|
+
return (config_1.AVAILABLE_REGIONS.find((region) => config_1.DOMAINS[region] === env_1.env.REDOCLY_DOMAIN) || config_1.DEFAULT_REGION);
|
|
37
37
|
}
|
|
38
|
-
return region ||
|
|
38
|
+
return region || config_1.DEFAULT_REGION;
|
|
39
39
|
}
|
|
40
40
|
getRegion() {
|
|
41
41
|
return this.region;
|
|
@@ -71,13 +71,13 @@ class RedoclyClient {
|
|
|
71
71
|
}
|
|
72
72
|
getAllTokens() {
|
|
73
73
|
return Object.entries(this.accessTokens)
|
|
74
|
-
.filter(([region]) =>
|
|
74
|
+
.filter(([region]) => config_1.AVAILABLE_REGIONS.includes(region))
|
|
75
75
|
.map(([region, token]) => ({ region, token }));
|
|
76
76
|
}
|
|
77
77
|
getValidTokens() {
|
|
78
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
79
79
|
const allTokens = this.getAllTokens();
|
|
80
|
-
const verifiedTokens = yield Promise.allSettled(allTokens.map(({ token }) => this.verifyToken(token)));
|
|
80
|
+
const verifiedTokens = yield Promise.allSettled(allTokens.map(({ token, region }) => this.verifyToken(token, region)));
|
|
81
81
|
return allTokens
|
|
82
82
|
.filter((_, index) => verifiedTokens[index].status === 'fulfilled')
|
|
83
83
|
.map(({ token, region }) => ({ token, region, valid: true }));
|
|
@@ -98,7 +98,7 @@ class RedoclyClient {
|
|
|
98
98
|
return false;
|
|
99
99
|
}
|
|
100
100
|
try {
|
|
101
|
-
yield this.verifyToken(accessToken);
|
|
101
|
+
yield this.verifyToken(accessToken, this.region);
|
|
102
102
|
return true;
|
|
103
103
|
}
|
|
104
104
|
catch (err) {
|
|
@@ -114,16 +114,16 @@ class RedoclyClient {
|
|
|
114
114
|
readCredentialsFile(credentialsPath) {
|
|
115
115
|
return (0, fs_1.existsSync)(credentialsPath) ? JSON.parse((0, fs_1.readFileSync)(credentialsPath, 'utf-8')) : {};
|
|
116
116
|
}
|
|
117
|
-
verifyToken(accessToken, verbose = false) {
|
|
117
|
+
verifyToken(accessToken, region, verbose = false) {
|
|
118
118
|
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
-
return this.registryApi.authStatus(accessToken, verbose);
|
|
119
|
+
return this.registryApi.authStatus(accessToken, region, verbose);
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
122
|
login(accessToken, verbose = false) {
|
|
123
123
|
return __awaiter(this, void 0, void 0, function* () {
|
|
124
124
|
const credentialsPath = (0, path_1.resolve)((0, os_1.homedir)(), exports.TOKEN_FILENAME);
|
|
125
125
|
try {
|
|
126
|
-
yield this.verifyToken(accessToken, verbose);
|
|
126
|
+
yield this.verifyToken(accessToken, this.region, verbose);
|
|
127
127
|
}
|
|
128
128
|
catch (err) {
|
|
129
129
|
throw new Error('Authorization failed. Please check if you entered a valid API key.');
|
|
@@ -142,3 +142,13 @@ class RedoclyClient {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
exports.RedoclyClient = RedoclyClient;
|
|
145
|
+
function isRedoclyRegistryURL(link) {
|
|
146
|
+
const domain = env_1.env.REDOCLY_DOMAIN || config_1.DOMAINS[config_1.DEFAULT_REGION];
|
|
147
|
+
const legacyDomain = domain === 'redocly.com' ? 'redoc.ly' : domain;
|
|
148
|
+
if (!link.startsWith(`https://api.${domain}/registry/`) &&
|
|
149
|
+
!link.startsWith(`https://api.${legacyDomain}/registry/`)) {
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
exports.isRedoclyRegistryURL = isRedoclyRegistryURL;
|
|
@@ -5,10 +5,10 @@ export declare class RegistryApi {
|
|
|
5
5
|
private region;
|
|
6
6
|
constructor(accessTokens: AccessTokens, region: Region);
|
|
7
7
|
get accessToken(): string | false | undefined;
|
|
8
|
-
getBaseUrl(): string;
|
|
8
|
+
getBaseUrl(region?: Region): string;
|
|
9
9
|
setAccessTokens(accessTokens: AccessTokens): this;
|
|
10
10
|
private request;
|
|
11
|
-
authStatus(accessToken: string, verbose?: boolean): Promise<{
|
|
11
|
+
authStatus(accessToken: string, region: Region, verbose?: boolean): Promise<{
|
|
12
12
|
viewerId: string;
|
|
13
13
|
organizations: string[];
|
|
14
14
|
}>;
|
|
@@ -11,8 +11,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.RegistryApi = void 0;
|
|
13
13
|
const node_fetch_1 = require("node-fetch");
|
|
14
|
+
const config_1 = require("../config/config");
|
|
14
15
|
const utils_1 = require("../utils");
|
|
15
|
-
const domains_1 = require("./domains");
|
|
16
16
|
const version = require('../../package.json').version;
|
|
17
17
|
class RegistryApi {
|
|
18
18
|
constructor(accessTokens, region) {
|
|
@@ -22,14 +22,14 @@ class RegistryApi {
|
|
|
22
22
|
get accessToken() {
|
|
23
23
|
return (0, utils_1.isNotEmptyObject)(this.accessTokens) && this.accessTokens[this.region];
|
|
24
24
|
}
|
|
25
|
-
getBaseUrl() {
|
|
26
|
-
return `https://api.${
|
|
25
|
+
getBaseUrl(region = config_1.DEFAULT_REGION) {
|
|
26
|
+
return `https://api.${config_1.DOMAINS[region]}/registry`;
|
|
27
27
|
}
|
|
28
28
|
setAccessTokens(accessTokens) {
|
|
29
29
|
this.accessTokens = accessTokens;
|
|
30
30
|
return this;
|
|
31
31
|
}
|
|
32
|
-
request(path = '', options = {}) {
|
|
32
|
+
request(path = '', options = {}, region) {
|
|
33
33
|
var _a, _b;
|
|
34
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
35
|
const currentCommand = typeof process !== 'undefined' ? ((_a = process.env) === null || _a === void 0 ? void 0 : _a.REDOCLY_CLI_COMMAND) || '' : '';
|
|
@@ -41,7 +41,7 @@ class RegistryApi {
|
|
|
41
41
|
if (!headers.hasOwnProperty('authorization')) {
|
|
42
42
|
throw new Error('Unauthorized');
|
|
43
43
|
}
|
|
44
|
-
const response = yield (0, node_fetch_1.default)(`${this.getBaseUrl()}${path}`, Object.assign({}, options, { headers
|
|
44
|
+
const response = yield (0, node_fetch_1.default)(`${this.getBaseUrl(region)}${path}`, Object.assign({}, options, { headers }));
|
|
45
45
|
if (response.status === 401) {
|
|
46
46
|
throw new Error('Unauthorized');
|
|
47
47
|
}
|
|
@@ -52,10 +52,10 @@ class RegistryApi {
|
|
|
52
52
|
return response;
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
authStatus(accessToken, verbose = false) {
|
|
55
|
+
authStatus(accessToken, region, verbose = false) {
|
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
57
|
try {
|
|
58
|
-
const response = yield this.request('', { headers: { authorization: accessToken } });
|
|
58
|
+
const response = yield this.request('', { headers: { authorization: accessToken } }, region);
|
|
59
59
|
return yield response.json();
|
|
60
60
|
}
|
|
61
61
|
catch (error) {
|
|
@@ -79,7 +79,7 @@ class RegistryApi {
|
|
|
79
79
|
filename,
|
|
80
80
|
isUpsert,
|
|
81
81
|
}),
|
|
82
|
-
});
|
|
82
|
+
}, this.region);
|
|
83
83
|
if (response.ok) {
|
|
84
84
|
return response.json();
|
|
85
85
|
}
|
|
@@ -103,7 +103,7 @@ class RegistryApi {
|
|
|
103
103
|
batchId,
|
|
104
104
|
batchSize,
|
|
105
105
|
}),
|
|
106
|
-
});
|
|
106
|
+
}, this.region);
|
|
107
107
|
if (response.ok) {
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ConfigTypes = exports.createConfigTypes = void 0;
|
|
4
|
-
const
|
|
4
|
+
const config_1 = require("@redocly/config");
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
7
|
const json_schema_adapter_1 = require("./json-schema-adapter");
|
|
@@ -888,7 +888,7 @@ const ConfigReferenceDocs = {
|
|
|
888
888
|
preserveOriginalExtensionsName: { type: 'boolean' },
|
|
889
889
|
markdownHeadingsAnchorLevel: { type: 'number' },
|
|
890
890
|
},
|
|
891
|
-
additionalProperties: {
|
|
891
|
+
additionalProperties: {},
|
|
892
892
|
};
|
|
893
893
|
const ConfigMockServer = {
|
|
894
894
|
properties: {
|
|
@@ -964,4 +964,4 @@ const CoreConfigTypes = {
|
|
|
964
964
|
AssertionDefinitionAssertions,
|
|
965
965
|
AssertionDefinitionSubject,
|
|
966
966
|
};
|
|
967
|
-
exports.ConfigTypes = (0, exports.createConfigTypes)(
|
|
967
|
+
exports.ConfigTypes = (0, exports.createConfigTypes)(config_1.rootRedoclyConfigSchema);
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { UserContext } from './walk';
|
|
2
2
|
import { HttpResolveConfig } from './config';
|
|
3
|
-
import { HttpsProxyAgent } from 'https-proxy-agent';
|
|
4
3
|
export { parseYaml, stringifyYaml } from './js-yaml';
|
|
5
4
|
export type StackFrame<T> = {
|
|
6
5
|
prev: StackFrame<T> | null;
|
|
@@ -51,4 +50,3 @@ export declare function identity<T>(value: T): T;
|
|
|
51
50
|
export declare function keysOf<T>(obj: T): (keyof T)[];
|
|
52
51
|
export declare function pickDefined<T extends Record<string, unknown>>(obj?: T): Record<string, unknown> | undefined;
|
|
53
52
|
export declare function nextTick(): void;
|
|
54
|
-
export declare function getProxyAgent(): HttpsProxyAgent<string> | undefined;
|
package/lib/utils.js
CHANGED
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.nextTick = exports.pickDefined = exports.keysOf = exports.identity = exports.isTruthy = exports.showErrorForDeprecatedField = exports.showWarningForDeprecatedField = exports.doesYamlFileExist = exports.isCustomRuleId = exports.getMatchingStatusCodeRange = exports.assignExisting = exports.isNotString = exports.isString = exports.isNotEmptyObject = exports.slash = exports.isPathParameter = exports.yamlAndJsonSyncReader = exports.readFileAsStringSync = exports.isSingular = exports.validateMimeTypeOAS3 = exports.validateMimeType = exports.splitCamelCaseIntoWords = exports.omitObjectProps = exports.pickObjectProps = exports.readFileFromUrl = exports.isEmptyArray = exports.isEmptyObject = exports.isPlainObject = exports.isDefined = exports.loadYaml = exports.popStack = exports.pushStack = exports.stringifyYaml = exports.parseYaml = void 0;
|
|
13
13
|
const fs = require("fs");
|
|
14
14
|
const path_1 = require("path");
|
|
15
15
|
const minimatch = require("minimatch");
|
|
@@ -18,7 +18,6 @@ const pluralize = require("pluralize");
|
|
|
18
18
|
const js_yaml_1 = require("./js-yaml");
|
|
19
19
|
const env_1 = require("./env");
|
|
20
20
|
const logger_1 = require("./logger");
|
|
21
|
-
const https_proxy_agent_1 = require("https-proxy-agent");
|
|
22
21
|
var js_yaml_2 = require("./js-yaml");
|
|
23
22
|
Object.defineProperty(exports, "parseYaml", { enumerable: true, get: function () { return js_yaml_2.parseYaml; } });
|
|
24
23
|
Object.defineProperty(exports, "stringifyYaml", { enumerable: true, get: function () { return js_yaml_2.stringifyYaml; } });
|
|
@@ -240,8 +239,3 @@ exports.nextTick = nextTick;
|
|
|
240
239
|
function getUpdatedFieldName(updatedField, updatedObject) {
|
|
241
240
|
return `${typeof updatedObject !== 'undefined' ? `${updatedObject}.` : ''}${updatedField}`;
|
|
242
241
|
}
|
|
243
|
-
function getProxyAgent() {
|
|
244
|
-
const proxy = process.env.HTTPS_PROXY || process.env.HTTP_PROXY;
|
|
245
|
-
return proxy ? new https_proxy_agent_1.HttpsProxyAgent(proxy) : undefined;
|
|
246
|
-
}
|
|
247
|
-
exports.getProxyAgent = getProxyAgent;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-core",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
"path": "path-browserify",
|
|
19
19
|
"os": false,
|
|
20
20
|
"node-fetch": false,
|
|
21
|
-
"colorette": false
|
|
22
|
-
"https-proxy-agent": false
|
|
21
|
+
"colorette": false
|
|
23
22
|
},
|
|
24
23
|
"homepage": "https://github.com/Redocly/redocly-cli",
|
|
25
24
|
"keywords": [
|
|
@@ -36,8 +35,8 @@
|
|
|
36
35
|
],
|
|
37
36
|
"dependencies": {
|
|
38
37
|
"@redocly/ajv": "^8.11.0",
|
|
38
|
+
"@redocly/config": "^0.1.1",
|
|
39
39
|
"colorette": "^1.2.0",
|
|
40
|
-
"https-proxy-agent": "^7.0.4",
|
|
41
40
|
"js-levenshtein": "^1.1.6",
|
|
42
41
|
"js-yaml": "^4.1.0",
|
|
43
42
|
"lodash.isequal": "^4.5.0",
|
|
@@ -6,7 +6,7 @@ import { BaseResolver } from '../resolve';
|
|
|
6
6
|
import { loadConfig } from '../config/load';
|
|
7
7
|
import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../__tests__/utils';
|
|
8
8
|
import { detectSpec } from '../oas-types';
|
|
9
|
-
import {
|
|
9
|
+
import { rootRedoclyConfigSchema } from '@redocly/config';
|
|
10
10
|
import { createConfigTypes } from '../types/redocly-yaml';
|
|
11
11
|
|
|
12
12
|
const testPortalConfig = parseYamlToDocument(
|
|
@@ -1124,20 +1124,6 @@ describe('lint', () => {
|
|
|
1124
1124
|
"severity": "error",
|
|
1125
1125
|
"suggest": [],
|
|
1126
1126
|
},
|
|
1127
|
-
{
|
|
1128
|
-
"from": undefined,
|
|
1129
|
-
"location": [
|
|
1130
|
-
{
|
|
1131
|
-
"pointer": "#/theme/footer/items/0/items/0/href",
|
|
1132
|
-
"reportOnKey": true,
|
|
1133
|
-
"source": "",
|
|
1134
|
-
},
|
|
1135
|
-
],
|
|
1136
|
-
"message": "Property \`href\` is not expected here.",
|
|
1137
|
-
"ruleId": "configuration spec",
|
|
1138
|
-
"severity": "error",
|
|
1139
|
-
"suggest": [],
|
|
1140
|
-
},
|
|
1141
1127
|
{
|
|
1142
1128
|
"from": undefined,
|
|
1143
1129
|
"location": [
|
|
@@ -1204,7 +1190,7 @@ describe('lint', () => {
|
|
|
1204
1190
|
document,
|
|
1205
1191
|
externalConfigTypes: createConfigTypes({
|
|
1206
1192
|
type: 'object',
|
|
1207
|
-
properties: { theme:
|
|
1193
|
+
properties: { theme: rootRedoclyConfigSchema.properties.theme },
|
|
1208
1194
|
additionalProperties: false,
|
|
1209
1195
|
}),
|
|
1210
1196
|
});
|
|
@@ -1379,20 +1365,6 @@ describe('lint', () => {
|
|
|
1379
1365
|
"severity": "error",
|
|
1380
1366
|
"suggest": [],
|
|
1381
1367
|
},
|
|
1382
|
-
{
|
|
1383
|
-
"from": undefined,
|
|
1384
|
-
"location": [
|
|
1385
|
-
{
|
|
1386
|
-
"pointer": "#/theme/footer/items/0/items/0/href",
|
|
1387
|
-
"reportOnKey": true,
|
|
1388
|
-
"source": "",
|
|
1389
|
-
},
|
|
1390
|
-
],
|
|
1391
|
-
"message": "Property \`href\` is not expected here.",
|
|
1392
|
-
"ruleId": "configuration spec",
|
|
1393
|
-
"severity": "error",
|
|
1394
|
-
"suggest": [],
|
|
1395
|
-
},
|
|
1396
1368
|
{
|
|
1397
1369
|
"from": undefined,
|
|
1398
1370
|
"location": [
|
package/src/bundle.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { isAbsoluteUrl, isRef, Location, refBaseName } from './ref-utils';
|
|
|
14
14
|
import { initRules } from './config/rules';
|
|
15
15
|
import { reportUnresolvedRef } from './rules/no-unresolved-refs';
|
|
16
16
|
import { isPlainObject, isTruthy } from './utils';
|
|
17
|
-
import { isRedoclyRegistryURL } from './redocly
|
|
17
|
+
import { isRedoclyRegistryURL } from './redocly';
|
|
18
18
|
import { RemoveUnusedComponents as RemoveUnusedComponentsOas2 } from './decorators/oas2/remove-unused-components';
|
|
19
19
|
import { RemoveUnusedComponents as RemoveUnusedComponentsOas3 } from './decorators/oas3/remove-unused-components';
|
|
20
20
|
import { ConfigTypes } from './types/redocly-yaml';
|