@redocly/config 0.50.0 → 0.51.0

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 (43) hide show
  1. package/lib/asyncapi-config-schema.d.ts +10 -27
  2. package/lib/common.d.ts +126 -113
  3. package/lib/constants/shared.d.ts +1 -0
  4. package/lib/default-theme-config-schema.d.ts +544 -619
  5. package/lib/entities-catalog-config-schema.d.ts +60 -72
  6. package/lib/entities-catalog-entity-file-schema.d.ts +74 -67
  7. package/lib/ex-theme-config-schemas.d.ts +273 -348
  8. package/lib/feedback-config-schema.d.ts +9 -29
  9. package/lib/graphql-config-schema.d.ts +11 -28
  10. package/lib/index.d.ts +1 -1
  11. package/lib/index.js +1 -1
  12. package/lib/product-override-schema.d.ts +2362 -2607
  13. package/lib/redoc-config-schema.d.ts +14 -33
  14. package/lib/reference-docs-config-schema.d.ts +14 -10
  15. package/lib/reunite-config-schema.d.ts +11 -12
  16. package/lib/root-config-schema.d.ts +22774 -17198
  17. package/lib/scorecards-config-schema.d.ts +168 -108
  18. package/lib/types/index.d.ts +1 -0
  19. package/lib/types/json-schema-types.d.ts +69 -0
  20. package/lib/types/portal-shared-types.d.ts +3 -0
  21. package/lib-esm/asyncapi-config-schema.d.ts +10 -27
  22. package/lib-esm/common.d.ts +126 -113
  23. package/lib-esm/constants/shared.d.ts +1 -0
  24. package/lib-esm/default-theme-config-schema.d.ts +544 -619
  25. package/lib-esm/entities-catalog-config-schema.d.ts +60 -72
  26. package/lib-esm/entities-catalog-entity-file-schema.d.ts +74 -67
  27. package/lib-esm/ex-theme-config-schemas.d.ts +273 -348
  28. package/lib-esm/feedback-config-schema.d.ts +9 -29
  29. package/lib-esm/graphql-config-schema.d.ts +11 -28
  30. package/lib-esm/index.d.ts +1 -1
  31. package/lib-esm/index.js +1 -1
  32. package/lib-esm/product-override-schema.d.ts +2362 -2607
  33. package/lib-esm/redoc-config-schema.d.ts +14 -33
  34. package/lib-esm/reference-docs-config-schema.d.ts +14 -10
  35. package/lib-esm/reunite-config-schema.d.ts +11 -12
  36. package/lib-esm/root-config-schema.d.ts +22774 -17198
  37. package/lib-esm/scorecards-config-schema.d.ts +168 -108
  38. package/lib-esm/types/index.d.ts +1 -0
  39. package/lib-esm/types/json-schema-types.d.ts +69 -0
  40. package/lib-esm/types/portal-shared-types.d.ts +3 -0
  41. package/package.json +2 -2
  42. package/lib/remove-property-recursively.d.ts +0 -5
  43. package/lib-esm/remove-property-recursively.d.ts +0 -5
@@ -2,3 +2,4 @@ export * from './api-functions-types.js';
2
2
  export * from './config-types.js';
3
3
  export * from './portal-shared-types.js';
4
4
  export * from './catalog-entity-types.js';
5
+ export * from './json-schema-types.js';
@@ -0,0 +1,69 @@
1
+ /**
2
+ * This type is a subset of JSON Schema that aligns with [json-schema-adapter](https://github.com/Redocly/redocly-cli/blob/main/packages/core/src/types/json-schema-adapter.ts)
3
+ * which translates JSON Schema to the Redocly CLI's internal NodeType tree format.
4
+ *
5
+ * */
6
+ export type RedoclyConfigJSONSchema = Base & (SchemaObject | SchemaArray | SchemaString | SchemaNumber | SchemaBoolean | SchemaOneOf);
7
+ type Base = {
8
+ $id?: string;
9
+ type?: Type;
10
+ description?: string;
11
+ /** Redocly extension: link to the option's documentation page. */
12
+ documentationLink?: string;
13
+ /** Redocly extension: overrides the generated `NodeType` name. */
14
+ nodeTypeName?: string;
15
+ /** @deprecated Not supported by the `NodeType` adapter; avoid in new schemas. */
16
+ not?: any;
17
+ };
18
+ type Type = 'object' | 'array' | 'string' | 'number' | 'integer' | 'boolean';
19
+ type SchemaObject = {
20
+ type: 'object';
21
+ properties?: Record<string, RedoclyConfigJSONSchema>;
22
+ additionalProperties?: boolean | RedoclyConfigJSONSchema;
23
+ unevaluatedProperties?: boolean | RedoclyConfigJSONSchema;
24
+ patternProperties?: Record<string, RedoclyConfigJSONSchema>;
25
+ required?: readonly string[];
26
+ } & SchemaOneOfFragment;
27
+ type SchemaArray = {
28
+ type: 'array';
29
+ items?: RedoclyConfigJSONSchema;
30
+ minItems?: number;
31
+ /** @deprecated Not supported by the `NodeType` adapter; avoid in new schemas. */
32
+ uniqueItems?: boolean;
33
+ };
34
+ type SchemaString = {
35
+ type: 'string';
36
+ pattern?: string;
37
+ minLength?: number;
38
+ maxLength?: number;
39
+ format?: 'uri' | 'email' | 'date-time';
40
+ enum?: readonly (string | number | boolean | null)[];
41
+ const?: string | number | boolean | null;
42
+ };
43
+ type SchemaNumber = {
44
+ type: 'number' | 'integer';
45
+ minimum?: number;
46
+ };
47
+ type SchemaBoolean = {
48
+ type: 'boolean';
49
+ };
50
+ /** A standalone `oneOf` schema whose branches are full schemas. */
51
+ type SchemaOneOf = {
52
+ oneOf: readonly RedoclyConfigJSONSchema[];
53
+ discriminator?: {
54
+ propertyName: string;
55
+ mapping?: Record<string, RedoclyConfigJSONSchema>;
56
+ };
57
+ };
58
+ /** A `oneOf` inside an object schema; branches only narrow `required`. */
59
+ type SchemaOneOfFragment = {
60
+ oneOf?: readonly SchemaObjectFragment[];
61
+ discriminator?: {
62
+ propertyName: string;
63
+ mapping?: Record<string, RedoclyConfigJSONSchema>;
64
+ };
65
+ };
66
+ type SchemaObjectFragment = {
67
+ required: readonly string[];
68
+ };
69
+ export {};
@@ -1,7 +1,9 @@
1
1
  import type { Node } from '@markdoc/markdoc/dist/src/types';
2
+ import type { FromSchema } from 'json-schema-to-ts';
2
3
  import type { LayoutVariant, REDOCLY_ROUTE_RBAC, REDOCLY_TEAMS_RBAC } from '../constants/shared.js';
3
4
  import type { ProductConfig, ProductGoogleAnalyticsConfig, RbacScopeItems, RedoclyConfig, SeoConfig, BannerConfig } from './config-types.js';
4
5
  import type { CatalogEntityConfig } from './catalog-entity-types.js';
6
+ import type { searchConfigSchema } from '../ex-theme-config-schemas.js';
5
7
  export * from './code-walkthrough-types.js';
6
8
  export type UiAccessibleConfig = Pick<RedoclyConfig, 'logo' | 'navbar' | 'products' | 'footer' | 'sidebar' | 'scripts' | 'links' | 'feedback' | 'search' | 'aiAssistant' | 'colorMode' | 'palette' | 'navigation' | 'codeSnippet' | 'markdown' | 'openapi' | 'graphql' | 'analytics' | 'userMenu' | 'versionPicker' | 'breadcrumbs' | 'catalog' | 'scorecard' | 'scorecards' | 'scorecardClassic' | 'entitiesCatalog' | 'mcp'> & {
7
9
  auth?: {
@@ -334,3 +336,4 @@ export type ProductUiConfig = ProductConfig & {
334
336
  };
335
337
  configOverride?: ProductThemeOverrideConfig;
336
338
  };
339
+ export type SearchEngineType = NonNullable<FromSchema<typeof searchConfigSchema>['engine']>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/config",
3
- "version": "0.50.0",
3
+ "version": "0.51.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -21,7 +21,7 @@
21
21
  "devDependencies": {
22
22
  "@markdoc/markdoc": "0.5.2",
23
23
  "esbuild": "0.28.1",
24
- "@redocly/openapi-core": "2.35.0",
24
+ "@redocly/openapi-core": "2.37.0",
25
25
  "@types/node": "24.1.0",
26
26
  "@types/react": "^19.2.7",
27
27
  "@vitest/coverage-v8": "4.1.8",
@@ -1,5 +0,0 @@
1
- type Removed<T, Drop> = T extends Record<string, any> ? T extends ArrayLike<any> ? Array<Removed<T[number], Drop>> : {
2
- [K in Exclude<keyof T, Drop>]: Removed<T[K], Drop>;
3
- } : T;
4
- export declare function removePropertyRecursively<TObject extends object, TProp extends string>(object: TObject, propToRemove: TProp, parentKey?: string): Removed<TObject, TProp>;
5
- export {};
@@ -1,5 +0,0 @@
1
- type Removed<T, Drop> = T extends Record<string, any> ? T extends ArrayLike<any> ? Array<Removed<T[number], Drop>> : {
2
- [K in Exclude<keyof T, Drop>]: Removed<T[K], Drop>;
3
- } : T;
4
- export declare function removePropertyRecursively<TObject extends object, TProp extends string>(object: TObject, propToRemove: TProp, parentKey?: string): Removed<TObject, TProp>;
5
- export {};