@redocly/config 0.31.0 → 0.33.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/constants.d.ts +1 -0
  2. package/lib/constants.js +28 -1
  3. package/lib/default-theme-config-schema.d.ts +106 -0
  4. package/lib/entities-catalog-config-schema.d.ts +426 -0
  5. package/lib/entities-catalog-config-schema.js +100 -1
  6. package/lib/entities-catalog-entity-file-schema.d.ts +964 -0
  7. package/lib/entities-catalog-entity-file-schema.js +273 -0
  8. package/lib/ex-theme-config-schemas.d.ts +3 -0
  9. package/lib/index.d.ts +2 -1
  10. package/lib/index.js +3 -1
  11. package/lib/product-override-schema.d.ts +15 -0
  12. package/lib/redoc-config-schema.d.ts +3 -0
  13. package/lib/redoc-config-schema.js +1 -0
  14. package/lib/reunite-config-schema.d.ts +1 -1
  15. package/lib/reunite-config-schema.js +1 -1
  16. package/lib/root-config-schema.d.ts +4325 -5128
  17. package/lib/root-config-schema.js +1 -1
  18. package/lib/types/api-functions-types.d.ts +1 -1
  19. package/lib/types/catalog-entity-types.d.ts +42 -2
  20. package/lib/types/config-types.d.ts +0 -2
  21. package/lib/types/portal-shared-types.d.ts +1 -1
  22. package/lib-esm/constants.d.ts +1 -0
  23. package/lib-esm/constants.js +27 -0
  24. package/lib-esm/default-theme-config-schema.d.ts +106 -0
  25. package/lib-esm/entities-catalog-config-schema.d.ts +426 -0
  26. package/lib-esm/entities-catalog-config-schema.js +99 -0
  27. package/lib-esm/entities-catalog-entity-file-schema.d.ts +964 -0
  28. package/lib-esm/entities-catalog-entity-file-schema.js +270 -0
  29. package/lib-esm/ex-theme-config-schemas.d.ts +3 -0
  30. package/lib-esm/index.d.ts +2 -1
  31. package/lib-esm/index.js +2 -1
  32. package/lib-esm/product-override-schema.d.ts +15 -0
  33. package/lib-esm/redoc-config-schema.d.ts +3 -0
  34. package/lib-esm/redoc-config-schema.js +1 -0
  35. package/lib-esm/reunite-config-schema.d.ts +1 -1
  36. package/lib-esm/reunite-config-schema.js +1 -1
  37. package/lib-esm/root-config-schema.d.ts +4325 -5128
  38. package/lib-esm/root-config-schema.js +1 -1
  39. package/lib-esm/types/api-functions-types.d.ts +1 -1
  40. package/lib-esm/types/catalog-entity-types.d.ts +42 -2
  41. package/lib-esm/types/config-types.d.ts +0 -2
  42. package/lib-esm/types/portal-shared-types.d.ts +1 -1
  43. package/package.json +1 -1
@@ -404,7 +404,7 @@ exports.redoclyConfigSchema = {
404
404
  }, apis: {
405
405
  type: 'object',
406
406
  additionalProperties: exports.apiConfigSchema,
407
- }, extends: { type: 'array', items: { type: 'string' } } }, common_1.ruleSchemas), common_1.decoratorsSchemas), common_1.preprocessorSchemas), { ssoDirect: exports.ssoDirectConfigSchema, sso: exports.ssoConfigSchema, residency: { type: 'string' }, developerOnboarding: devOnboardingConfigSchema, removeAttribution: { type: 'boolean' }, i18n: exports.l10nConfigSchema, l10n: exports.l10nConfigSchema, metadata: metadataConfigSchema, metadataGlobs: metadataGlobsConfigSchema, ignore: { type: 'array', items: { type: 'string' } },
407
+ }, extends: { type: 'array', items: { type: 'string' } } }, common_1.ruleSchemas), common_1.decoratorsSchemas), common_1.preprocessorSchemas), { ssoDirect: exports.ssoDirectConfigSchema, sso: exports.ssoConfigSchema, residency: { type: 'string', pattern: '^https?://.*' }, developerOnboarding: devOnboardingConfigSchema, removeAttribution: { type: 'boolean' }, i18n: exports.l10nConfigSchema, l10n: exports.l10nConfigSchema, metadata: metadataConfigSchema, metadataGlobs: metadataGlobsConfigSchema, ignore: { type: 'array', items: { type: 'string' } },
408
408
  /**
409
409
  * @deprecated properties moved to the root of the config
410
410
  */
@@ -30,7 +30,7 @@ export type ApiFunctionsContext = {
30
30
  query: Record<string, string | string[]>;
31
31
  cookies: Record<string, string>;
32
32
  } & ApiFunctionsContextMethods;
33
- export type ApiFunctionsHandler = (request: Request, context: ApiFunctionsContext,
33
+ export type ApiRoutesHandler = (request: Request, context: ApiFunctionsContext,
34
34
  /**
35
35
  * @deprecated `staticData` is deprecated.
36
36
  */
@@ -1,6 +1,8 @@
1
1
  import type { FromSchema } from 'json-schema-to-ts';
2
- import type { entityCatalogSpecificCatalogSchema } from '../entities-catalog-config-schema';
2
+ import type { entityCatalogEntityTypeSchema, entityCatalogSpecificCatalogSchema } from '../entities-catalog-config-schema';
3
+ import type { apiDescriptionMetadataSchema, apiOperationMetadataSchema, dataSchemaMetadataSchema, defaultMetadataSchema, entityContactFileSchema, entityLinkFileSchema, entityRelationFileSchema, slackChannelFileSchema, slackContactFileSchema, userMetadataSchema } from '../entities-catalog-entity-file-schema';
3
4
  export type EntityCatalogSpecificCatalogConfig = FromSchema<typeof entityCatalogSpecificCatalogSchema>;
5
+ export type EntityCatalogEntityTypeConfig = FromSchema<typeof entityCatalogEntityTypeSchema>;
4
6
  export type CatalogConfigEntityExclude = {
5
7
  key: string;
6
8
  };
@@ -30,7 +32,7 @@ export type CatalogEntityConfig = {
30
32
  descriptionTranslationKey?: string;
31
33
  catalogSwitcherLabelTranslationKey?: string;
32
34
  };
33
- export type EntitiesCatalogConfigTypes = {
35
+ export type EntitiesCatalogConfig = {
34
36
  catalogs?: {
35
37
  all?: EntityCatalogSpecificCatalogConfig;
36
38
  services?: EntityCatalogSpecificCatalogConfig;
@@ -42,4 +44,42 @@ export type EntitiesCatalogConfigTypes = {
42
44
  apiOperations?: EntityCatalogSpecificCatalogConfig;
43
45
  [catalogName: string]: EntityCatalogSpecificCatalogConfig | undefined;
44
46
  };
47
+ entityTypes?: Record<string, EntityCatalogEntityTypeConfig>;
45
48
  };
49
+ export type SlackChannelFileSchema = FromSchema<typeof slackChannelFileSchema>;
50
+ export type SlackContactFileSchema = FromSchema<typeof slackContactFileSchema>;
51
+ export type EntityContactFileSchema = FromSchema<typeof entityContactFileSchema>;
52
+ export type EntityLinkFileSchema = FromSchema<typeof entityLinkFileSchema>;
53
+ export type EntityRelationFileSchema = FromSchema<typeof entityRelationFileSchema>;
54
+ export type EntityBaseFileSchema = {
55
+ key: string;
56
+ title: string;
57
+ summary?: string | null;
58
+ tags?: string[] | null;
59
+ git?: string[] | null;
60
+ contact?: EntityContactFileSchema | null;
61
+ links?: EntityLinkFileSchema[] | null;
62
+ relations?: EntityRelationFileSchema[] | null;
63
+ type: string;
64
+ metadata?: DefaultMetadataSchema | null;
65
+ };
66
+ export type EntityFileSchema = (Omit<EntityBaseFileSchema, 'type'> & {
67
+ type: 'user';
68
+ metadata: UserMetadataSchema;
69
+ }) | (Omit<EntityBaseFileSchema, 'type'> & {
70
+ type: 'api-description';
71
+ metadata: ApiDescriptionMetadataSchema;
72
+ }) | (Omit<EntityBaseFileSchema, 'type'> & {
73
+ type: 'api-operation';
74
+ metadata: ApiOperationMetadataSchema;
75
+ }) | (Omit<EntityBaseFileSchema, 'type'> & {
76
+ type: 'data-schema';
77
+ metadata: DataSchemaMetadataSchema;
78
+ }) | (Omit<EntityBaseFileSchema, 'type'> & {
79
+ type: 'service' | 'domain' | 'team';
80
+ });
81
+ export type UserMetadataSchema = FromSchema<typeof userMetadataSchema>;
82
+ export type ApiDescriptionMetadataSchema = FromSchema<typeof apiDescriptionMetadataSchema>;
83
+ export type ApiOperationMetadataSchema = FromSchema<typeof apiOperationMetadataSchema>;
84
+ export type DataSchemaMetadataSchema = FromSchema<typeof dataSchemaMetadataSchema>;
85
+ export type DefaultMetadataSchema = FromSchema<typeof defaultMetadataSchema>;
@@ -7,7 +7,6 @@ import type { GraphQLConfigTypes } from './graphql-types';
7
7
  import type { productConfigSchema, productGoogleAnalyticsConfigSchema, markdownConfigSchema, amplitudeAnalyticsConfigSchema, rudderstackAnalyticsConfigSchema, segmentAnalyticsConfigSchema, gtmAnalyticsConfigSchema, googleAnalyticsConfigSchema, scorecardConfigSchema, catalogFilterSchema, catalogSchema, searchFacetsConfigSchema } from '../ex-theme-config-schemas';
8
8
  import type { reuniteConfigSchema } from '../reunite-config-schema';
9
9
  import type { optionalEmailSettings, reasonsSettings } from '../feedback-config-schema';
10
- import type { EntitiesCatalogConfigTypes } from './catalog-entity-types';
11
10
  /**
12
11
  * @deprecated left for backwards compatibility. To be removed in Realm 1.0
13
12
  */
@@ -25,7 +24,6 @@ export type SegmentAnalyticsConfig = FromSchema<typeof segmentAnalyticsConfigSch
25
24
  export type GtmAnalyticsConfig = FromSchema<typeof gtmAnalyticsConfigSchema>;
26
25
  export type GoogleAnalyticsConfig = FromSchema<typeof googleAnalyticsConfigSchema>;
27
26
  export type CatalogConfig = FromSchema<typeof catalogSchema>;
28
- export type EntitiesCatalogConfig = EntitiesCatalogConfigTypes;
29
27
  export type CatalogFilterConfig = FromSchema<typeof catalogFilterSchema>;
30
28
  export type ReuniteConfig = FromSchema<typeof reuniteConfigSchema>;
31
29
  export type ScorecardConfig = FromSchema<typeof scorecardConfigSchema>;
@@ -3,7 +3,7 @@ import type { LayoutVariant, REDOCLY_ROUTE_RBAC, REDOCLY_TEAMS_RBAC } from '../c
3
3
  import type { ProductConfig, ProductGoogleAnalyticsConfig, RbacScopeItems, RedoclyConfig, SeoConfig } from './config-types';
4
4
  import type { CatalogEntityConfig } from './catalog-entity-types';
5
5
  export * from './code-walkthrough-types';
6
- export type UiAccessibleConfig = Pick<RedoclyConfig, 'logo' | 'navbar' | 'products' | 'footer' | 'sidebar' | 'scripts' | 'links' | 'feedback' | 'search' | 'colorMode' | 'navigation' | 'codeSnippet' | 'markdown' | 'openapi' | 'graphql' | 'analytics' | 'userMenu' | 'versionPicker' | 'breadcrumbs' | 'catalog' | 'scorecard'> & {
6
+ export type UiAccessibleConfig = Pick<RedoclyConfig, 'logo' | 'navbar' | 'products' | 'footer' | 'sidebar' | 'scripts' | 'links' | 'feedback' | 'search' | 'colorMode' | 'navigation' | 'codeSnippet' | 'markdown' | 'openapi' | 'graphql' | 'analytics' | 'userMenu' | 'versionPicker' | 'breadcrumbs' | 'catalog' | 'scorecard' | 'entitiesCatalog'> & {
7
7
  auth?: {
8
8
  idpsInfo?: {
9
9
  idpId: string;
@@ -13,3 +13,4 @@ export declare enum LayoutVariant {
13
13
  STACKED = "stacked",
14
14
  THREE_PANEL = "three-panel"
15
15
  }
16
+ export declare const ENTITY_RELATION_TYPES: readonly ["partOf", "hasParts", "creates", "createdBy", "owns", "ownedBy", "implements", "implementedBy", "dependsOn", "dependencyOf", "uses", "usedBy", "produces", "consumes", "linksTo", "supersedes", "supersededBy", "compatibleWith", "extends", "extendedBy", "relatesTo", "hasMember", "memberOf", "triggers", "triggeredBy"];
@@ -16,4 +16,31 @@ export var LayoutVariant;
16
16
  LayoutVariant["STACKED"] = "stacked";
17
17
  LayoutVariant["THREE_PANEL"] = "three-panel";
18
18
  })(LayoutVariant || (LayoutVariant = {}));
19
+ export const ENTITY_RELATION_TYPES = [
20
+ 'partOf',
21
+ 'hasParts',
22
+ 'creates',
23
+ 'createdBy',
24
+ 'owns',
25
+ 'ownedBy',
26
+ 'implements',
27
+ 'implementedBy',
28
+ 'dependsOn',
29
+ 'dependencyOf',
30
+ 'uses',
31
+ 'usedBy',
32
+ 'produces',
33
+ 'consumes',
34
+ 'linksTo',
35
+ 'supersedes',
36
+ 'supersededBy',
37
+ 'compatibleWith',
38
+ 'extends',
39
+ 'extendedBy',
40
+ 'relatesTo',
41
+ 'hasMember',
42
+ 'memberOf',
43
+ 'triggers',
44
+ 'triggeredBy',
45
+ ];
19
46
  //# sourceMappingURL=constants.js.map
@@ -2948,6 +2948,9 @@ export declare const themeConfigSchema: {
2948
2948
  readonly excludeFromSearch: {
2949
2949
  readonly type: "boolean";
2950
2950
  };
2951
+ readonly showSchemaCatalogLinks: {
2952
+ readonly type: "boolean";
2953
+ };
2951
2954
  };
2952
2955
  readonly type: "object";
2953
2956
  readonly additionalProperties: false;
@@ -3982,6 +3985,109 @@ export declare const themeConfigSchema: {
3982
3985
  readonly entitiesCatalog: {
3983
3986
  readonly type: "object";
3984
3987
  readonly properties: {
3988
+ readonly entityTypes: {
3989
+ readonly type: "object";
3990
+ readonly additionalProperties: {
3991
+ readonly type: "object";
3992
+ readonly required: readonly ["name", "description", "metadataSchema"];
3993
+ readonly properties: {
3994
+ readonly name: {
3995
+ readonly type: "string";
3996
+ readonly description: "Display name of the entity type";
3997
+ };
3998
+ readonly description: {
3999
+ readonly type: "string";
4000
+ readonly description: "Description of the entity type";
4001
+ };
4002
+ readonly metadataSchema: {
4003
+ readonly type: "object";
4004
+ readonly required: readonly ["type", "properties"];
4005
+ readonly properties: {
4006
+ readonly type: {
4007
+ readonly type: "string";
4008
+ readonly enum: readonly ["object"];
4009
+ };
4010
+ readonly description: {
4011
+ readonly type: "string";
4012
+ };
4013
+ readonly properties: {
4014
+ readonly type: "object";
4015
+ readonly additionalProperties: {
4016
+ readonly type: "object";
4017
+ readonly properties: {
4018
+ readonly type: {
4019
+ readonly type: "string";
4020
+ readonly enum: readonly ["string", "number", "boolean", "array", "object"];
4021
+ };
4022
+ readonly description: {
4023
+ readonly type: "string";
4024
+ };
4025
+ readonly example: {
4026
+ readonly oneOf: readonly [{
4027
+ readonly type: "string";
4028
+ }, {
4029
+ readonly type: "number";
4030
+ }, {
4031
+ readonly type: "boolean";
4032
+ }, {
4033
+ readonly type: "array";
4034
+ }, {
4035
+ readonly type: "object";
4036
+ }];
4037
+ };
4038
+ readonly enum: {
4039
+ readonly type: "array";
4040
+ readonly items: {
4041
+ readonly type: "string";
4042
+ };
4043
+ };
4044
+ readonly pattern: {
4045
+ readonly type: "string";
4046
+ };
4047
+ readonly format: {
4048
+ readonly type: "string";
4049
+ };
4050
+ readonly minimum: {
4051
+ readonly type: "number";
4052
+ };
4053
+ readonly maximum: {
4054
+ readonly type: "number";
4055
+ };
4056
+ readonly items: {
4057
+ readonly type: "object";
4058
+ };
4059
+ };
4060
+ readonly additionalProperties: true;
4061
+ };
4062
+ };
4063
+ readonly required: {
4064
+ readonly type: "array";
4065
+ readonly items: {
4066
+ readonly type: "string";
4067
+ };
4068
+ };
4069
+ readonly additionalProperties: {
4070
+ readonly type: "boolean";
4071
+ };
4072
+ };
4073
+ readonly additionalProperties: true;
4074
+ };
4075
+ readonly icon: {
4076
+ readonly type: "object";
4077
+ readonly properties: {
4078
+ readonly src: {
4079
+ readonly type: "string";
4080
+ };
4081
+ readonly srcSet: {
4082
+ readonly type: "string";
4083
+ };
4084
+ };
4085
+ readonly additionalProperties: false;
4086
+ };
4087
+ };
4088
+ readonly additionalProperties: false;
4089
+ };
4090
+ };
3985
4091
  readonly catalogs: {
3986
4092
  readonly type: "object";
3987
4093
  readonly properties: {