@clarify-labs/renderer 0.11.18 → 0.11.19

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.
@@ -1827,10 +1827,17 @@ function getOpenApiOperationEntryById(spec, operationId) {
1827
1827
  const matches = listOpenApiOperations(spec).filter(({ operation }) => operation.operationId === operationId);
1828
1828
  return matches.length === 1 ? matches[0] : void 0;
1829
1829
  }
1830
- function listOpenApiOperations(spec) {
1830
+ function listOpenApiOperations(spec, operationOrder) {
1831
1831
  const paths = spec.paths ?? {};
1832
1832
  const webhooks = spec.webhooks;
1833
- return [...listOperationsFromPathItems(paths, "path", spec), ...isRecord(webhooks) ? listOperationsFromPathItems(webhooks, "webhook", spec) : []];
1833
+ const operations = [...listOperationsFromPathItems(paths, "path", spec), ...isRecord(webhooks) ? listOperationsFromPathItems(webhooks, "webhook", spec) : []];
1834
+ if (!operationOrder?.length) return operations;
1835
+ const orderByOperationId = new Map(operationOrder.map((operationId, index) => [operationId, index]));
1836
+ return operations.map((entry, index) => ({
1837
+ entry,
1838
+ index,
1839
+ order: entry.operation.operationId ? orderByOperationId.get(entry.operation.operationId) : void 0
1840
+ })).sort((left, right) => (left.order ?? operationOrder.length) - (right.order ?? operationOrder.length) || left.index - right.index).map(({ entry }) => entry);
1834
1841
  }
1835
1842
  //#endregion
1836
1843
  //#region source/openapi/components/EndpointMethodBadge.tsx
@@ -5730,4 +5737,4 @@ function OpenApiOperation(arg0) {
5730
5737
  //#endregion
5731
5738
  export { Heading as A, Callout as B, Tabs as C, GridPattern as D, Prose as E, CodeGroup as F, LocalizedLink as H, Pre as I, Mermaid as L, Feedback as M, Collapse as N, HeroPattern as O, Code as P, Card as R, TabItem as S, Steps as T, Button as V, Markdown as _, ResponseExamplesPanel as a, primitives_exports as b, getAuthOptions as c, EndpointMethodBadge as d, getOpenApiOperationEntryById as f, getRequestBody$1 as g, getMediaTypeEntries as h, RequestExamplesPanel as i, Tag as j, Logo as k, getServerKey as l, listOpenApiOperations as m, OpenApiOperation as n, authPlaceholder as o, getOpenApiOperationSectionId as p, OpenApiRequestWorkbench as r, defaultServerVariables as s, EndpointIdentity as t, getServers as u, Release as v, Step as w, WebFrame as x, ReleaseItem as y, CardGroup as z };
5732
5739
 
5733
- //# sourceMappingURL=OpenApiOperation-hxX828Il.js.map
5740
+ //# sourceMappingURL=OpenApiOperation-B68CqUJW.js.map