@redocly/api-docs 0.2.0-next.0 → 0.2.0-next.10

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 (302) hide show
  1. package/lib/RedocStandalone.d.ts +38 -0
  2. package/lib/RedocStandalone.js +1 -0
  3. package/lib/RedoclyApiDocs.js +1 -1
  4. package/lib/RedoclyApiDocsStandalone.d.ts +2 -0
  5. package/lib/RedoclyApiDocsStandalone.js +3 -3
  6. package/lib/adapters/asyncapi/build/navigation.js +1 -1
  7. package/lib/adapters/asyncapi/items/channel/content.js +1 -1
  8. package/lib/adapters/asyncapi/items/channel/item.js +1 -1
  9. package/lib/adapters/asyncapi/items/operation/item.js +1 -1
  10. package/lib/adapters/asyncapi/items/overview/content.js +1 -1
  11. package/lib/adapters/graphql/group/utils.js +1 -1
  12. package/lib/adapters/graphql/utils/createApiItem.js +1 -1
  13. package/lib/adapters/helpers.d.ts +3 -10
  14. package/lib/adapters/helpers.js +1 -1
  15. package/lib/adapters/openapi/build/context.js +1 -1
  16. package/lib/adapters/openapi/build-code-sample-source.d.ts +1 -1
  17. package/lib/adapters/openapi/build-code-sample-source.js +1 -1
  18. package/lib/adapters/openapi/configure/merge-utils.d.ts +1 -1
  19. package/lib/adapters/openapi/configure/resolve-request-values.js +1 -1
  20. package/lib/adapters/openapi/group/item.d.ts +0 -3
  21. package/lib/adapters/openapi/group/item.js +1 -1
  22. package/lib/adapters/openapi/index.js +1 -1
  23. package/lib/adapters/openapi/items/operation/content.js +1 -1
  24. package/lib/adapters/openapi/items/operation/item.d.ts +2 -2
  25. package/lib/adapters/openapi/items/operation/item.js +1 -1
  26. package/lib/adapters/openapi/items/overview/content.js +1 -1
  27. package/lib/adapters/openapi/items/schema/item.js +1 -1
  28. package/lib/adapters/openapi/store.js +1 -1
  29. package/lib/adapters/openapi/utils/merge-mock-server.d.ts +2 -2
  30. package/lib/adapters/rbac.d.ts +14 -0
  31. package/lib/adapters/rbac.js +1 -0
  32. package/lib/adapters/utils/descriptionToMarkdown.d.ts +6 -0
  33. package/lib/adapters/utils/descriptionToMarkdown.js +11 -0
  34. package/lib/adapters/utils/markdoc.d.ts +8 -1
  35. package/lib/adapters/utils/markdoc.js +1 -1
  36. package/lib/components/ErrorBoundary.d.ts +4 -2
  37. package/lib/components/ErrorBoundary.js +55 -1
  38. package/lib/components/Header/HeaderItem.js +5 -5
  39. package/lib/components/Header/HeaderPageActions.d.ts +4 -0
  40. package/lib/components/Header/HeaderPageActions.js +1 -0
  41. package/lib/components/Header/PageActions.d.ts +4 -0
  42. package/lib/components/Header/PageActions.js +11 -0
  43. package/lib/components/ItemContent/hooks.d.ts +12 -1
  44. package/lib/components/ItemContent/hooks.js +1 -1
  45. package/lib/components/ItemContent/sections/BodySection.js +3 -3
  46. package/lib/components/ItemContent/sections/CallbacksSection.js +4 -4
  47. package/lib/components/ItemContent/sections/MessagesSection.js +17 -17
  48. package/lib/components/ItemContent/sections/ResponsesSection.js +7 -7
  49. package/lib/components/Mcp/McpPrompt.js +1 -1
  50. package/lib/components/Mcp/McpTool.js +1 -1
  51. package/lib/components/Mcp/utils.d.ts +1 -1
  52. package/lib/components/Mcp/utils.js +1 -1
  53. package/lib/components/Schema/SchemaDescription.js +1 -1
  54. package/lib/components/Schema/styled.js +5 -5
  55. package/lib/components/Schema/views/ArrayRenderer.js +1 -1
  56. package/lib/components/Schema/views/CollapsibleNestedFields.js +1 -1
  57. package/lib/components/Schema/views/DiscriminatorPropertyRow.js +1 -1
  58. package/lib/components/Schema/views/Examples.js +1 -1
  59. package/lib/components/Schema/views/SwitcherRenderer.js +1 -1
  60. package/lib/components/Search/index.d.ts +15 -0
  61. package/lib/components/Search/index.js +1 -0
  62. package/lib/components/Security/SecurityFlowDetail.js +1 -1
  63. package/lib/components/Security/styled.js +7 -7
  64. package/lib/components/StickySidebar/FloatingButton.d.ts +1 -0
  65. package/lib/components/StickySidebar/FloatingButton.js +32 -0
  66. package/lib/components/StickySidebar/RedoclyAttributionLogo.d.ts +5 -0
  67. package/lib/components/StickySidebar/RedoclyAttributionLogo.js +1 -0
  68. package/lib/components/StickySidebar/StickySidebar.js +33 -9
  69. package/lib/components/common/Breadcrumbs.js +2 -2
  70. package/lib/components/common/DeepLinkAnchor.js +9 -9
  71. package/lib/components/common/PanelItem.js +5 -5
  72. package/lib/components/common/ResponseCodeTabs.js +1 -1
  73. package/lib/components/common/Tag.js +1 -1
  74. package/lib/components/common/VendorExtensions.js +1 -1
  75. package/lib/components/common/ViewNested.js +2 -2
  76. package/lib/components/graphql/GraphQLFieldView.js +1 -1
  77. package/lib/components/graphql/RequiresScopesModal.js +3 -3
  78. package/lib/components/graphql/sections/GraphQLArgsSection.js +1 -1
  79. package/lib/components/markdoc/SchemaDefinition.js +1 -1
  80. package/lib/components/markdoc/html/html-jsx-attribute-mapping.d.ts +5 -0
  81. package/lib/components/markdoc/html/html-jsx-attribute-mapping.js +1 -0
  82. package/lib/components/markdoc/html/process-html-tokens.d.ts +1 -0
  83. package/lib/components/markdoc/html/process-html-tokens.js +1 -0
  84. package/lib/components/markdoc/markdocParser.d.ts +2 -0
  85. package/lib/components/markdoc/markdocParser.js +1 -1
  86. package/lib/components/panels/ExampleItem/CallbackPayloadItem.js +2 -2
  87. package/lib/components/panels/ExampleItem/CodeSampleItem.js +1 -1
  88. package/lib/components/panels/ExampleItem/PayloadExampleItem.js +2 -2
  89. package/lib/components/panels/ExampleItem/ResponseExampleItem.js +1 -1
  90. package/lib/components/panels/ExampleItem/SecuritySchemeSelector.d.ts +9 -0
  91. package/lib/components/panels/ExampleItem/SecuritySchemeSelector.js +1 -0
  92. package/lib/components/panels/ExampleItem/ServerDropdown.js +2 -2
  93. package/lib/components/panels/ExampleItem/generate-request-sample.d.ts +28 -0
  94. package/lib/components/panels/ExampleItem/generate-request-sample.js +1 -0
  95. package/lib/components/panels/ExampleItem/selectors.d.ts +5 -2
  96. package/lib/components/panels/ExampleItem/selectors.js +1 -1
  97. package/lib/components/panels/ExampleItem/styled.d.ts +2 -49
  98. package/lib/components/panels/ExampleItem/styled.js +11 -5
  99. package/lib/components/panels/ExampleItem/useActiveServer.d.ts +17 -0
  100. package/lib/components/panels/ExampleItem/useActiveServer.js +1 -0
  101. package/lib/components/panels/ExampleItem/useCodeSampleLanguages.d.ts +23 -0
  102. package/lib/components/panels/ExampleItem/useCodeSampleLanguages.js +1 -0
  103. package/lib/components/panels/ExampleItem/useReplayRequestState.d.ts +18 -0
  104. package/lib/components/panels/ExampleItem/useReplayRequestState.js +1 -0
  105. package/lib/components/panels/ExampleItem/useTryItFooter.d.ts +3 -0
  106. package/lib/components/panels/ExampleItem/useTryItFooter.js +7 -0
  107. package/lib/components/panels/GroupPanelItem.js +1 -1
  108. package/lib/components/panels/LanguageItem/LanguagePanelItem.js +5 -1
  109. package/lib/components/panels/LanguageItem/styled.js +17 -14
  110. package/lib/components/panels/McpExamplePanelItem.js +2 -2
  111. package/lib/components/panels/McpPanelItem.js +2 -2
  112. package/lib/components/panels/ServerItem/ServerItem.js +1 -1
  113. package/lib/components/panels/asyncapi/BrokerItem/BrokerModal.js +1 -1
  114. package/lib/components/panels/asyncapi/BrokerItem/BrokerPanelItem.js +1 -1
  115. package/lib/components/panels/asyncapi/MessageBindingItem/MessageBindingItem.js +1 -1
  116. package/lib/components/panels/shared-panel-styles.js +1 -1
  117. package/lib/components/panels/styled.js +1 -1
  118. package/lib/components/pluggable/RedocExample.js +5 -2
  119. package/lib/components/pluggable/RedocResponseSamples.js +1 -1
  120. package/lib/hoc/withLicenseGate.d.ts +5 -0
  121. package/lib/hoc/withLicenseGate.js +1 -0
  122. package/lib/hoc/withRouter.js +1 -1
  123. package/lib/hoc/withStoreProvider.d.ts +2 -0
  124. package/lib/hoc/withStoreProvider.js +1 -1
  125. package/lib/hooks/deepLinkHash.d.ts +5 -0
  126. package/lib/hooks/deepLinkHash.js +1 -0
  127. package/lib/hooks/useApiDocsScroll.js +1 -1
  128. package/lib/hooks/useCopySpecSlice.d.ts +9 -0
  129. package/lib/hooks/useCopySpecSlice.js +1 -0
  130. package/lib/hooks/useDeepLinkSection.js +1 -1
  131. package/lib/hooks/useInitialTelemetry.d.ts +2 -0
  132. package/lib/hooks/useInitialTelemetry.js +1 -0
  133. package/lib/hooks/useLicense.js +1 -1
  134. package/lib/hooks/useLicenseGate.d.ts +6 -0
  135. package/lib/hooks/useLicenseGate.js +1 -0
  136. package/lib/hooks/useRouterHashBridge.d.ts +4 -0
  137. package/lib/hooks/useRouterHashBridge.js +1 -1
  138. package/lib/hooks/useScrollSpyUrlSync.js +1 -1
  139. package/lib/hooks/useUrlHash.d.ts +3 -2
  140. package/lib/hooks/useUrlHash.js +1 -1
  141. package/lib/hooks/useUrlHashReassert.d.ts +2 -0
  142. package/lib/hooks/useUrlHashReassert.js +1 -0
  143. package/lib/index.d.ts +5 -1
  144. package/lib/index.js +1 -1
  145. package/lib/jotai/app.d.ts +6 -0
  146. package/lib/jotai/app.js +1 -1
  147. package/lib/jotai/examples.js +1 -1
  148. package/lib/jotai/itemStore.d.ts +1 -0
  149. package/lib/jotai/itemStore.js +1 -1
  150. package/lib/jotai/store.d.ts +4 -0
  151. package/lib/jotai/store.js +1 -1
  152. package/lib/options/editionOverrides.d.ts +3 -0
  153. package/lib/options/editionOverrides.js +1 -0
  154. package/lib/options/helpers.d.ts +1 -2
  155. package/lib/options/helpers.js +1 -1
  156. package/lib/options/normalizeOptions.d.ts +1 -1
  157. package/lib/options/normalizeOptions.js +1 -1
  158. package/lib/options/standaloneLayoutVars.d.ts +3 -0
  159. package/lib/options/standaloneLayoutVars.js +1 -0
  160. package/lib/otel-semantic-conventions.d.ts +10 -0
  161. package/lib/otel-semantic-conventions.js +1 -0
  162. package/lib/pages/ItemPage.js +4 -2
  163. package/lib/pages/NotFoundPage.js +40 -1
  164. package/lib/services/code-samples/apply-env-variables.d.ts +8 -0
  165. package/lib/services/code-samples/apply-env-variables.js +1 -0
  166. package/lib/services/code-samples/builder.d.ts +8 -5
  167. package/lib/services/code-samples/builder.js +1 -1
  168. package/lib/services/code-samples/discriminator.d.ts +16 -10
  169. package/lib/services/code-samples/discriminator.js +1 -1
  170. package/lib/services/code-samples/generators/java8.js +2 -2
  171. package/lib/services/code-samples/language-availability.d.ts +4 -0
  172. package/lib/services/code-samples/language-availability.js +1 -0
  173. package/lib/services/code-samples/{replay/normalize-servers.d.ts → normalize-servers.d.ts} +1 -1
  174. package/lib/services/code-samples/normalize-servers.js +1 -0
  175. package/lib/services/code-samples/replay/embedded-replay-converter.d.ts +1 -1
  176. package/lib/services/code-samples/replay/embedded-replay-converter.js +1 -1
  177. package/lib/services/code-samples/replay/find-operation.d.ts +17 -0
  178. package/lib/services/code-samples/replay/find-operation.js +1 -0
  179. package/lib/services/code-samples/replay/from-openapi-document.d.ts +12 -2
  180. package/lib/services/code-samples/replay/from-openapi-document.js +1 -1
  181. package/lib/services/code-samples/replay/index.d.ts +1 -1
  182. package/lib/services/code-samples/replay/index.js +1 -1
  183. package/lib/services/code-samples/replay/overlay-converter.js +1 -1
  184. package/lib/services/code-samples/replay/parameter-descriptions.d.ts +7 -0
  185. package/lib/services/code-samples/replay/parameter-descriptions.js +1 -0
  186. package/lib/services/code-samples/replay/replay-adapter.d.ts +1 -1
  187. package/lib/services/code-samples/replay/replay-adapter.js +1 -1
  188. package/lib/services/code-samples/replay/replay-handler.js +1 -1
  189. package/lib/services/code-samples/replay/replay-predefined-env.d.ts +1 -2
  190. package/lib/services/code-samples/replay/replay-predefined-env.js +1 -1
  191. package/lib/services/code-samples/replay/schema-declared-value.d.ts +2 -0
  192. package/lib/services/code-samples/replay/schema-declared-value.js +1 -0
  193. package/lib/services/code-samples/resolvers.js +1 -1
  194. package/lib/services/code-samples/server-env.d.ts +3 -0
  195. package/lib/services/code-samples/server-env.js +1 -0
  196. package/lib/services/code-samples/source.d.ts +3 -3
  197. package/lib/services/license/check.d.ts +1 -0
  198. package/lib/services/license/check.js +1 -1
  199. package/lib/services/operation-samples/index.js +1 -1
  200. package/lib/services/schema/dialects/jsonSchema.d.ts +5 -1
  201. package/lib/services/schema/dialects/jsonSchema.js +1 -1
  202. package/lib/services/schema/propertyTreeBuilder.js +1 -1
  203. package/lib/services/search/index.d.ts +2 -0
  204. package/lib/services/search/index.js +1 -0
  205. package/lib/services/search/indexer/context.d.ts +8 -0
  206. package/lib/services/search/indexer/context.js +0 -0
  207. package/lib/services/search/indexer/deep-links.d.ts +12 -0
  208. package/lib/services/search/indexer/deep-links.js +1 -0
  209. package/lib/services/search/indexer/extractors/asyncapi.d.ts +8 -0
  210. package/lib/services/search/indexer/extractors/asyncapi.js +1 -0
  211. package/lib/services/search/indexer/extractors/body.d.ts +2 -0
  212. package/lib/services/search/indexer/extractors/body.js +1 -0
  213. package/lib/services/search/indexer/extractors/callbacks.d.ts +4 -0
  214. package/lib/services/search/indexer/extractors/callbacks.js +1 -0
  215. package/lib/services/search/indexer/extractors/context.d.ts +25 -0
  216. package/lib/services/search/indexer/extractors/context.js +1 -0
  217. package/lib/services/search/indexer/extractors/examples.d.ts +3 -0
  218. package/lib/services/search/indexer/extractors/examples.js +1 -0
  219. package/lib/services/search/indexer/extractors/graphql.d.ts +2 -0
  220. package/lib/services/search/indexer/extractors/graphql.js +1 -0
  221. package/lib/services/search/indexer/extractors/heading-sections.d.ts +3 -0
  222. package/lib/services/search/indexer/extractors/heading-sections.js +1 -0
  223. package/lib/services/search/indexer/extractors/index.d.ts +12 -0
  224. package/lib/services/search/indexer/extractors/index.js +1 -0
  225. package/lib/services/search/indexer/extractors/mcp.d.ts +9 -0
  226. package/lib/services/search/indexer/extractors/mcp.js +1 -0
  227. package/lib/services/search/indexer/extractors/named-rows.d.ts +9 -0
  228. package/lib/services/search/indexer/extractors/named-rows.js +1 -0
  229. package/lib/services/search/indexer/extractors/panels.d.ts +10 -0
  230. package/lib/services/search/indexer/extractors/panels.js +1 -0
  231. package/lib/services/search/indexer/extractors/parameters.d.ts +2 -0
  232. package/lib/services/search/indexer/extractors/parameters.js +1 -0
  233. package/lib/services/search/indexer/extractors/responses.d.ts +2 -0
  234. package/lib/services/search/indexer/extractors/responses.js +1 -0
  235. package/lib/services/search/indexer/extractors/schema-page.d.ts +9 -0
  236. package/lib/services/search/indexer/extractors/schema-page.js +1 -0
  237. package/lib/services/search/indexer/extractors/security.d.ts +4 -0
  238. package/lib/services/search/indexer/extractors/security.js +1 -0
  239. package/lib/services/search/indexer/index.d.ts +14 -0
  240. package/lib/services/search/indexer/index.js +1 -0
  241. package/lib/services/search/indexer/param.d.ts +7 -0
  242. package/lib/services/search/indexer/param.js +1 -0
  243. package/lib/services/search/indexer/places.d.ts +40 -0
  244. package/lib/services/search/indexer/places.js +1 -0
  245. package/lib/services/search/indexer/schema-walker.d.ts +29 -0
  246. package/lib/services/search/indexer/schema-walker.js +1 -0
  247. package/lib/services/search/indexer/text.d.ts +2 -0
  248. package/lib/services/search/indexer/text.js +1 -0
  249. package/lib/services/search/types.d.ts +28 -0
  250. package/lib/services/search/types.js +0 -0
  251. package/lib/services/spec-slice/assistant-links.d.ts +9 -0
  252. package/lib/services/spec-slice/assistant-links.js +5 -0
  253. package/lib/services/spec-slice/asyncapi-slice.d.ts +5 -0
  254. package/lib/services/spec-slice/asyncapi-slice.js +1 -0
  255. package/lib/services/spec-slice/clone-strip.d.ts +1 -0
  256. package/lib/services/spec-slice/clone-strip.js +1 -0
  257. package/lib/services/spec-slice/component-closure.d.ts +6 -0
  258. package/lib/services/spec-slice/component-closure.js +1 -0
  259. package/lib/services/spec-slice/graphql-slice.d.ts +2 -0
  260. package/lib/services/spec-slice/graphql-slice.js +1 -0
  261. package/lib/services/spec-slice/index.d.ts +6 -0
  262. package/lib/services/spec-slice/index.js +1 -0
  263. package/lib/services/spec-slice/openapi-slice.d.ts +6 -0
  264. package/lib/services/spec-slice/openapi-slice.js +1 -0
  265. package/lib/services/spec-slice/resolve-scope.d.ts +4 -0
  266. package/lib/services/spec-slice/resolve-scope.js +1 -0
  267. package/lib/services/spec-slice/types.d.ts +37 -0
  268. package/lib/services/spec-slice/types.js +0 -0
  269. package/lib/standalone.d.ts +19 -0
  270. package/lib/standalone.js +2 -0
  271. package/lib/standaloneThemeConfig.d.ts +3 -0
  272. package/lib/standaloneThemeConfig.js +1 -0
  273. package/lib/telemetry/RedocTelemetry.d.ts +3 -0
  274. package/lib/telemetry/RedocTelemetry.js +1 -1
  275. package/lib/telemetry/defaults.d.ts +2 -0
  276. package/lib/telemetry/defaults.js +1 -0
  277. package/lib/types/asyncapi.d.ts +2 -1
  278. package/lib/types/code-samples-config.d.ts +68 -0
  279. package/lib/types/code-samples-config.js +0 -0
  280. package/lib/types/common.d.ts +1 -2
  281. package/lib/types/content.d.ts +6 -4
  282. package/lib/types/edition-config.d.ts +4 -0
  283. package/lib/types/edition-config.js +0 -0
  284. package/lib/types/events.d.ts +2 -2
  285. package/lib/types/openapi.d.ts +3 -3
  286. package/lib/types/options.d.ts +24 -88
  287. package/lib/types/store.d.ts +3 -2
  288. package/lib/url-compat.d.ts +22 -0
  289. package/lib/url-compat.js +1 -0
  290. package/lib/utils/compose.d.ts +1 -0
  291. package/lib/utils/deep-link.d.ts +2 -1
  292. package/lib/utils/deep-link.js +1 -1
  293. package/lib/utils/extract-extensions.js +1 -1
  294. package/lib/utils/graphql-parse.d.ts +1 -0
  295. package/lib/utils/graphql-parse.js +1 -0
  296. package/lib/utils/scroll-anchoring.d.ts +2 -1
  297. package/lib/utils/x-logo.d.ts +13 -0
  298. package/lib/utils/x-logo.js +1 -0
  299. package/lib/yaml-compat.d.ts +7 -0
  300. package/lib/yaml-compat.js +1 -0
  301. package/package.json +36 -15
  302. package/lib/services/code-samples/replay/normalize-servers.js +0 -1
@@ -1,9 +1,8 @@
1
1
  import type { Node } from '@markdoc/markdoc';
2
2
  import type { ConfigureRequestValues, ConfigureServerRequestValues } from '@redocly/theme/ext/configure';
3
- import type { UserClaims } from '@redocly/theme/core/types';
3
+ import type { UserClaims } from '@redocly/theme/core/openapi';
4
4
  export type { ConfigureRequestValues, ConfigureServerRequestValues };
5
5
  export type { UserClaims };
6
- export type { RbacScopeItems } from '@redocly/config';
7
6
  export type ObjectValues<T> = T[keyof T];
8
7
  export type OpenAPIRef = {
9
8
  $ref: string;
@@ -1,6 +1,8 @@
1
1
  import type { REDOCLY_TEAMS_RBAC } from '@redocly/config';
2
+ import type { AdmonitionProps } from '@redocly/theme/components/Admonition/Admonition';
2
3
  import type { Node } from '@markdoc/markdoc';
3
- import type { OpenAPIOperation, OpenAPIResponse } from './openapi.js';
4
+ import type { OpenAPIResponse } from './openapi.js';
5
+ import type { OpenAPIOperation } from './openapi.js';
4
6
  import type { CodeSampleSource } from '../services/code-samples/index.js';
5
7
  import type { BadgeData, ServerData, nodeTypes, panelKind } from './common.js';
6
8
  import type { GroupItem, ApiItemContent, SecuritySchemeEntry } from './store.js';
@@ -187,7 +189,7 @@ export type MarkdocNode = {
187
189
  };
188
190
  export type AdmonitionNode = {
189
191
  nodeType: typeof nodeTypes.ADMONITION;
190
- admonitionType: 'warning' | 'info' | 'danger' | 'success' | 'default';
192
+ admonitionType: NonNullable<AdmonitionProps['type']>;
191
193
  name?: string;
192
194
  nameTranslationKey?: string;
193
195
  content?: string | Node[] | Node;
@@ -405,7 +407,7 @@ export type ResponseExamplesPanelItem = BaseExamplePanelItem & {
405
407
  kind: typeof panelKind.RESPONSE;
406
408
  exampleIds?: string[];
407
409
  responseCodes?: ResponseCodeEntry[];
408
- headerTitle?: string;
410
+ hideHeaderTitle?: boolean;
409
411
  exampleKey?: string;
410
412
  };
411
413
  export type GraphQLQueryPanelItem = BaseExamplePanelItem & {
@@ -468,7 +470,7 @@ export type OverviewPanelItem = ExternalLinkPanelItem | EmailPanelItem | KeyValu
468
470
  export type McpPanelItem = KeyValuePanelItem | TagsPanelItem | ExternalLinkPanelItem | ConnectMcpButtonPanelItem;
469
471
  export type McpExamplePanelItem = {
470
472
  kind: typeof panelKind.MCP_EXAMPLE;
471
- headerTitle: string;
473
+ headerTitleTranslationKey: string;
472
474
  data: unknown;
473
475
  language?: string;
474
476
  };
@@ -0,0 +1,4 @@
1
+ import type { AsyncApiConfig, GraphQLConfig, RedocConfig } from '@redocly/config';
2
+ export type EditionRedocConfig = RedocConfig;
3
+ export type EditionAsyncApiConfig = AsyncApiConfig;
4
+ export type EditionGraphQLConfig = GraphQLConfig;
File without changes
@@ -1,8 +1,8 @@
1
1
  import type { Operation } from './options.js';
2
- export type AnalyticsEventType = 'CodeSampleLanguageSwitched' | 'CodeSampleCopied' | 'OperationServerExpanded' | 'PanelToggle' | 'TargetServerSwitched' | 'TryItOpen' | 'TryItSent';
2
+ export type AnalyticsEventType = 'CodeSampleLanguageSwitched' | 'CodeSampleCopied' | 'OperationServerExpanded' | 'PanelToggle' | 'TryItOpen' | 'TryItSent' | 'TargetServerSwitched';
3
3
  export type AnalyticsEvent = {
4
4
  eventType: AnalyticsEventType;
5
- resource: 'Redocly_CodeSample' | 'Redocly_Operation' | 'Redocly_OperationTryIt';
5
+ resource: 'Redocly_CodeSample' | 'Redocly_OperationTryIt' | 'Redocly_Operation';
6
6
  action: 'LanguageSwitched' | 'PanelToggled' | 'Opened' | 'Closed' | 'NavigatedOverrideLink' | 'Sent' | 'ValidationFailed' | 'CodeSampleCopied' | 'TargetServerSwitched';
7
7
  operationId?: string;
8
8
  operationPath: string;
@@ -1,4 +1,5 @@
1
- import type { ENTITY_RELATION_TYPES, REDOCLY_TEAMS_RBAC, RbacScopeItems } from '@redocly/config';
1
+ import type { RbacScopeItems, REDOCLY_TEAMS_RBAC } from '@redocly/config';
2
+ import type { ENTITY_RELATION_TYPES } from '@redocly/config';
2
3
  import type { Node } from '@markdoc/markdoc';
3
4
  import type { SecurityDetails as ThemeSecurityDetails } from '@redocly/theme/ext/configure';
4
5
  import type { OpenAPIRef, RawLogo, Referenced, SeoData, ExternalDocsData, SecuritySchemeType, SecuritySchemeIn, ObjectValues } from './common.js';
@@ -549,9 +550,9 @@ export type OperationInfo = {
549
550
  externalDocs?: ExternalDocsData;
550
551
  'x-seo'?: SeoData;
551
552
  'x-hideReplay'?: boolean;
553
+ [REDOCLY_TEAMS_RBAC]?: RbacScopeItems;
552
554
  'x-badges'?: OpenAPIXBadges[];
553
555
  'x-codeSamples'?: OpenAPIXCodeSample[];
554
- [REDOCLY_TEAMS_RBAC]?: RbacScopeItems;
555
556
  requestValues?: OperationRequestValues;
556
557
  };
557
558
  export type MarkdownHeading = {
@@ -573,7 +574,6 @@ export type OpenApiBuildContext = {
573
574
  downloadUrls?: NormalizedDownloadUrl[];
574
575
  basePath: string;
575
576
  tagsMap: Map<string, TagData>;
576
- hasTopLevelTags: boolean;
577
577
  collectedTagOrder: string[];
578
578
  storeCtx: StoreContext;
579
579
  badgeTags: OpenAPITag[];
@@ -1,7 +1,9 @@
1
- import type { AsyncApiConfig, GraphQLConfig, LayoutVariant, RedocConfig } from '@redocly/config';
1
+ import type { LayoutVariant } from '@redocly/config';
2
+ import type { RedocConfig } from '@redocly/config';
3
+ import type { EditionAsyncApiConfig, EditionGraphQLConfig, EditionRedocConfig } from './edition-config.js';
2
4
  import type { ConfigFunction, Node, Schema } from '@markdoc/markdoc';
3
5
  import type { MarkdocTagSchema } from '@redocly/theme/markdoc/tags/types';
4
- import type { UserClaims } from '@redocly/theme/core/types';
6
+ import type { UserClaims } from '@redocly/theme/core/openapi';
5
7
  import type { ConfigureRequestValues, ConfigureServerRequestValues } from '@redocly/theme/ext/configure';
6
8
  import type { ReactElement } from 'react';
7
9
  import type { ComponentType } from 'react';
@@ -9,8 +11,10 @@ import type { ApiSpecType, SidebarLogo } from './common.js';
9
11
  import type { ProtocolVariant } from './asyncapi.js';
10
12
  import type { GraphQLOptions } from './graphql.js';
11
13
  import type { Events } from './events.js';
14
+ import type { CodeSamplesConfig } from './code-samples-config.js';
12
15
  import type { OpenAPIInfo, OpenAPIOperation as OpenAPIOperationType, OpenAPIParameter, OpenAPIServer, OpenAPITag } from './openapi.js';
13
16
  import type { Referenced } from './common.js';
17
+ export type * from './code-samples-config.js';
14
18
  export type Operation = {
15
19
  id: string;
16
20
  path: string;
@@ -44,19 +48,30 @@ export type MarkdocOptions = {
44
48
  * host supplies the parser (the standalone build supplies a Markdoc-based one; see
45
49
  * `markdocParser`). It is the single seam where markdown text becomes an AST.
46
50
  */
47
- export type MarkdownParser = (markdown: string, sanitizeOptions?: Partial<Pick<ApiDocsOptions, 'sanitize' | 'unstable_hooks'>>) => Node | Node[] | undefined;
51
+ export type MarkdownParser = (markdown: string, sanitizeOptions?: {
52
+ sanitize?: ApiDocsOptions['sanitize'];
53
+ unstable_hooks?: ApiDocsOptions['unstable_hooks'];
54
+ }) => Node | Node[] | undefined;
48
55
  export type ApiDocsOptions = {
49
- schemaDefinitionsTagName?: string;
50
56
  corsProxyUrl?: string;
57
+ hideInfoMetadata: boolean;
58
+ hideReplay: boolean;
59
+ oAuth2RedirectURI?: string;
60
+ showSchemaCatalogLinks?: boolean;
61
+ licenseKey?: string;
62
+ feedback: NonNullable<RedocConfig['feedback']>;
63
+ mockServer?: {
64
+ url: string;
65
+ position: 'first' | 'last' | 'replace' | 'off';
66
+ description: string;
67
+ };
68
+ schemaDefinitionsTagName?: string;
51
69
  jsonSamplesExpandLevel: number;
52
70
  generatedSamplesMaxDepth: number;
53
71
  hideDownloadButtons: boolean;
54
- hideInfoMetadata: boolean;
55
72
  hideSchemaTitles: boolean;
56
73
  hideSchemaPattern: boolean;
57
74
  maxDisplayedEnumValues: number;
58
- hideReplay: boolean;
59
- oAuth2RedirectURI?: string;
60
75
  onlyRequiredInSamples: boolean;
61
76
  onDeepLinkClick: ((link: string) => void) | undefined | null;
62
77
  schemasExpansionLevel?: number;
@@ -72,33 +87,23 @@ export type ApiDocsOptions = {
72
87
  unstable_skipSamples?: boolean;
73
88
  unstable_externalCodeSamples: Unstable_ExternalCodeSample[];
74
89
  hidePropertiesPrefix: boolean;
75
- showSchemaCatalogLinks?: boolean;
76
90
  dynamicRequestValues?: ConfigureRequestValues | ConfigureServerRequestValues;
77
91
  userClaims?: UserClaims;
78
92
  protocol?: ProtocolVariant;
79
93
  scrollYOffset: () => number;
80
94
  hideLoading: boolean;
81
95
  skipBundle: boolean;
82
- hideSidebar: boolean;
83
96
  basePath: string;
84
97
  specType: ApiSpecType;
85
- licenseKey?: string;
86
98
  metadata: ApiDocsMetadata;
87
99
  downloadUrls?: NormalizedDownloadUrl[];
88
100
  layout: LayoutVariant;
89
- feedback: NonNullable<RedocConfig['feedback']>;
90
- mockServer?: {
91
- url: string;
92
- position: 'first' | 'last' | 'replace' | 'off';
93
- description: string;
94
- };
95
101
  apiLogo?: SidebarLogo;
96
102
  jsonSamplesDepth: number;
97
103
  samplesMaxInlineArgs: number;
98
104
  fieldExpandLevel: number;
99
- baseUrlPath?: string;
100
105
  } & GraphQLOptions;
101
- export type RawApiDocsOptions = RedocConfig & AsyncApiConfig & GraphQLConfig & {
106
+ export type RawApiDocsOptions = EditionRedocConfig & EditionAsyncApiConfig & EditionGraphQLConfig & {
102
107
  specType: ApiSpecType;
103
108
  markdownParser: MarkdownParser;
104
109
  basePath?: string;
@@ -106,78 +111,10 @@ export type RawApiDocsOptions = RedocConfig & AsyncApiConfig & GraphQLConfig & {
106
111
  requiredPropsFirst?: boolean;
107
112
  licenseKey?: string;
108
113
  protocol?: ProtocolVariant;
109
- excludeFromSearch?: boolean;
110
114
  dynamicRequestValues?: ConfigureRequestValues | ConfigureServerRequestValues;
111
115
  userClaims?: UserClaims;
112
- layout?: RedocConfig['layout'] | AsyncApiConfig['layout'] | GraphQLConfig['layout'];
116
+ layout?: EditionRedocConfig['layout'] | EditionAsyncApiConfig['layout'] | EditionGraphQLConfig['layout'];
113
117
  };
114
- export type Languages = 'JavaScript' | 'Node.js' | 'curl' | 'Java8+Apache' | 'Java' | 'Python' | 'Go' | 'PHP' | 'C#' | 'C#+Newtonsoft' | 'Ruby' | 'R';
115
- export interface BasicLanguageOptions {
116
- indent?: string;
117
- withImports?: boolean;
118
- withComments?: boolean;
119
- }
120
- interface CodeSampleBasicConfig {
121
- lang: Languages | 'Payload';
122
- label: string;
123
- key: string;
124
- options?: BasicLanguageOptions;
125
- }
126
- export interface CurlCodeSampleConfig extends CodeSampleBasicConfig {
127
- lang: 'curl';
128
- options?: BasicLanguageOptions & {
129
- binary?: boolean;
130
- };
131
- }
132
- export interface JavaScriptCodeSampleConfig extends CodeSampleBasicConfig {
133
- lang: 'JavaScript';
134
- options?: BasicLanguageOptions & {
135
- credentials?: 'omit' | 'same-origin' | 'include';
136
- };
137
- }
138
- export interface GoCodeSampleConfig extends CodeSampleBasicConfig {
139
- lang: 'Go';
140
- }
141
- export interface NodeJsCodeSampleConfig extends CodeSampleBasicConfig {
142
- lang: 'Node.js';
143
- }
144
- export interface PythonCodeSampleConfig extends CodeSampleBasicConfig {
145
- lang: 'Python';
146
- }
147
- export interface Java8CodeSampleConfig extends CodeSampleBasicConfig {
148
- lang: 'Java8+Apache';
149
- }
150
- export interface JavaCodeSampleConfig extends CodeSampleBasicConfig {
151
- lang: 'Java';
152
- }
153
- export interface CSharpCodeSampleConfig extends CodeSampleBasicConfig {
154
- lang: 'C#';
155
- }
156
- export interface CSharpNewtonsoftCodeSampleConfig extends CodeSampleBasicConfig {
157
- lang: 'C#+Newtonsoft';
158
- }
159
- export interface PHPCodeSampleConfig extends CodeSampleBasicConfig {
160
- lang: 'PHP';
161
- }
162
- export interface RubyCodeSampleConfig extends CodeSampleBasicConfig {
163
- lang: 'Ruby';
164
- }
165
- export interface RCodeSampleConfig extends CodeSampleBasicConfig {
166
- lang: 'R';
167
- }
168
- export interface PayloadCodeSampleConfig extends CodeSampleBasicConfig {
169
- lang: 'Payload';
170
- }
171
- export interface CustomLanguageCodeSampleConfig extends Omit<CodeSampleBasicConfig, 'lang'> {
172
- lang: string;
173
- }
174
- export type CodeSampleConfig = CurlCodeSampleConfig | JavaScriptCodeSampleConfig | NodeJsCodeSampleConfig | PythonCodeSampleConfig | Java8CodeSampleConfig | JavaCodeSampleConfig | CSharpCodeSampleConfig | CSharpNewtonsoftCodeSampleConfig | PHPCodeSampleConfig | GoCodeSampleConfig | RubyCodeSampleConfig | RCodeSampleConfig;
175
- export interface CodeSamplesConfig {
176
- languages: (CodeSampleConfig | PayloadCodeSampleConfig | CustomLanguageCodeSampleConfig)[];
177
- skipOptionalParameters?: boolean;
178
- withOAuth2Call?: boolean;
179
- onSampleTabClick?: (label: string) => void;
180
- }
181
118
  export type Normalized<T> = {
182
119
  [P in keyof T]-?: T[P];
183
120
  };
@@ -257,4 +194,3 @@ export type HooksConfig = {
257
194
  MiddlePanelFooter?: HookConfig<undefined>;
258
195
  MiddlePanelHeader?: HookConfig<undefined>;
259
196
  };
260
- export {};
@@ -1,4 +1,5 @@
1
- import type { ResolvedNavItem, REDOCLY_TEAMS_RBAC } from '@redocly/config';
1
+ import type { ResolvedNavItem } from '@redocly/config';
2
+ import type { REDOCLY_TEAMS_RBAC } from '@redocly/config';
2
3
  import type { DocumentNode } from 'graphql';
3
4
  import type { Node } from '@markdoc/markdoc';
4
5
  import type { ApiSpecType, Badge, BadgeData, ContentType, ItemVariant, SecuritySchemeIn, SecuritySchemeType, ServerData, SeoData, SidebarLogo } from './common.js';
@@ -80,7 +81,7 @@ export type ExampleEntry = {
80
81
  value: unknown;
81
82
  key?: string;
82
83
  summary?: string;
83
- description?: string;
84
+ description?: string | Node | Node[];
84
85
  mediaType?: string;
85
86
  externalValue?: string;
86
87
  [REDOCLY_TEAMS_RBAC]?: Record<string, string>;
@@ -0,0 +1,22 @@
1
+ type LegacyUrl = {
2
+ protocol: string | null;
3
+ slashes: boolean;
4
+ auth: string | null;
5
+ host: string | null;
6
+ hostname: string | null;
7
+ port: string | null;
8
+ pathname: string | null;
9
+ search: string | null;
10
+ hash: string | null;
11
+ href: string;
12
+ format(): string;
13
+ };
14
+ export declare function parse(input: string): LegacyUrl;
15
+ export declare function resolve(from: string, to: string): string;
16
+ export declare function format(url: string | LegacyUrl): string;
17
+ declare const _default: {
18
+ parse: typeof parse;
19
+ resolve: typeof resolve;
20
+ format: typeof format;
21
+ };
22
+ export default _default;
@@ -0,0 +1 @@
1
+ const c=/^[a-z][a-z0-9+.-]*:\/\//i,o=s=>s?s.endsWith(":")?s:`${s}:`:"";function i(s){let t;if(c.test(s))try{t=new URL(s)}catch{t=void 0}if(!t){const a=s.indexOf("#"),r=a===-1?s:s.slice(0,a),l=r.indexOf("?");return{protocol:null,slashes:!1,auth:null,host:null,hostname:null,port:null,pathname:(l===-1?r:r.slice(0,l))||null,search:l===-1?null:r.slice(l),hash:a===-1?null:s.slice(a),href:s,format(){return`${o(this.protocol)}${this.pathname??""}${this.search??""}${this.hash??""}`}}}const e=t.username?t.password?`${t.username}:${t.password}`:t.username:null,n=/^[a-z][a-z0-9+.-]*:\/\/[^/?#]+(?:[?#]|$)/i.test(s)?"":t.pathname;return{protocol:t.protocol,slashes:!0,auth:e,host:t.host||null,hostname:t.hostname||null,port:t.port||null,pathname:n,search:t.search||null,hash:t.hash||null,href:t.href,format(){const a=this.auth?`${this.auth}@`:"";return`${o(this.protocol)}//${a}${this.host??""}${this.pathname}${this.search??""}${this.hash??""}`}}}function u(s){const t=[];for(const e of s.split("/")){if(e===".")continue;const h=t[t.length-1],n=t.length===1&&h==="";e===".."&&n||(e===".."&&t.length>0&&h!==".."?t.pop():t.push(e))}return t.join("/")}function f(s,t){try{return new URL(t,s).toString()}catch{}if(/^[a-z][a-z0-9+.-]*:/i.test(t))return t;if(s.startsWith("//"))try{return new URL(t,`http:${s}`).toString().replace(/^http:/,"")}catch{}if(t.startsWith("/"))return t;const e=t.search(/[?#]/),h=e===-1?t:t.slice(0,e),n=e===-1?"":t.slice(e);return h?u(s.replace(/[^/]*$/,"")+h)+n:s.replace(n.startsWith("?")?/[?#].*$/:/#.*$/,"")+n}function p(s){return typeof s=="string"?s:s.format()}var m={parse:i,resolve:f,format:p};export{m as default,p as format,i as parse,f as resolve};
@@ -4,4 +4,5 @@ export declare function compose<P>(f: HOC<P>): (Component: ComponentType<P>) =>
4
4
  export declare function compose<P>(f: HOC<P>, g: HOC<P>): (Component: ComponentType<P>) => FC<P>;
5
5
  export declare function compose<P>(f: HOC<P>, g: HOC<P>, h: HOC<P>): (Component: ComponentType<P>) => FC<P>;
6
6
  export declare function compose<P>(f: HOC<P>, g: HOC<P>, h: HOC<P>, i: HOC<P>): (Component: ComponentType<P>) => FC<P>;
7
+ export declare function compose<P>(f: HOC<P>, g: HOC<P>, h: HOC<P>, i: HOC<P>, j: HOC<P>): (Component: ComponentType<P>) => FC<P>;
7
8
  export {};
@@ -112,6 +112,7 @@ export declare function isGraphqlDeepLinkAncestor(hash: string, path: string): b
112
112
  */
113
113
  export declare function getDeepLinkId(deepLink: string | undefined): string | undefined;
114
114
  export declare function appendVariantSuffix(fieldParentsName: string[] | undefined, suffix: string): string[];
115
+ export declare function appendArraySuffix(fieldParentsName: string[]): string[];
115
116
  /**
116
117
  * Remove variant deep-link markers (`&oneof=N`, `&d=N`) from a field-parent path
117
118
  * piece, leaving the human-readable name(s). The markers can sit mid-path
@@ -135,7 +136,7 @@ export declare function variantMarkersOnly(fieldParentsName: string[] | undefine
135
136
  * Extract a deep-link parameter value from a URL hash.
136
137
  * The search is case-insensitive and values are returned lowercased.
137
138
  */
138
- export declare function extractDeepLinkParamFromHash(hash: string, key: 'c' | 'm'): string | undefined;
139
+ export declare function extractDeepLinkParamFromHash(hash: string, key: 'c' | 'm' | 'ct' | 'ex'): string | undefined;
139
140
  /** Section name owning a callback's suffixes: `callbacks/<callbackId>[/…]`. */
140
141
  export declare const CALLBACKS_SECTION = "callbacks";
141
142
  /** Sub-section anchors a callback owns. Emitted by `CallbacksSection` and matched here, so
@@ -1 +1 @@
1
- import{encodeBackSlashes as k,tryDecodeURIComponent as a}from"./string.js";import{joinWithSeparator as i,normalizePath as x,toElementId as S}from"./url.js";import{resolveRouteByPathname as A}from"./routing.js";function C(t){const e=[];for(const[n,r]of Object.entries(t))r!==void 0&&e.push(`${n}=${r}`);return e.join("&")}function g(t,e){return t=k(t).replace(/^\/+/,""),(`/${t}#`+i(t,e)).toLowerCase()}function D(t,e,n){const r=g(e,n);return x(i(t,r))}function h(t){const e=t.startsWith("#")?t.slice(1):t;return a(e).toLowerCase()}function b(t){const e=a(t),n=e.indexOf("#");return n>=0?e.slice(n+1):""}function j(t){return C({t:t.t,in:t.in,c:t.c,cb:t.cb,ct:t.ct,path:t.path})}function F(t,e,n){let r=t;return n&&(r=`${r}&c=${n}`),e&&(r=i(r,e)),r}function I(t){const{section:e,messageKey:n,subsection:r}=t;if(!n)return e;let o=`${e}&m=${n}`;return r&&(o+=`&t=${r}`),o}function M(t){return C({t:t.t,path:t.path,arg:t.arg,rt:t.rt})}function P(t,e){return!t||!e?!1:a(t.startsWith("#")?t.slice(1):t).toLowerCase().includes(`path=${e.toLowerCase()}.`)}function v(t){return t&&b(t)||void 0}function z(t,e){const n=[...t??[]];return n.length>0?n[n.length-1]+=e:n.push(e),n}const E=/&(?:oneof|d)=\d+/g;function H(t){return t.replace(E,"")}function q(t){return t.replace(/\[\]/g,"")}function G(t){return(t??[]).filter(e=>e.includes("&")).map(e=>e.slice(e.indexOf("&")))}function U(t,e){return t?a(t.startsWith("#")?t.slice(1):t).toLowerCase().match(new RegExp(`(?:^|[&/])${e}=([^/&]+)`))?.[1]:void 0}const O="callbacks",f=`${O}/`,w="callback-request",T="callback-response",R=[`/${w}`,`/${T}`];function p(t){const e=t.indexOf("path=");return e===-1?t:t.slice(0,e)}function V(t){return t.replace(`/${f}`,"/")}function L(t,e){const n=`cb=${e}`;return t.endsWith(n)||t.includes(`${n}&`)}function W(t,e){const n=`/${e}`;return t.endsWith(n)||t.includes(`${n}/`)}function y(t,e){return t===e||t.startsWith(`${e}/`)}function Q(t,e,n){if(!t||!e||!n)return!1;const r=h(t);if(!y(r,e))return!1;const o=p(r),c=n.toLowerCase();return L(o,c)||W(o,c)}function J(t,e,n){const r=p(t),o=n.toLowerCase();return r.startsWith(i(e,`${f}${o}/`))||r.startsWith(i(e,`${o}/`))||L(r,o)}function X(t,e){const n=p(t).slice(e.length);return!(n.startsWith(`/${f}`)||n.includes("cb=")||R.some(o=>n.includes(o)))}function N(t){const e=["#tag","#operation","#paths"];for(const n of e)if(t.includes(n))return t.replace(n,"").toLowerCase();return""}function Y(t,e,n){const r=h(t);if(!r)return;const o=x(i(e,r));if(A(n,o))return o;const c=N(t);if(!c)return;const l=c.split("/").filter(Boolean);for(let s=l.length;s>0;s--){const $="/"+l.slice(0,s).join("/"),u=n.allRoutes.find(m=>m.path.endsWith($));if(!u)continue;const d=l.slice(s).join("/");return d?`${u.path}#${i(S(u.path,e),d)}`:u.path}}export{O as CALLBACKS_SECTION,w as CALLBACK_REQUEST_SECTION,T as CALLBACK_RESPONSE_SECTION,z as appendVariantSuffix,I as buildAsyncApiSuffix,D as buildDeepLinkUrl,M as buildGraphqlSuffix,j as buildOpenApiFieldSuffix,F as buildOpenApiSectionSuffix,b as deepLinkToId,U as extractDeepLinkParamFromHash,v as getDeepLinkId,N as getLegacyHash,y as hashIsForItem,J as hashIsInsideCallback,X as hashIsOutsideCallbacks,Q as hashTargetsCallback,h as hashToElementId,P as isGraphqlDeepLinkAncestor,g as makeDeepLink,Y as resolveLegacyHashToRoute,C as serializeFieldParams,q as stripArrayMarkers,V as stripCallbacksSegment,H as stripVariantMarkers,G as variantMarkersOnly};
1
+ import{encodeBackSlashes as g,tryDecodeURIComponent as a}from"./string.js";import{joinWithSeparator as i,normalizePath as x,toElementId as A}from"./url.js";import{resolveRouteByPathname as k}from"./routing.js";function h(t){const e=[];for(const[n,r]of Object.entries(t))r!==void 0&&e.push(`${n}=${r}`);return e.join("&")}function b(t,e){return t=g(t).replace(/^\/+/,""),(`/${t}#`+i(t,e)).toLowerCase()}function N(t,e,n){const r=b(e,n);return x(i(t,r))}function C(t){const e=t.startsWith("#")?t.slice(1):t;return a(e).toLowerCase()}function m(t){const e=a(t),n=e.indexOf("#");return n>=0?e.slice(n+1):""}function j(t){return h({t:t.t,in:t.in,c:t.c,cb:t.cb,ct:t.ct,path:t.path})}function F(t,e,n){let r=t;return n&&(r=`${r}&c=${n}`),e&&(r=i(r,e)),r}function I(t){const{section:e,messageKey:n,subsection:r}=t;if(!n)return e;let o=`${e}&m=${n}`;return r&&(o+=`&t=${r}`),o}function M(t){return h({t:t.t,path:t.path,arg:t.arg,rt:t.rt})}function v(t,e){return!t||!e?!1:a(t.startsWith("#")?t.slice(1):t).toLowerCase().includes(`path=${e.toLowerCase()}.`)}function z(t){return t&&m(t)||void 0}function H(t,e){const n=[...t??[]];return n.length>0?n[n.length-1]+=e:n.push(e),n}function q(t){return t.length===0?t:[...t.slice(0,-1),t[t.length-1]+"[]"]}const E=/&(?:oneof|d)=\d+/g;function G(t){return t.replace(E,"")}function U(t){return t.replace(/\[\]/g,"")}function V(t){return(t??[]).filter(e=>e.includes("&")).map(e=>e.slice(e.indexOf("&")))}function P(t,e){return t?a(t.startsWith("#")?t.slice(1):t).toLowerCase().match(new RegExp(`(?:^|[&/])${e}=(${e==="ct"?"[^&]+":"[^/&]+"})`))?.[1]:void 0}const O="callbacks",f=`${O}/`,w="callback-request",T="callback-response",R=[`/${w}`,`/${T}`];function p(t){const e=t.indexOf("path=");return e===-1?t:t.slice(0,e)}function Q(t){return t.replace(`/${f}`,"/")}function L(t,e){const n=`cb=${e}`;return t.endsWith(n)||t.includes(`${n}&`)}function W(t,e){const n=`/${e}`;return t.endsWith(n)||t.includes(`${n}/`)}function y(t,e){return t===e||t.startsWith(`${e}/`)}function J(t,e,n){if(!t||!e||!n)return!1;const r=C(t);if(!y(r,e))return!1;const o=p(r),c=n.toLowerCase();return L(o,c)||W(o,c)}function X(t,e,n){const r=p(t),o=n.toLowerCase();return r.startsWith(i(e,`${f}${o}/`))||r.startsWith(i(e,`${o}/`))||L(r,o)}function Y(t,e){const n=p(t).slice(e.length);return!(n.startsWith(`/${f}`)||n.includes("cb=")||R.some(o=>n.includes(o)))}function _(t){const e=["#tag","#operation","#paths"];for(const n of e)if(t.includes(n))return t.replace(n,"").toLowerCase();return""}function Z(t,e,n){const r=C(t);if(!r)return;const o=x(i(e,r));if(k(n,o))return o;const c=_(t);if(!c)return;const l=c.split("/").filter(Boolean);for(let s=l.length;s>0;s--){const $="/"+l.slice(0,s).join("/"),u=n.allRoutes.find(S=>S.path.endsWith($));if(!u)continue;const d=l.slice(s).join("/");return d?`${u.path}#${i(A(u.path,e),d)}`:u.path}}export{O as CALLBACKS_SECTION,w as CALLBACK_REQUEST_SECTION,T as CALLBACK_RESPONSE_SECTION,q as appendArraySuffix,H as appendVariantSuffix,I as buildAsyncApiSuffix,N as buildDeepLinkUrl,M as buildGraphqlSuffix,j as buildOpenApiFieldSuffix,F as buildOpenApiSectionSuffix,m as deepLinkToId,P as extractDeepLinkParamFromHash,z as getDeepLinkId,_ as getLegacyHash,y as hashIsForItem,X as hashIsInsideCallback,Y as hashIsOutsideCallbacks,J as hashTargetsCallback,C as hashToElementId,v as isGraphqlDeepLinkAncestor,b as makeDeepLink,Z as resolveLegacyHashToRoute,h as serializeFieldParams,U as stripArrayMarkers,Q as stripCallbacksSegment,G as stripVariantMarkers,V as variantMarkersOnly};
@@ -1 +1 @@
1
- const x={"x-circular-ref":!0,"x-complex":!0,"x-parentRefs":!0,"x-refsStack":!0,"x-codeSamples":!0,"x-displayName":!0,"x-examples":!0,"x-logo":!0,"x-nullable":!0,"x-servers":!0,"x-tagGroups":!0,"x-traitTag":!0,"x-additionalPropertiesName":!0,"x-explicitMappingOnly":!0,"x-enumDescriptions":!0,"x-badges":!0,"x-hideReplay":!0,"x-feedback":!0,"x-assertionType":!0,"x-rbac":!0,"x-seo":!0};function n(r){return r in x}function i(r,t){return Object.keys(r).filter(e=>t===!0?e.startsWith("x-")&&!n(e):e.startsWith("x-")&&t.indexOf(e)>-1).reduce((e,u)=>(e[u]=r[u],e),{})}function a(r,t){return t===!1||t===void 0?{}:i(r,t)}export{i as extractExtensions,a as getExtensionsForDisplay,n as isRedocExtension};
1
+ const x={"x-circular-ref":!0,"x-complex":!0,"x-parentRefs":!0,"x-refsStack":!0,"x-codeSamples":!0,"x-displayName":!0,"x-examples":!0,"x-logo":!0,"x-nullable":!0,"x-servers":!0,"x-tagGroups":!0,"x-traitTag":!0,"x-additionalPropertiesName":!0,"x-explicitMappingOnly":!0,"x-enumDescriptions":!0,"x-badges":!0,"x-hideReplay":!0,"x-feedback":!0,"x-assertionType":!0,"x-rbac":!0,"x-seo":!0,"x-usePkce":!0,"x-keywords":!0,"x-mcp":!0,"x-metadata":!0,"x-summary":!0,"x-tags":!0,"x-webhooks":!0};function a(r){return r in x}function n(r,t){return Object.keys(r).filter(e=>t===!0?e.startsWith("x-")&&!a(e):e.startsWith("x-")&&t.indexOf(e)>-1).reduce((e,u)=>(e[u]=r[u],e),{})}function i(r,t){return t===!1||t===void 0?{}:n(r,t)}export{n as extractExtensions,i as getExtensionsForDisplay,a as isRedocExtension};
@@ -0,0 +1 @@
1
+ export { parse } from 'graphql';
@@ -0,0 +1 @@
1
+ import{parse as o}from"graphql";export{o as parse};
@@ -1,3 +1,4 @@
1
1
  /** Keeps the section under the reading line in view across a content-height swap
2
- * (response code, oneOf, media type). Call synchronously from the state write. */
2
+ * (response code, oneOf, media type, example selection). Call synchronously from
3
+ * the state write. */
3
4
  export declare function keepReadingSectionAnchored(): void;
@@ -0,0 +1,13 @@
1
+ type XLogo = {
2
+ url?: string;
3
+ href?: string;
4
+ altText?: string;
5
+ backgroundColor?: string;
6
+ };
7
+ export type LogoConfig = XLogo;
8
+ /**
9
+ * Derives the sidebar logo config from the definition's `info['x-logo']`
10
+ * extension, falling back to `info.contact.url` for the link.
11
+ */
12
+ export declare function logoFromDefinition(definition: Record<string, unknown> | string | undefined): LogoConfig | undefined;
13
+ export {};
@@ -0,0 +1 @@
1
+ function e(n){if(typeof n=="string")return;const r=n?.info,o=r?.["x-logo"];if(!o?.url)return;const t=r?.contact;return{url:o.url,href:o.href||t?.url,altText:o.altText,backgroundColor:o.backgroundColor}}export{e as logoFromDefinition};
@@ -0,0 +1,7 @@
1
+ export declare const parse: (str: any) => unknown;
2
+ export declare const stringify: (obj: any) => string;
3
+ declare const _default: {
4
+ parse: typeof parse;
5
+ stringify: typeof stringify;
6
+ };
7
+ export default _default;
@@ -0,0 +1 @@
1
+ import{dump as t,load as r}from"js-yaml";const p=o=>r(o),e=o=>t(o);var a={parse:p,stringify:e};export{a as default,p as parse,e as stringify};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/api-docs",
3
- "version": "0.2.0-next.0",
3
+ "version": "0.2.0-next.10",
4
4
  "description": "Redocly API Documentation Library",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -31,29 +31,33 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@markdoc/markdoc": "0.5.2",
34
- "@redocly/openapi-core": "2.45.0",
34
+ "@redocly/allof-merge": "0.6.9",
35
+ "@redocly/config": "0.56.0",
36
+ "@redocly/openapi-core": "2.51.2",
37
+ "@redocly/redoc-opentelemetry": "0.2.4",
38
+ "@redocly/replay": "0.28.0-next.9",
39
+ "@redocly/theme": "^0.69.0-next.9",
35
40
  "dompurify": "3.4.13",
36
41
  "fast-xml-parser": "5.7.3",
37
42
  "graphql": "16.14.2",
43
+ "htmlparser2": "8.0.2",
38
44
  "jotai": "^2.16.2",
39
45
  "jotai-family": "1.0.1",
40
46
  "js-yaml": "4.3.1",
41
47
  "json-pointer": "^0.6.2",
42
48
  "linkedom": "^0.18.12",
43
- "openapi-sampler": "^1.7.2",
49
+ "openapi-sampler": "^1.7.5",
44
50
  "prismjs": "1.30.0",
45
51
  "react-router": "^8.3.0",
46
52
  "slugify": "^1.4.7",
47
53
  "swagger2openapi": "^7.0.8",
48
54
  "url-template": "^2.0.8",
49
- "web-vitals": "3.3.1",
50
- "@redocly/config": "0.53.1",
51
- "@redocly/redoc-opentelemetry": "0.2.2",
52
- "@redocly/replay": "0.28.0-next.0",
53
- "@redocly/theme": "^0.69.0-next.0",
54
- "@redocly/allof-merge": "0.6.9"
55
+ "web-vitals": "3.3.1"
55
56
  },
56
57
  "devDependencies": {
58
+ "@microsoft/api-extractor": "7.58.2",
59
+ "@playwright/test": "1.60.0",
60
+ "@redocly/ajv": "8.18.0",
57
61
  "@testing-library/jest-dom": "6.6.3",
58
62
  "@testing-library/react": "16.3.0",
59
63
  "@types/js-yaml": "4.0.9",
@@ -63,11 +67,13 @@
63
67
  "@types/react": "^19.2.7",
64
68
  "@types/react-dom": "^19.2.3",
65
69
  "@types/swagger2openapi": "^7.0.4",
66
- "@vitejs/plugin-react-swc": "4.3.1",
67
- "@vitest/browser-playwright": "4.1.10",
68
- "@vitest/coverage-v8": "4.1.10",
70
+ "@vitejs/plugin-react": "6.0.1",
71
+ "@vitest/browser-playwright": "4.1.11",
72
+ "@vitest/coverage-v8": "4.1.11",
69
73
  "esbuild": "0.28.1",
74
+ "flexsearch": "^0.8.2",
70
75
  "globals": "^16.5.0",
76
+ "http-server": "14.1.1",
71
77
  "jest-styled-components": "7.2.0",
72
78
  "react": "^19.2.7",
73
79
  "react-dom": "^19.2.7",
@@ -76,10 +82,19 @@
76
82
  "tsx": "^4.20.6",
77
83
  "typescript": "6.0.3",
78
84
  "url": "~0.11.0",
79
- "vite": "^7.2.4",
80
- "vitest": "4.1.10",
85
+ "vite": "8.2.2",
86
+ "vitest": "4.1.11",
81
87
  "vitest-browser-react": "^2.0.2"
82
88
  },
89
+ "nx": {
90
+ "targets": {
91
+ "vitest:test": {
92
+ "dependsOn": [
93
+ "build"
94
+ ]
95
+ }
96
+ }
97
+ },
83
98
  "scripts": {
84
99
  "start": "vite --open /docs",
85
100
  "build": "pnpm run clean && pnpm run ts:check && pnpm run build:lib && pnpm run build:standalone && pnpm run build:minify",
@@ -89,10 +104,16 @@
89
104
  "analyze:bundle": "vite build --mode analyze",
90
105
  "watch": "tsgo -w -p tsconfig.build.json",
91
106
  "clean": "rimraf bundle lib",
107
+ "prepare:community-source": "tsx ./scripts/prepare-community-source.ts",
108
+ "prepare:community-dependencies": "tsx ./scripts/prepare-community-dependencies.ts",
109
+ "apply:community-source": "tsx ./scripts/apply-changes-from-community-source.ts",
110
+ "stage:ce": "pnpm run prepare:community-dependencies && pnpm run prepare:community-source",
111
+ "e2e:ce": "pnpm run stage:ce && cd redoc && REDOC_THEME_PATH=../../theme/src npm run e2e",
112
+ "lint:ce": "cd redoc && test -d src && test -d e2e && test -f vitest.setup.ts && find src e2e vitest.setup.ts -type f \\( -name '*.ts' -o -name '*.tsx' -o -name '*.cts' -o -name '*.mts' \\) -print0 | xargs -0 ./node_modules/.bin/oxlint --max-warnings=0",
92
113
  "test": "nx run vitest:test",
93
114
  "test:update": "nx run vitest:test -u --skip-nx-cache",
94
115
  "test:coverage:html": "nx run vitest:test --coverage --coverage.reporter=html --exclude 'tools/**'",
95
- "test:tools": "vitest run tools",
116
+ "test:ce": "pnpm run stage:ce && cd redoc && npm run unit",
96
117
  "ts:check": "tsgo -p tsconfig.build.json --noEmit --skipLibCheck"
97
118
  }
98
119
  }
@@ -1 +0,0 @@
1
- import{isAbsoluteUrl as l,removeQueryStringAndHash as o,resolveUrl as s}from"../../../adapters/openapi/utils/helpers.js";import{getUrlDirname as i}from"../../../adapters/openapi/utils/url.js";import{IS_BROWSER as u}from"../../../utils/environments.js";function f(e){const t=o(e);if(!t||t.endsWith("/"))return t;const r=t.lastIndexOf("/");return r===-1?"":t.slice(0,r)}function a(e){return e===void 0?o((()=>{if(!u)return globalThis.SSR_HOSTNAME||"";const r=window.location.href;return r.endsWith(".html")&&i(r)||r})()):l(e)?i(e):f(e)}function m(e,t){const r=a(t);return r?s(r,e):e}function S(e,t){let r=t;return r.length===0&&(r=[{url:"/"}]),r.map(n=>({...n,url:m(n.url,e),description:n.description||""}))}export{S as normalizeServers,m as resolveServerUrl};