@redocly/openapi-core 1.0.0-rc.3 → 1.0.1

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 (275) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/__tests__/utils.ts +88 -0
  3. package/lib/config/all.js +0 -1
  4. package/lib/config/minimal.js +0 -1
  5. package/lib/config/recommended.js +0 -1
  6. package/package.json +1 -1
  7. package/src/__tests__/__snapshots__/bundle.test.ts.snap +437 -0
  8. package/src/__tests__/bundle.test.ts +236 -0
  9. package/src/__tests__/codeframes.test.ts +530 -0
  10. package/src/__tests__/fixtures/.redocly.lint-ignore.yaml +5 -0
  11. package/src/__tests__/fixtures/extension.js +24 -0
  12. package/src/__tests__/fixtures/refs/definitions.yaml +3 -0
  13. package/src/__tests__/fixtures/refs/examples.yaml +8 -0
  14. package/src/__tests__/fixtures/refs/external-request-body.yaml +13 -0
  15. package/src/__tests__/fixtures/refs/externalref.yaml +35 -0
  16. package/src/__tests__/fixtures/refs/hosted.yaml +35 -0
  17. package/src/__tests__/fixtures/refs/openapi-with-external-refs-conflicting-names.yaml +21 -0
  18. package/src/__tests__/fixtures/refs/openapi-with-external-refs.yaml +33 -0
  19. package/src/__tests__/fixtures/refs/openapi-with-url-refs.yaml +18 -0
  20. package/src/__tests__/fixtures/refs/param-b.yaml +1 -0
  21. package/src/__tests__/fixtures/refs/param-c.yaml +1 -0
  22. package/src/__tests__/fixtures/refs/rename.yaml +1 -0
  23. package/src/__tests__/fixtures/refs/requestBody.yaml +9 -0
  24. package/src/__tests__/fixtures/refs/schema-a.yaml +1 -0
  25. package/src/__tests__/fixtures/refs/simple.yaml +1 -0
  26. package/src/__tests__/fixtures/refs/vendor.schema.yaml +20 -0
  27. package/src/__tests__/fixtures/resolve/External.yaml +10 -0
  28. package/src/__tests__/fixtures/resolve/External2.yaml +4 -0
  29. package/src/__tests__/fixtures/resolve/description.md +3 -0
  30. package/src/__tests__/fixtures/resolve/externalInfo.yaml +4 -0
  31. package/src/__tests__/fixtures/resolve/externalLicense.yaml +1 -0
  32. package/src/__tests__/fixtures/resolve/openapi-with-back.yaml +13 -0
  33. package/src/__tests__/fixtures/resolve/openapi-with-md-description.yaml +5 -0
  34. package/src/__tests__/fixtures/resolve/openapi.yaml +28 -0
  35. package/src/__tests__/fixtures/resolve/schemas/type-a.yaml +10 -0
  36. package/src/__tests__/fixtures/resolve/schemas/type-b.yaml +6 -0
  37. package/src/__tests__/fixtures/resolve/transitive/a.yaml +1 -0
  38. package/src/__tests__/fixtures/resolve/transitive/components.yaml +5 -0
  39. package/src/__tests__/fixtures/resolve/transitive/schemas.yaml +3 -0
  40. package/src/__tests__/format.test.ts +76 -0
  41. package/src/__tests__/js-yaml.test.ts +73 -0
  42. package/src/__tests__/lint.test.ts +392 -0
  43. package/src/__tests__/logger-browser.test.ts +53 -0
  44. package/src/__tests__/logger.test.ts +47 -0
  45. package/src/__tests__/login.test.ts +17 -0
  46. package/src/__tests__/normalizeVisitors.test.ts +151 -0
  47. package/src/__tests__/output-browser.test.ts +18 -0
  48. package/src/__tests__/output.test.ts +15 -0
  49. package/src/__tests__/ref-utils.test.ts +120 -0
  50. package/src/__tests__/resolve-http.test.ts +77 -0
  51. package/src/__tests__/resolve.test.ts +431 -0
  52. package/src/__tests__/utils-browser.test.ts +11 -0
  53. package/src/__tests__/utils.test.ts +144 -0
  54. package/src/__tests__/walk.test.ts +1545 -0
  55. package/src/benchmark/benches/lint-with-many-rules.bench.ts +35 -0
  56. package/src/benchmark/benches/lint-with-nested-rule.bench.ts +39 -0
  57. package/src/benchmark/benches/lint-with-no-rules.bench.ts +20 -0
  58. package/src/benchmark/benches/lint-with-top-level-rule-report.bench.ts +35 -0
  59. package/src/benchmark/benches/lint-with-top-level-rule.bench.ts +32 -0
  60. package/src/benchmark/benches/rebilly.yaml +32275 -0
  61. package/src/benchmark/benches/recommended-oas3.bench.ts +22 -0
  62. package/src/benchmark/benches/resolve-with-no-external.bench.ts +23 -0
  63. package/src/benchmark/benchmark.js +311 -0
  64. package/src/benchmark/colors.js +29 -0
  65. package/src/benchmark/fork.js +83 -0
  66. package/src/benchmark/utils.ts +36 -0
  67. package/src/bundle.ts +417 -0
  68. package/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +164 -0
  69. package/src/config/__tests__/__snapshots__/config.test.ts.snap +144 -0
  70. package/src/config/__tests__/config-resolvers.test.ts +491 -0
  71. package/src/config/__tests__/config.test.ts +312 -0
  72. package/src/config/__tests__/fixtures/ingore-file.ts +8 -0
  73. package/src/config/__tests__/fixtures/load-redocly.yaml +2 -0
  74. package/src/config/__tests__/fixtures/plugin-config.yaml +2 -0
  75. package/src/config/__tests__/fixtures/plugin.js +56 -0
  76. package/src/config/__tests__/fixtures/resolve-config/api/nested-config.yaml +11 -0
  77. package/src/config/__tests__/fixtures/resolve-config/api/plugin.js +69 -0
  78. package/src/config/__tests__/fixtures/resolve-config/local-config-with-circular.yaml +7 -0
  79. package/src/config/__tests__/fixtures/resolve-config/local-config-with-custom-function.yaml +17 -0
  80. package/src/config/__tests__/fixtures/resolve-config/local-config-with-file.yaml +18 -0
  81. package/src/config/__tests__/fixtures/resolve-config/local-config-with-wrong-custom-function.yaml +15 -0
  82. package/src/config/__tests__/fixtures/resolve-config/local-config.yaml +9 -0
  83. package/src/config/__tests__/fixtures/resolve-config/plugin.js +80 -0
  84. package/src/config/__tests__/fixtures/resolve-remote-configs/nested-remote-config.yaml +3 -0
  85. package/src/config/__tests__/fixtures/resolve-remote-configs/remote-config.yaml +4 -0
  86. package/src/config/__tests__/load.test.ts +167 -0
  87. package/src/config/__tests__/resolve-plugins.test.ts +27 -0
  88. package/src/config/__tests__/utils.test.ts +204 -0
  89. package/src/config/all.ts +74 -0
  90. package/src/config/builtIn.ts +37 -0
  91. package/src/config/config-resolvers.ts +474 -0
  92. package/src/config/config.ts +332 -0
  93. package/src/config/index.ts +7 -0
  94. package/src/config/load.ts +144 -0
  95. package/src/config/minimal.ts +61 -0
  96. package/src/config/recommended.ts +61 -0
  97. package/src/config/rules.ts +54 -0
  98. package/src/config/types.ts +231 -0
  99. package/src/config/utils.ts +349 -0
  100. package/src/decorators/__tests__/filter-in.test.ts +310 -0
  101. package/src/decorators/__tests__/filter-out.test.ts +335 -0
  102. package/src/decorators/__tests__/media-type-examples-override.test.ts +665 -0
  103. package/src/decorators/__tests__/remove-x-internal.test.ts +316 -0
  104. package/src/decorators/__tests__/resources/request.yaml +3 -0
  105. package/src/decorators/__tests__/resources/response.yaml +3 -0
  106. package/src/decorators/common/filters/filter-helper.ts +72 -0
  107. package/src/decorators/common/filters/filter-in.ts +18 -0
  108. package/src/decorators/common/filters/filter-out.ts +18 -0
  109. package/src/decorators/common/info-description-override.ts +24 -0
  110. package/src/decorators/common/info-override.ts +15 -0
  111. package/src/decorators/common/media-type-examples-override.ts +79 -0
  112. package/src/decorators/common/operation-description-override.ts +30 -0
  113. package/src/decorators/common/registry-dependencies.ts +25 -0
  114. package/src/decorators/common/remove-x-internal.ts +59 -0
  115. package/src/decorators/common/tag-description-override.ts +25 -0
  116. package/src/decorators/oas2/index.ts +20 -0
  117. package/src/decorators/oas3/index.ts +22 -0
  118. package/src/env.ts +5 -0
  119. package/src/format/codeframes.ts +216 -0
  120. package/src/format/format.ts +375 -0
  121. package/src/index.ts +71 -0
  122. package/src/js-yaml/index.ts +14 -0
  123. package/src/lint.ts +148 -0
  124. package/src/logger.ts +34 -0
  125. package/src/oas-types.ts +57 -0
  126. package/src/output.ts +7 -0
  127. package/src/redocly/__tests__/redocly-client.test.ts +146 -0
  128. package/src/redocly/index.ts +187 -0
  129. package/src/redocly/redocly-client-types.ts +10 -0
  130. package/src/redocly/registry-api-types.ts +32 -0
  131. package/src/redocly/registry-api.ts +150 -0
  132. package/src/ref-utils.ts +85 -0
  133. package/src/resolve.ts +417 -0
  134. package/src/rules/__tests__/fixtures/code-sample.php +9 -0
  135. package/src/rules/__tests__/fixtures/invalid-yaml.yaml +1 -0
  136. package/src/rules/__tests__/fixtures/ref.yaml +1 -0
  137. package/src/rules/__tests__/no-unresolved-refs.test.ts +257 -0
  138. package/src/rules/__tests__/utils.test.ts +160 -0
  139. package/src/rules/ajv.ts +102 -0
  140. package/src/rules/common/__tests__/info-license.test.ts +62 -0
  141. package/src/rules/common/__tests__/license-url.test.ts +63 -0
  142. package/src/rules/common/__tests__/no-ambiguous-paths.test.ts +96 -0
  143. package/src/rules/common/__tests__/no-enum-type-mismatch.test.ts +210 -0
  144. package/src/rules/common/__tests__/no-identical-paths.test.ts +58 -0
  145. package/src/rules/common/__tests__/no-path-trailing-slash.test.ts +85 -0
  146. package/src/rules/common/__tests__/operation-2xx-response.test.ts +192 -0
  147. package/src/rules/common/__tests__/operation-4xx-response.test.ts +231 -0
  148. package/src/rules/common/__tests__/operation-operationId-unique.test.ts +76 -0
  149. package/src/rules/common/__tests__/operation-operationId-url-safe.test.ts +45 -0
  150. package/src/rules/common/__tests__/operation-parameters-unique.test.ts +167 -0
  151. package/src/rules/common/__tests__/operation-singular-tag.test.ts +72 -0
  152. package/src/rules/common/__tests__/path-http-verbs-order.test.ts +95 -0
  153. package/src/rules/common/__tests__/path-not-include-query.test.ts +64 -0
  154. package/src/rules/common/__tests__/path-params-defined.test.ts +202 -0
  155. package/src/rules/common/__tests__/paths-kebab-case.test.ts +108 -0
  156. package/src/rules/common/__tests__/scalar-property-missing-example.test.ts +264 -0
  157. package/src/rules/common/__tests__/security-defined.test.ts +175 -0
  158. package/src/rules/common/__tests__/spec-strict-refs.test.ts +69 -0
  159. package/src/rules/common/__tests__/spec.test.ts +610 -0
  160. package/src/rules/common/__tests__/tag-description.test.ts +65 -0
  161. package/src/rules/common/__tests__/tags-alphabetical.test.ts +64 -0
  162. package/src/rules/common/assertions/__tests__/asserts.test.ts +869 -0
  163. package/src/rules/common/assertions/__tests__/index.test.ts +100 -0
  164. package/src/rules/common/assertions/__tests__/utils.test.ts +236 -0
  165. package/src/rules/common/assertions/asserts.ts +357 -0
  166. package/src/rules/common/assertions/index.ts +53 -0
  167. package/src/rules/common/assertions/utils.ts +331 -0
  168. package/src/rules/common/info-contact.ts +15 -0
  169. package/src/rules/common/info-license-url.ts +10 -0
  170. package/src/rules/common/info-license.ts +15 -0
  171. package/src/rules/common/no-ambiguous-paths.ts +50 -0
  172. package/src/rules/common/no-enum-type-mismatch.ts +52 -0
  173. package/src/rules/common/no-http-verbs-in-paths.ts +36 -0
  174. package/src/rules/common/no-identical-paths.ts +24 -0
  175. package/src/rules/common/no-invalid-parameter-examples.ts +36 -0
  176. package/src/rules/common/no-invalid-schema-examples.ts +27 -0
  177. package/src/rules/common/no-path-trailing-slash.ts +15 -0
  178. package/src/rules/common/operation-2xx-response.ts +24 -0
  179. package/src/rules/common/operation-4xx-response.ts +24 -0
  180. package/src/rules/common/operation-description.ts +13 -0
  181. package/src/rules/common/operation-operationId-unique.ts +21 -0
  182. package/src/rules/common/operation-operationId-url-safe.ts +19 -0
  183. package/src/rules/common/operation-operationId.ts +17 -0
  184. package/src/rules/common/operation-parameters-unique.ts +48 -0
  185. package/src/rules/common/operation-singular-tag.ts +17 -0
  186. package/src/rules/common/operation-summary.ts +13 -0
  187. package/src/rules/common/operation-tag-defined.ts +26 -0
  188. package/src/rules/common/parameter-description.ts +22 -0
  189. package/src/rules/common/path-declaration-must-exist.ts +15 -0
  190. package/src/rules/common/path-excludes-patterns.ts +23 -0
  191. package/src/rules/common/path-http-verbs-order.ts +30 -0
  192. package/src/rules/common/path-not-include-query.ts +17 -0
  193. package/src/rules/common/path-params-defined.ts +65 -0
  194. package/src/rules/common/path-segment-plural.ts +31 -0
  195. package/src/rules/common/paths-kebab-case.ts +19 -0
  196. package/src/rules/common/required-string-property-missing-min-length.ts +44 -0
  197. package/src/rules/common/response-contains-header.ts +35 -0
  198. package/src/rules/common/scalar-property-missing-example.ts +58 -0
  199. package/src/rules/common/security-defined.ts +65 -0
  200. package/src/rules/common/spec-strict-refs.ts +30 -0
  201. package/src/rules/common/spec.ts +175 -0
  202. package/src/rules/common/tag-description.ts +10 -0
  203. package/src/rules/common/tags-alphabetical.ts +20 -0
  204. package/src/rules/no-unresolved-refs.ts +51 -0
  205. package/src/rules/oas2/__tests__/boolean-parameter-prefixes.test.ts +110 -0
  206. package/src/rules/oas2/__tests__/response-contains-header.test.ts +174 -0
  207. package/src/rules/oas2/__tests__/response-contains-property.test.ts +155 -0
  208. package/src/rules/oas2/__tests__/spec/fixtures/description.md +1 -0
  209. package/src/rules/oas2/__tests__/spec/info.test.ts +355 -0
  210. package/src/rules/oas2/__tests__/spec/operation.test.ts +123 -0
  211. package/src/rules/oas2/__tests__/spec/paths.test.ts +245 -0
  212. package/src/rules/oas2/__tests__/spec/referenceableScalars.test.ts +35 -0
  213. package/src/rules/oas2/__tests__/spec/utils.ts +32 -0
  214. package/src/rules/oas2/boolean-parameter-prefixes.ts +26 -0
  215. package/src/rules/oas2/index.ts +91 -0
  216. package/src/rules/oas2/remove-unused-components.ts +81 -0
  217. package/src/rules/oas2/request-mime-type.ts +16 -0
  218. package/src/rules/oas2/response-contains-property.ts +36 -0
  219. package/src/rules/oas2/response-mime-type.ts +16 -0
  220. package/src/rules/oas3/__tests__/boolean-parameter-prefixes.test.ts +111 -0
  221. package/src/rules/oas3/__tests__/component-name-unique.test.ts +823 -0
  222. package/src/rules/oas3/__tests__/fixtures/common.yaml +11 -0
  223. package/src/rules/oas3/__tests__/no-empty-enum-servers.com.test.ts +205 -0
  224. package/src/rules/oas3/__tests__/no-example-value-and-externalValue.test.ts +65 -0
  225. package/src/rules/oas3/__tests__/no-invalid-media-type-examples.test.ts +473 -0
  226. package/src/rules/oas3/__tests__/no-server-example.com.test.ts +60 -0
  227. package/src/rules/oas3/__tests__/no-server-trailing-slash.test.ts +79 -0
  228. package/src/rules/oas3/__tests__/no-unused-components.test.ts +131 -0
  229. package/src/rules/oas3/__tests__/operation-4xx-problem-details-rfc7807.test.ts +145 -0
  230. package/src/rules/oas3/__tests__/response-contains-header.test.ts +389 -0
  231. package/src/rules/oas3/__tests__/response-contains-property.test.ts +403 -0
  232. package/src/rules/oas3/__tests__/spec/callbacks.test.ts +41 -0
  233. package/src/rules/oas3/__tests__/spec/fixtures/description.md +1 -0
  234. package/src/rules/oas3/__tests__/spec/info.test.ts +391 -0
  235. package/src/rules/oas3/__tests__/spec/operation.test.ts +253 -0
  236. package/src/rules/oas3/__tests__/spec/paths.test.ts +284 -0
  237. package/src/rules/oas3/__tests__/spec/referenceableScalars.test.ts +77 -0
  238. package/src/rules/oas3/__tests__/spec/servers.test.ts +505 -0
  239. package/src/rules/oas3/__tests__/spec/spec.test.ts +298 -0
  240. package/src/rules/oas3/__tests__/spec/utils.ts +32 -0
  241. package/src/rules/oas3/__tests__/spec-components-invalid-map-name.test.ts +276 -0
  242. package/src/rules/oas3/__tests__/utils/lint-document-for-test.ts +23 -0
  243. package/src/rules/oas3/boolean-parameter-prefixes.ts +28 -0
  244. package/src/rules/oas3/component-name-unique.ts +158 -0
  245. package/src/rules/oas3/index.ts +113 -0
  246. package/src/rules/oas3/no-empty-servers.ts +22 -0
  247. package/src/rules/oas3/no-example-value-and-externalValue.ts +14 -0
  248. package/src/rules/oas3/no-invalid-media-type-examples.ts +49 -0
  249. package/src/rules/oas3/no-server-example.com.ts +14 -0
  250. package/src/rules/oas3/no-server-trailing-slash.ts +15 -0
  251. package/src/rules/oas3/no-server-variables-empty-enum.ts +66 -0
  252. package/src/rules/oas3/no-undefined-server-variable.ts +30 -0
  253. package/src/rules/oas3/no-unused-components.ts +75 -0
  254. package/src/rules/oas3/operation-4xx-problem-details-rfc7807.ts +35 -0
  255. package/src/rules/oas3/remove-unused-components.ts +95 -0
  256. package/src/rules/oas3/request-mime-type.ts +30 -0
  257. package/src/rules/oas3/response-contains-property.ts +38 -0
  258. package/src/rules/oas3/response-mime-type.ts +30 -0
  259. package/src/rules/oas3/spec-components-invalid-map-name.ts +69 -0
  260. package/src/rules/other/stats.ts +73 -0
  261. package/src/rules/utils.ts +193 -0
  262. package/src/types/config-external-schemas.ts +917 -0
  263. package/src/types/index.ts +149 -0
  264. package/src/types/oas2.ts +478 -0
  265. package/src/types/oas3.ts +597 -0
  266. package/src/types/oas3_1.ts +258 -0
  267. package/src/types/redocly-yaml.ts +1040 -0
  268. package/src/typings/common.ts +17 -0
  269. package/src/typings/openapi.ts +298 -0
  270. package/src/typings/swagger.ts +236 -0
  271. package/src/utils.ts +276 -0
  272. package/src/visitors.ts +491 -0
  273. package/src/walk.ts +439 -0
  274. package/tsconfig.json +8 -0
  275. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,917 @@
1
+ import {
2
+ ApigeeDevOnboardingIntegrationAuthType,
3
+ AuthProviderType,
4
+ DEFAULT_TEAM_CLAIM_NAME,
5
+ } from '../config';
6
+
7
+ const oidcIssuerMetadataSchema = {
8
+ type: 'object',
9
+ properties: {
10
+ end_session_endpoint: { type: 'string' },
11
+ token_endpoint: { type: 'string' },
12
+ authorization_endpoint: { type: 'string' },
13
+ },
14
+ required: ['token_endpoint', 'authorization_endpoint'],
15
+ additionalProperties: true,
16
+ } as const;
17
+
18
+ const oidcProviderConfigSchema = {
19
+ type: 'object',
20
+ properties: {
21
+ type: { type: 'string', const: AuthProviderType.OIDC },
22
+ title: { type: 'string' },
23
+ configurationUrl: { type: 'string', minLength: 1 },
24
+ configuration: oidcIssuerMetadataSchema,
25
+ clientId: { type: 'string', minLength: 1 },
26
+ clientSecret: { type: 'string', minLength: 1 },
27
+ teamsClaimName: { type: 'string' },
28
+ defaultTeams: { type: 'array', items: { type: 'string' } },
29
+ scopes: { type: 'array', items: { type: 'string' } },
30
+ tokenExpirationTime: { type: 'number' },
31
+ authorizationRequestCustomParams: { type: 'object', additionalProperties: { type: 'string' } },
32
+ tokenRequestCustomParams: { type: 'object', additionalProperties: { type: 'string' } },
33
+ },
34
+ required: ['type', 'clientId', 'clientSecret'],
35
+ oneOf: [{ required: ['configurationUrl'] }, { required: ['configuration'] }],
36
+ additionalProperties: false,
37
+ } as const;
38
+
39
+ const saml2ProviderConfigSchema = {
40
+ type: 'object',
41
+ properties: {
42
+ type: { type: 'string', const: AuthProviderType.SAML2 },
43
+ title: { type: 'string' },
44
+ issuerId: { type: 'string' },
45
+ entityId: { type: 'string' },
46
+ ssoUrl: { type: 'string' },
47
+ x509PublicCert: { type: 'string' },
48
+ teamsAttributeName: { type: 'string', default: DEFAULT_TEAM_CLAIM_NAME },
49
+ teamsAttributeMap: { type: 'object', additionalProperties: { type: 'string' } },
50
+ defaultTeams: { type: 'array', items: { type: 'string' } },
51
+ },
52
+ additionalProperties: false,
53
+ required: ['type', 'issuerId', 'ssoUrl', 'x509PublicCert'],
54
+ } as const;
55
+
56
+ const basicAuthProviderConfigSchema = {
57
+ type: 'object',
58
+ properties: {
59
+ type: { type: 'string', const: AuthProviderType.BASIC },
60
+ title: { type: 'string' },
61
+ credentials: {
62
+ type: 'array',
63
+ items: {
64
+ type: 'object',
65
+ properties: {
66
+ username: { type: 'string' },
67
+ password: { type: 'string' },
68
+ passwordHash: { type: 'string' },
69
+ teams: { type: 'array', items: { type: 'string' } },
70
+ },
71
+ required: ['username'],
72
+ additionalProperties: false,
73
+ },
74
+ },
75
+ },
76
+ required: ['type', 'credentials'],
77
+ additionalProperties: false,
78
+ } as const;
79
+
80
+ const authProviderConfigSchema = {
81
+ oneOf: [oidcProviderConfigSchema, saml2ProviderConfigSchema, basicAuthProviderConfigSchema],
82
+ discriminator: { propertyName: 'type' },
83
+ } as const;
84
+
85
+ const rbacScopeItemsSchema = { type: 'object', additionalProperties: { type: 'string' } } as const;
86
+
87
+ export const rbacConfigSchema = {
88
+ type: 'object',
89
+ properties: {
90
+ defaults: rbacScopeItemsSchema,
91
+ },
92
+ additionalProperties: rbacScopeItemsSchema,
93
+ } as const;
94
+
95
+ export const ssoConfigSchema = {
96
+ type: 'object',
97
+ additionalProperties: authProviderConfigSchema,
98
+ } as const;
99
+
100
+ export const redirectConfigSchema = {
101
+ type: 'object',
102
+ properties: {
103
+ to: { type: 'string' },
104
+ type: { type: 'number', default: 301 },
105
+ },
106
+ required: ['to'],
107
+ additionalProperties: false,
108
+ } as const;
109
+
110
+ export const seoConfigSchema = {
111
+ type: 'object',
112
+ properties: {
113
+ title: { type: 'string' },
114
+ description: { type: 'string' },
115
+ siteUrl: { type: 'string' },
116
+ image: { type: 'string' },
117
+ keywords: { type: 'array', items: { type: 'string' } },
118
+ lang: { type: 'string' },
119
+ jsonLd: { type: 'object' },
120
+ meta: {
121
+ type: 'array',
122
+ items: {
123
+ type: 'object',
124
+ properties: {
125
+ name: { type: 'string' },
126
+ content: { type: 'string' },
127
+ },
128
+ required: ['name', 'content'],
129
+ additionalProperties: false,
130
+ },
131
+ },
132
+ },
133
+ additionalProperties: false,
134
+ } as const;
135
+
136
+ const apigeeAdapterAuthOauth2Schema = {
137
+ type: 'object',
138
+ properties: {
139
+ type: { type: 'string', const: ApigeeDevOnboardingIntegrationAuthType.OAUTH2 },
140
+ tokenEndpoint: { type: 'string' },
141
+ clientId: { type: 'string' },
142
+ clientSecret: { type: 'string' },
143
+ },
144
+ additionalProperties: false,
145
+ required: ['type', 'tokenEndpoint', 'clientId', 'clientSecret'],
146
+ } as const;
147
+
148
+ const apigeeAdapterAuthServiceAccountSchema = {
149
+ type: 'object',
150
+ properties: {
151
+ type: { type: 'string', const: ApigeeDevOnboardingIntegrationAuthType.SERVICE_ACCOUNT },
152
+ serviceAccountEmail: { type: 'string' },
153
+ serviceAccountPrivateKey: { type: 'string' },
154
+ },
155
+ additionalProperties: false,
156
+ required: ['type', 'serviceAccountEmail', 'serviceAccountPrivateKey'],
157
+ } as const;
158
+
159
+ const apigeeXAdapterConfigSchema = {
160
+ type: 'object',
161
+ properties: {
162
+ type: { type: 'string', const: 'APIGEE_X' },
163
+ apiUrl: { type: 'string' },
164
+ stage: { type: 'string', default: 'non-production' },
165
+ organizationName: { type: 'string' },
166
+ ignoreApiProducts: { type: 'array', items: { type: 'string' } },
167
+ allowApiProductsOutsideCatalog: { type: 'boolean', default: false },
168
+ auth: {
169
+ type: 'object',
170
+ oneOf: [apigeeAdapterAuthOauth2Schema, apigeeAdapterAuthServiceAccountSchema],
171
+ discriminator: { propertyName: 'type' },
172
+ },
173
+ },
174
+ additionalProperties: false,
175
+ required: ['type', 'organizationName', 'auth'],
176
+ } as const;
177
+
178
+ const apigeeEdgeAdapterConfigSchema = {
179
+ ...apigeeXAdapterConfigSchema,
180
+ properties: {
181
+ ...apigeeXAdapterConfigSchema.properties,
182
+ type: { type: 'string', const: 'APIGEE_EDGE' },
183
+ },
184
+ } as const;
185
+
186
+ const graviteeAdapterConfigSchema = {
187
+ type: 'object',
188
+ properties: {
189
+ type: { type: 'string', const: 'GRAVITEE' },
190
+ apiBaseUrl: { type: 'string' },
191
+ env: { type: 'string' },
192
+ allowApiProductsOutsideCatalog: { type: 'boolean', default: false },
193
+ stage: { type: 'string', default: 'non-production' },
194
+
195
+ auth: { type: 'object', properties: { static: { type: 'string' } } },
196
+ },
197
+ additionalProperties: false,
198
+ required: ['type', 'apiBaseUrl'],
199
+ } as const;
200
+
201
+ const devOnboardingAdapterConfigSchema = {
202
+ type: 'object',
203
+ oneOf: [apigeeXAdapterConfigSchema, apigeeEdgeAdapterConfigSchema, graviteeAdapterConfigSchema],
204
+ discriminator: { propertyName: 'type' },
205
+ } as const;
206
+
207
+ export const devOnboardingConfigSchema = {
208
+ type: 'object',
209
+ required: ['adapters'],
210
+ additionalProperties: false,
211
+ properties: {
212
+ adapters: {
213
+ type: 'array',
214
+ items: devOnboardingAdapterConfigSchema,
215
+ },
216
+ },
217
+ } as const;
218
+
219
+ export const responseHeaderSchema = {
220
+ type: 'object',
221
+ properties: {
222
+ name: { type: 'string' },
223
+ value: { type: 'string' },
224
+ },
225
+ additionalProperties: false,
226
+ required: ['name', 'value'],
227
+ } as const;
228
+
229
+ export const i18nConfigSchema = {
230
+ type: 'object',
231
+ properties: {
232
+ defaultLocale: {
233
+ type: 'string',
234
+ },
235
+ locales: {
236
+ type: 'array',
237
+ items: {
238
+ type: 'object',
239
+ properties: {
240
+ code: {
241
+ type: 'string',
242
+ },
243
+ name: {
244
+ type: 'string',
245
+ },
246
+ },
247
+ required: ['code'],
248
+ },
249
+ },
250
+ },
251
+ required: ['defaultLocale', 'locales'],
252
+ } as const;
253
+
254
+ export const mockServerConfigSchema = {
255
+ type: 'object',
256
+ properties: {
257
+ off: { type: 'boolean', default: false },
258
+ position: { type: 'string', enum: ['first', 'last', 'replace', 'off'], default: 'first' },
259
+ strictExamples: { type: 'boolean', default: false },
260
+ errorIfForcedExampleNotFound: { type: 'boolean', default: false },
261
+ description: { type: 'string' },
262
+ },
263
+ } as const;
264
+
265
+ const logoConfigSchema = {
266
+ type: 'object',
267
+ properties: {
268
+ image: { type: 'string' },
269
+ altText: { type: 'string' },
270
+ link: { type: 'string' },
271
+ favicon: { type: 'string' },
272
+ },
273
+ additionalProperties: false,
274
+ } as const;
275
+
276
+ const hideConfigSchema = {
277
+ type: 'object',
278
+ properties: {
279
+ hide: { type: 'boolean' },
280
+ },
281
+ additionalProperties: false,
282
+ } as const;
283
+
284
+ const scriptConfigSchema = {
285
+ type: 'object',
286
+ properties: {
287
+ src: { type: 'string' },
288
+ async: { type: 'boolean' },
289
+ crossorigin: { type: 'string' },
290
+ defer: { type: 'boolean' },
291
+ fetchpriority: { type: 'string' },
292
+ integrity: { type: 'string' },
293
+ module: { type: 'boolean' },
294
+ nomodule: { type: 'boolean' },
295
+ nonce: { type: 'string' },
296
+ referrerpolicy: { type: 'string' },
297
+ type: { type: 'string' },
298
+ },
299
+ required: ['src'],
300
+ additionalProperties: true,
301
+ } as const;
302
+
303
+ const linksConfigSchema = {
304
+ type: 'object',
305
+ properties: {
306
+ href: { type: 'string' },
307
+ as: { type: 'string' },
308
+ crossorigin: { type: 'string' },
309
+ fetchpriority: { type: 'string' },
310
+ hreflang: { type: 'string' },
311
+ imagesizes: { type: 'string' },
312
+ imagesrcset: { type: 'string' },
313
+ integrity: { type: 'string' },
314
+ media: { type: 'string' },
315
+ prefetch: { type: 'string' },
316
+ referrerpolicy: { type: 'string' },
317
+ rel: { type: 'string' },
318
+ sizes: { type: 'string' },
319
+ title: { type: 'string' },
320
+ type: { type: 'string' },
321
+ },
322
+ required: ['href'],
323
+ additionalProperties: true,
324
+ } as const;
325
+
326
+ const markdownConfigSchema = {
327
+ type: 'object',
328
+ properties: {
329
+ frontMatterKeysToResolve: {
330
+ type: 'array',
331
+ items: { type: 'string' },
332
+ default: ['image', 'links'],
333
+ },
334
+ lastUpdatedBlock: {
335
+ type: 'object',
336
+ properties: {
337
+ format: {
338
+ type: 'string',
339
+ enum: ['timeago', 'iso', 'long', 'short'],
340
+ default: 'timeago',
341
+ },
342
+ locale: { type: 'string', default: 'en-US' },
343
+ ...hideConfigSchema.properties,
344
+ },
345
+ additionalProperties: false,
346
+ default: {},
347
+ },
348
+ toc: {
349
+ type: 'object',
350
+ properties: {
351
+ header: { type: 'string', default: 'On this page' },
352
+ depth: { type: 'integer', default: 3, minimum: 1 },
353
+ ...hideConfigSchema.properties,
354
+ },
355
+ additionalProperties: false,
356
+ default: {},
357
+ },
358
+ editPage: {
359
+ type: 'object',
360
+ properties: {
361
+ baseUrl: { type: 'string' },
362
+ icon: { type: 'string' },
363
+ text: { type: 'string', default: 'Edit this page' },
364
+ ...hideConfigSchema.properties,
365
+ },
366
+ additionalProperties: false,
367
+ default: {},
368
+ },
369
+ },
370
+ additionalProperties: false,
371
+ default: {},
372
+ } as const;
373
+
374
+ const amplitudeAnalyticsConfigSchema = {
375
+ type: 'object',
376
+ properties: {
377
+ includeInDevelopment: { type: 'boolean' },
378
+ apiKey: { type: 'string' },
379
+ head: { type: 'boolean' },
380
+ respectDNT: { type: 'boolean' },
381
+ exclude: { type: 'array', items: { type: 'string' } },
382
+ outboundClickEventName: { type: 'string' },
383
+ pageViewEventName: { type: 'string' },
384
+ amplitudeConfig: { type: 'object', additionalProperties: true },
385
+ },
386
+ additionalProperties: false,
387
+ required: ['apiKey'],
388
+ } as const;
389
+
390
+ const fullstoryAnalyticsConfigSchema = {
391
+ type: 'object',
392
+ properties: {
393
+ includeInDevelopment: { type: 'boolean' },
394
+ orgId: { type: 'string' },
395
+ },
396
+ additionalProperties: false,
397
+ required: ['orgId'],
398
+ } as const;
399
+
400
+ const heapAnalyticsConfigSchema = {
401
+ type: 'object',
402
+ properties: {
403
+ includeInDevelopment: { type: 'boolean' },
404
+ appId: { type: 'string' },
405
+ },
406
+ additionalProperties: false,
407
+ required: ['appId'],
408
+ } as const;
409
+
410
+ const rudderstackAnalyticsConfigSchema = {
411
+ type: 'object',
412
+ properties: {
413
+ includeInDevelopment: { type: 'boolean' },
414
+ writeKey: { type: 'string', minLength: 10 },
415
+ trackPage: { type: 'boolean' },
416
+ dataPlaneUrl: { type: 'string' },
417
+ controlPlaneUrl: { type: 'string' },
418
+ sdkUrl: { type: 'string' },
419
+ loadOptions: { type: 'object', additionalProperties: true },
420
+ },
421
+ additionalProperties: false,
422
+ required: ['writeKey'],
423
+ } as const;
424
+
425
+ const segmentAnalyticsConfigSchema = {
426
+ type: 'object',
427
+ properties: {
428
+ includeInDevelopment: { type: 'boolean' },
429
+ writeKey: { type: 'string', minLength: 10 },
430
+ trackPage: { type: 'boolean' },
431
+ includeTitleInPageCall: { type: 'boolean' },
432
+ host: { type: 'string' },
433
+ },
434
+ additionalProperties: false,
435
+ required: ['writeKey'],
436
+ } as const;
437
+
438
+ const gtmAnalyticsConfigSchema = {
439
+ type: 'object',
440
+ properties: {
441
+ includeInDevelopment: { type: 'boolean' },
442
+ trackingId: { type: 'string' },
443
+ gtmAuth: { type: 'string' },
444
+ gtmPreview: { type: 'string' },
445
+ defaultDataLayer: {},
446
+ dataLayerName: { type: 'string' },
447
+ enableWebVitalsTracking: { type: 'boolean' },
448
+ selfHostedOrigin: { type: 'string' },
449
+ pageViewEventName: { type: 'string' },
450
+ },
451
+ additionalProperties: false,
452
+ required: ['trackingId'],
453
+ } as const;
454
+
455
+ const googleAnalyticsConfigSchema = {
456
+ type: 'object',
457
+ properties: {
458
+ includeInDevelopment: { type: 'boolean' },
459
+ trackingId: { type: 'string' },
460
+ head: { type: 'boolean' },
461
+ respectDNT: { type: 'boolean' },
462
+ anonymize: { type: 'boolean' },
463
+ exclude: { type: 'array', items: { type: 'string' } },
464
+ optimizeId: { type: 'string' },
465
+ experimentId: { type: 'string' },
466
+ variationId: { type: 'string' },
467
+ enableWebVitalsTracking: { type: 'boolean' },
468
+
469
+ defer: { type: 'boolean' },
470
+ sampleRate: { type: 'number' },
471
+ name: { type: 'string' },
472
+ clientId: { type: 'string' },
473
+ siteSpeedSampleRate: { type: 'number' },
474
+ alwaysSendReferrer: { type: 'boolean' },
475
+ allowAnchor: { type: 'boolean' },
476
+ cookieName: { type: 'string' },
477
+ cookieFlags: { type: 'string' },
478
+ cookieDomain: { type: 'string' },
479
+ cookieExpires: { type: 'number' },
480
+ storeGac: { type: 'boolean' },
481
+ legacyCookieDomain: { type: 'string' },
482
+ legacyHistoryImport: { type: 'boolean' },
483
+ allowLinker: { type: 'boolean' },
484
+ storage: { type: 'string' },
485
+
486
+ allowAdFeatures: { type: 'boolean' },
487
+ dataSource: { type: 'string' },
488
+ queueTime: { type: 'number' },
489
+ forceSSL: { type: 'boolean' },
490
+ transport: { type: 'string' },
491
+ },
492
+ additionalProperties: false,
493
+ required: ['trackingId'],
494
+ } as const;
495
+
496
+ const adobeAnalyticsConfigSchema = {
497
+ type: 'object',
498
+ properties: {
499
+ includeInDevelopment: { type: 'boolean' },
500
+ scriptUrl: { type: 'string' },
501
+ pageViewEventName: { type: 'string' },
502
+ },
503
+ additionalProperties: false,
504
+ required: ['scriptUrl'],
505
+ } as const;
506
+
507
+ const navItemSchema = {
508
+ type: 'object',
509
+ properties: {
510
+ page: { type: 'string' },
511
+ directory: { type: 'string' },
512
+ group: { type: 'string' },
513
+ label: { type: 'string' },
514
+ separator: { type: 'string' },
515
+ separatorLine: { type: 'boolean' },
516
+ version: { type: 'string' },
517
+ menuStyle: { type: 'string', enum: ['drilldown'] },
518
+ expanded: { type: 'string', const: 'always' },
519
+ selectFirstItemOnExpand: { type: 'boolean' },
520
+ flatten: { type: 'boolean' },
521
+ linkedSidebars: {
522
+ type: 'array',
523
+ items: { type: 'string' },
524
+ },
525
+ },
526
+ } as const;
527
+
528
+ const navItemsSchema = {
529
+ type: 'array',
530
+ items: {
531
+ ...navItemSchema,
532
+ properties: {
533
+ ...navItemSchema.properties,
534
+ items: { type: 'array', items: navItemSchema },
535
+ },
536
+ },
537
+ } as const;
538
+
539
+ const productConfigSchema = {
540
+ type: 'object',
541
+ properties: {
542
+ name: { type: 'string' },
543
+ icon: { type: 'string' },
544
+ folder: { type: 'string' },
545
+ },
546
+ additionalProperties: false,
547
+ required: ['name', 'icon', 'folder'],
548
+ } as const;
549
+
550
+ const suggestedPageSchema = {
551
+ type: 'object',
552
+ properties: {
553
+ page: { type: 'string' },
554
+ label: { type: 'string' },
555
+ labelTranslationKey: { type: 'string' },
556
+ },
557
+ required: ['page'],
558
+ } as const;
559
+
560
+ const catalogFilterSchema = {
561
+ type: 'object',
562
+ additionalProperties: false,
563
+ required: ['title', 'property'],
564
+ properties: {
565
+ type: { type: 'string', enum: ['select', 'checkboxes', 'date-range'] },
566
+ title: { type: 'string' },
567
+ titleTranslationKey: { type: 'string' },
568
+ property: { type: 'string' },
569
+ parentFilter: { type: 'string' },
570
+ missingCategoryName: { type: 'string' },
571
+ missingCategoryNameTranslationKey: { type: 'string' },
572
+ options: { type: 'array', items: { type: 'string' } },
573
+ },
574
+ } as const;
575
+
576
+ const scorecardConfigSchema = {
577
+ type: 'object',
578
+ additionalProperties: true,
579
+ required: ['levels'],
580
+ properties: {
581
+ failBuildIfBelowMinimum: { type: 'boolean', default: false },
582
+ levels: {
583
+ type: 'array',
584
+ items: {
585
+ type: 'object',
586
+ required: ['name'],
587
+ properties: {
588
+ name: { type: 'string' },
589
+ extends: { type: 'array', items: { type: 'string' } },
590
+ rules: {
591
+ type: 'object',
592
+ additionalProperties: {
593
+ type: ['object', 'string'],
594
+ },
595
+ },
596
+ },
597
+ additionalProperties: false,
598
+ },
599
+ },
600
+ targets: {
601
+ type: 'array',
602
+ items: {
603
+ type: 'object',
604
+ required: ['where'],
605
+ properties: {
606
+ minimumLevel: { type: 'string' },
607
+ where: {
608
+ type: 'object',
609
+ required: ['metadata'],
610
+ properties: {
611
+ metadata: { type: 'object', additionalProperties: { type: 'string' } },
612
+ },
613
+ additionalProperties: false,
614
+ },
615
+ },
616
+ additionalProperties: false,
617
+ },
618
+ },
619
+ },
620
+ } as const;
621
+
622
+ const catalogSchema = {
623
+ type: 'object',
624
+ additionalProperties: true,
625
+ required: ['slug', 'filters', 'groupByFirstFilter', 'items'],
626
+ properties: {
627
+ slug: { type: 'string' },
628
+ filters: { type: 'array', items: catalogFilterSchema },
629
+ groupByFirstFilter: { type: 'boolean' },
630
+ items: navItemsSchema,
631
+ requiredPermission: { type: 'string' },
632
+ separateVersions: { type: 'boolean' },
633
+ title: { type: 'string' },
634
+ titleTranslationKey: { type: 'string' },
635
+ description: { type: 'string' },
636
+ descriptionTranslationKey: { type: 'string' },
637
+ },
638
+ } as const;
639
+
640
+ const catalogsConfigSchema = {
641
+ type: 'object',
642
+ patternProperties: {
643
+ '.*': catalogSchema,
644
+ },
645
+ } as const;
646
+
647
+ export const themeConfigSchema = {
648
+ type: 'object',
649
+ properties: {
650
+ imports: {
651
+ type: 'array',
652
+ items: { type: 'string' },
653
+ default: [],
654
+ },
655
+ logo: logoConfigSchema,
656
+ navbar: {
657
+ type: 'object',
658
+ properties: {
659
+ items: navItemsSchema,
660
+ ...hideConfigSchema.properties,
661
+ },
662
+ additionalProperties: false,
663
+ },
664
+ products: {
665
+ type: 'object',
666
+ additionalProperties: productConfigSchema,
667
+ },
668
+ footer: {
669
+ type: 'object',
670
+ properties: {
671
+ items: navItemsSchema,
672
+ copyrightText: { type: 'string' },
673
+ ...hideConfigSchema.properties,
674
+ },
675
+ additionalProperties: false,
676
+ },
677
+ sidebar: hideConfigSchema,
678
+ scripts: {
679
+ type: 'object',
680
+ properties: {
681
+ head: { type: 'array', items: scriptConfigSchema },
682
+ body: { type: 'array', items: scriptConfigSchema },
683
+ },
684
+ additionalProperties: false,
685
+ },
686
+ links: { type: 'array', items: linksConfigSchema },
687
+ feedback: {
688
+ type: 'object',
689
+ properties: {
690
+ hide: {
691
+ type: 'boolean',
692
+ default: false,
693
+ },
694
+ type: {
695
+ type: 'string',
696
+ enum: ['rating', 'sentiment', 'comment', 'reasons'],
697
+ default: 'sentiment',
698
+ },
699
+ settings: {
700
+ type: 'object',
701
+ properties: {
702
+ label: { type: 'string' },
703
+ submitText: { type: 'string' },
704
+ max: { type: 'number' },
705
+ buttonText: { type: 'string' },
706
+ multi: { type: 'boolean' },
707
+ items: { type: 'array', items: { type: 'string' }, minItems: 1 },
708
+ reasons: {
709
+ type: 'object',
710
+ properties: {
711
+ enable: { type: 'boolean', default: true },
712
+ multi: { type: 'boolean' },
713
+ label: { type: 'string' },
714
+ items: { type: 'array', items: { type: 'string' } },
715
+ },
716
+ additionalProperties: false,
717
+ },
718
+ comment: {
719
+ type: 'object',
720
+ properties: {
721
+ enable: { type: 'boolean', default: true },
722
+ label: { type: 'string' },
723
+ likeLabel: { type: 'string' },
724
+ dislikeLabel: { type: 'string' },
725
+ },
726
+ additionalProperties: false,
727
+ },
728
+ },
729
+ additionalProperties: false,
730
+ ...hideConfigSchema.properties,
731
+ },
732
+ },
733
+ additionalProperties: false,
734
+ default: {},
735
+ },
736
+ search: {
737
+ type: 'object',
738
+ properties: {
739
+ placement: {
740
+ type: 'string',
741
+ default: 'navbar',
742
+ },
743
+ shortcuts: {
744
+ type: 'array',
745
+ items: { type: 'string' },
746
+ default: ['/'],
747
+ },
748
+ suggestedPages: {
749
+ type: 'array',
750
+ items: suggestedPageSchema,
751
+ },
752
+ ...hideConfigSchema.properties,
753
+ },
754
+ additionalProperties: false,
755
+ default: {},
756
+ },
757
+ colorMode: {
758
+ type: 'object',
759
+ properties: {
760
+ ignoreDetection: { type: 'boolean' },
761
+ modes: {
762
+ type: 'array',
763
+ items: { type: 'string' },
764
+ default: ['light', 'dark'],
765
+ },
766
+ ...hideConfigSchema.properties,
767
+ },
768
+ additionalProperties: false,
769
+ default: {},
770
+ },
771
+ navigation: {
772
+ type: 'object',
773
+ properties: {
774
+ nextButton: {
775
+ type: 'object',
776
+ properties: {
777
+ text: { type: 'string', default: 'Next to {label}' },
778
+ ...hideConfigSchema.properties,
779
+ },
780
+ additionalProperties: false,
781
+ default: {},
782
+ },
783
+ previousButton: {
784
+ type: 'object',
785
+ properties: {
786
+ text: { type: 'string', default: 'Back to {label}' },
787
+ ...hideConfigSchema.properties,
788
+ },
789
+ additionalProperties: false,
790
+ default: {},
791
+ },
792
+ },
793
+ additionalProperties: false,
794
+ default: {},
795
+ },
796
+ codeSnippet: {
797
+ type: 'object',
798
+ properties: {
799
+ controlsStyle: { type: 'string', default: 'icon' },
800
+ copy: {
801
+ type: 'object',
802
+ properties: {
803
+ ...hideConfigSchema.properties,
804
+ },
805
+ additionalProperties: false,
806
+ default: { hide: false },
807
+ },
808
+ report: {
809
+ type: 'object',
810
+ properties: {
811
+ ...hideConfigSchema.properties,
812
+ },
813
+ additionalProperties: false,
814
+ default: { hide: true },
815
+ },
816
+ expand: {
817
+ type: 'object',
818
+ properties: {
819
+ ...hideConfigSchema.properties,
820
+ },
821
+ additionalProperties: false,
822
+ default: { hide: false },
823
+ },
824
+ collapse: {
825
+ type: 'object',
826
+ properties: {
827
+ ...hideConfigSchema.properties,
828
+ },
829
+ additionalProperties: false,
830
+ default: { hide: false },
831
+ },
832
+ },
833
+ additionalProperties: false,
834
+ default: {},
835
+ },
836
+ markdown: markdownConfigSchema,
837
+ openapi: { type: 'object', additionalProperties: true },
838
+ graphql: { type: 'object', additionalProperties: true },
839
+ analytics: {
840
+ type: 'object',
841
+ properties: {
842
+ adobe: adobeAnalyticsConfigSchema,
843
+ amplitude: amplitudeAnalyticsConfigSchema,
844
+ fullstory: fullstoryAnalyticsConfigSchema,
845
+ heap: heapAnalyticsConfigSchema,
846
+ rudderstack: rudderstackAnalyticsConfigSchema,
847
+ segment: segmentAnalyticsConfigSchema,
848
+ gtm: gtmAnalyticsConfigSchema,
849
+ ga: googleAnalyticsConfigSchema,
850
+ },
851
+ },
852
+ userProfile: {
853
+ type: 'object',
854
+ properties: {
855
+ loginLabel: { type: 'string', default: 'Login' },
856
+ logoutLabel: { type: 'string', default: 'Logout' },
857
+ menu: {
858
+ type: 'array',
859
+ items: {
860
+ type: 'object',
861
+ properties: {
862
+ label: { type: 'string' },
863
+ external: { type: 'boolean' },
864
+ link: { type: 'string' },
865
+ separatorLine: { type: 'boolean' },
866
+ },
867
+ additionalProperties: true,
868
+ },
869
+ default: [],
870
+ },
871
+ ...hideConfigSchema.properties,
872
+ },
873
+ additionalProperties: false,
874
+ default: {},
875
+ },
876
+ breadcrumbs: {
877
+ type: 'object',
878
+ properties: {
879
+ hide: { type: 'boolean' },
880
+ prefixItems: {
881
+ type: 'array',
882
+ items: {
883
+ type: 'object',
884
+ properties: {
885
+ label: { type: 'string' },
886
+ labelTranslationKey: { type: 'string' },
887
+ page: { type: 'string' },
888
+ },
889
+ additionalProperties: false,
890
+ default: {},
891
+ },
892
+ },
893
+ },
894
+ additionalProperties: false,
895
+ default: {},
896
+ },
897
+ catalog: catalogsConfigSchema,
898
+ scorecard: scorecardConfigSchema,
899
+ },
900
+ additionalProperties: true,
901
+ default: {},
902
+ } as const;
903
+
904
+ export const productThemeOverrideSchema = {
905
+ type: 'object',
906
+ properties: {
907
+ logo: themeConfigSchema.properties.logo,
908
+ navbar: themeConfigSchema.properties.navbar,
909
+ footer: themeConfigSchema.properties.footer,
910
+ sidebar: themeConfigSchema.properties.sidebar,
911
+ search: themeConfigSchema.properties.search,
912
+ codeSnippet: themeConfigSchema.properties.codeSnippet,
913
+ breadcrumbs: themeConfigSchema.properties.breadcrumbs,
914
+ },
915
+ additionalProperties: true,
916
+ default: {},
917
+ } as const;