@redocly/openapi-core 1.10.3 → 1.10.5

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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # @redocly/openapi-core
2
2
 
3
+ ## 1.10.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated license text for date and organization naming accuracy.
8
+
9
+ ## 1.10.4
10
+
11
+ ### Patch Changes
12
+
13
+ - Added a platform check so `@redocly/openapi-core` can support running inside a worker.
14
+ - 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.
15
+
3
16
  ## 1.10.3
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): "parameters" | "examples" | "headers" | "schemas" | "responses" | "requestBodies" | "securitySchemes" | "links" | "callbacks" | "definitions" | null;
50
+ export declare function mapTypeToComponent(typeName: string, version: SpecMajorVersion): "definitions" | "examples" | "links" | "responses" | "parameters" | "headers" | "schemas" | "requestBodies" | "securitySchemes" | "callbacks" | null;
@@ -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 {};
@@ -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';
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' || typeof process === 'undefined'; // main and worker thread
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 || {};
@@ -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" | "WebhooksMap" | "TagList" | "SecurityRequirementList" | "ParameterList" | "TagGroup" | "TagGroups" | "EnumDescriptions" | "Logo" | "XCodeSample" | "XCodeSampleList" | "ServerList" | "XUsePkce", import("./types").NodeType> | Record<"Root" | "Info" | "License" | "Operation" | "Schema" | "SchemaProperties" | "Components" | "SecurityScheme" | "NamedPathItems", import("./types").NodeType>;
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>;
@@ -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 portal_config_schema_1 = require("./portal-config-schema");
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: { type: 'string' },
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)(portal_config_schema_1.rootRedoclyConfigSchema);
967
+ exports.ConfigTypes = (0, exports.createConfigTypes)(config_1.rootRedoclyConfigSchema);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/openapi-core",
3
- "version": "1.10.3",
3
+ "version": "1.10.5",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "engines": {
@@ -35,6 +35,7 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@redocly/ajv": "^8.11.0",
38
+ "@redocly/config": "^0.1.4",
38
39
  "colorette": "^1.2.0",
39
40
  "js-levenshtein": "^1.1.6",
40
41
  "js-yaml": "^4.1.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 { themeConfigSchema } from '../types/theme-config';
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: themeConfigSchema },
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": [
@@ -243,16 +243,3 @@ export type RulesFields =
243
243
  | 'oas3_0Decorators'
244
244
  | 'oas3_1Decorators'
245
245
  | 'async2Decorators';
246
-
247
- export enum AuthProviderType {
248
- OIDC = 'OIDC',
249
- SAML2 = 'SAML2',
250
- BASIC = 'BASIC',
251
- }
252
-
253
- export enum ApigeeDevOnboardingIntegrationAuthType {
254
- SERVICE_ACCOUNT = 'SERVICE_ACCOUNT',
255
- OAUTH2 = 'OAUTH2',
256
- }
257
-
258
- export const DEFAULT_TEAM_CLAIM_NAME = 'https://redocly.com/sso/teams';
package/src/env.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export const isBrowser =
2
2
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3
3
  // @ts-ignore
4
- typeof window !== 'undefined' || typeof process === 'undefined'; // main and worker thread
4
+ typeof window !== 'undefined' ||
5
+ typeof process === 'undefined' ||
6
+ (process?.platform as any) === 'browser'; // main and worker thread
5
7
  export const env = isBrowser ? {} : process.env || {};
@@ -1,4 +1,4 @@
1
- import { rootRedoclyConfigSchema } from './portal-config-schema';
1
+ import { rootRedoclyConfigSchema } from '@redocly/config';
2
2
  import { listOf } from '.';
3
3
  import { omitObjectProps, pickObjectProps, isCustomRuleId } from '../utils';
4
4
  import { getNodeTypesFromJSONSchema } from './json-schema-adapter';
@@ -1050,7 +1050,7 @@ const ConfigReferenceDocs: NodeType = {
1050
1050
  preserveOriginalExtensionsName: { type: 'boolean' },
1051
1051
  markdownHeadingsAnchorLevel: { type: 'number' },
1052
1052
  },
1053
- additionalProperties: { type: 'string' },
1053
+ additionalProperties: {},
1054
1054
  };
1055
1055
 
1056
1056
  const ConfigMockServer: NodeType = {