@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/lib/redocly/domains.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Region } from '../config/types';
|
|
2
|
-
export declare const DEFAULT_REGION = "us";
|
|
3
|
-
export declare const DOMAINS: {
|
|
4
|
-
us: string;
|
|
5
|
-
eu: string;
|
|
6
|
-
};
|
|
7
|
-
export declare const AVAILABLE_REGIONS: Region[];
|
|
8
|
-
export declare function getDomains(): {
|
|
9
|
-
us: string;
|
|
10
|
-
eu: string;
|
|
11
|
-
};
|
|
12
|
-
export declare function setRedoclyDomain(domain: string): void;
|
|
13
|
-
export declare function getRedoclyDomain(): string;
|
|
14
|
-
export declare function isRedoclyRegistryURL(link: string): boolean;
|
package/lib/redocly/domains.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isRedoclyRegistryURL = exports.getRedoclyDomain = exports.setRedoclyDomain = exports.getDomains = exports.AVAILABLE_REGIONS = exports.DOMAINS = exports.DEFAULT_REGION = void 0;
|
|
4
|
-
let redoclyDomain = 'redocly.com';
|
|
5
|
-
exports.DEFAULT_REGION = 'us';
|
|
6
|
-
exports.DOMAINS = getDomains();
|
|
7
|
-
exports.AVAILABLE_REGIONS = Object.keys(exports.DOMAINS);
|
|
8
|
-
function getDomains() {
|
|
9
|
-
const domains = {
|
|
10
|
-
us: 'redocly.com',
|
|
11
|
-
eu: 'eu.redocly.com',
|
|
12
|
-
};
|
|
13
|
-
// FIXME: temporary fix for our lab environments
|
|
14
|
-
const domain = redoclyDomain;
|
|
15
|
-
if (domain === null || domain === void 0 ? void 0 : domain.endsWith('.redocly.host')) {
|
|
16
|
-
domains[domain.split('.')[0]] = domain;
|
|
17
|
-
}
|
|
18
|
-
if (domain === 'redoc.online') {
|
|
19
|
-
domains[domain] = domain;
|
|
20
|
-
}
|
|
21
|
-
return domains;
|
|
22
|
-
}
|
|
23
|
-
exports.getDomains = getDomains;
|
|
24
|
-
function setRedoclyDomain(domain) {
|
|
25
|
-
redoclyDomain = domain;
|
|
26
|
-
}
|
|
27
|
-
exports.setRedoclyDomain = setRedoclyDomain;
|
|
28
|
-
function getRedoclyDomain() {
|
|
29
|
-
return redoclyDomain;
|
|
30
|
-
}
|
|
31
|
-
exports.getRedoclyDomain = getRedoclyDomain;
|
|
32
|
-
function isRedoclyRegistryURL(link) {
|
|
33
|
-
const domain = getRedoclyDomain() || exports.DOMAINS[exports.DEFAULT_REGION];
|
|
34
|
-
const legacyDomain = domain === 'redocly.com' ? 'redoc.ly' : domain;
|
|
35
|
-
if (!link.startsWith(`https://api.${domain}/registry/`) &&
|
|
36
|
-
!link.startsWith(`https://api.${legacyDomain}/registry/`)) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
exports.isRedoclyRegistryURL = isRedoclyRegistryURL;
|