@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.
Files changed (45) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/lib/bundle.d.ts +1 -1
  3. package/lib/bundle.js +2 -2
  4. package/lib/config/config.d.ts +6 -0
  5. package/lib/config/config.js +19 -1
  6. package/lib/config/load.js +2 -2
  7. package/lib/config/types.d.ts +0 -10
  8. package/lib/config/types.js +0 -13
  9. package/lib/decorators/common/registry-dependencies.js +2 -2
  10. package/lib/env.js +3 -1
  11. package/lib/index.d.ts +2 -3
  12. package/lib/index.js +2 -17
  13. package/lib/oas-types.d.ts +1 -1
  14. package/lib/redocly/index.d.ts +2 -1
  15. package/lib/redocly/index.js +24 -14
  16. package/lib/redocly/registry-api.d.ts +2 -2
  17. package/lib/redocly/registry-api.js +9 -9
  18. package/lib/types/redocly-yaml.js +3 -3
  19. package/lib/utils.d.ts +0 -2
  20. package/lib/utils.js +1 -7
  21. package/package.json +3 -4
  22. package/src/__tests__/lint.test.ts +2 -30
  23. package/src/bundle.ts +1 -1
  24. package/src/config/config.ts +23 -1
  25. package/src/config/load.ts +1 -2
  26. package/src/config/types.ts +0 -13
  27. package/src/decorators/common/registry-dependencies.ts +1 -1
  28. package/src/env.ts +3 -1
  29. package/src/index.ts +2 -11
  30. package/src/redocly/__tests__/redocly-client.test.ts +3 -5
  31. package/src/redocly/index.ts +24 -14
  32. package/src/redocly/registry-api.ts +31 -25
  33. package/src/types/redocly-yaml.ts +2 -2
  34. package/src/utils.ts +1 -7
  35. package/tsconfig.tsbuildinfo +1 -1
  36. package/lib/redocly/domains.d.ts +0 -14
  37. package/lib/redocly/domains.js +0 -41
  38. package/lib/types/portal-config-schema.d.ts +0 -5299
  39. package/lib/types/portal-config-schema.js +0 -338
  40. package/lib/types/theme-config.d.ts +0 -2541
  41. package/lib/types/theme-config.js +0 -637
  42. package/src/redocly/__tests__/domains.test.ts +0 -52
  43. package/src/redocly/domains.ts +0 -48
  44. package/src/types/portal-config-schema.ts +0 -416
  45. package/src/types/theme-config.ts +0 -781
@@ -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;
@@ -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;