@redocly/openapi-docs 3.13.0-next.6 → 3.13.0-next.7

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.
@@ -1,4 +1,4 @@
1
- import{jsx as e,Fragment as m,jsxs as s}from"react/jsx-runtime";import{memo as p,useCallback as f}from"react";import{DownloadIcon as x}from"@redocly/theme/icons/DownloadIcon/DownloadIcon";import{getPathPrefix as g,combineUrls as w}from"@redocly/theme/core/openapi";import{Button as u}from"@redocly/theme/components/Button/Button";import{DocumentIcon as b}from"@redocly/theme/icons/DocumentIcon/DocumentIcon";import{JsonIcon as h}from"@redocly/theme/icons/JsonIcon/JsonIcon";import{FileIcon as v}from"@redocly/theme/icons/FileIcon/FileIcon";import{useTelemetry as y}from"../../hooks/index.js";import{styled as r}from"../../styled-components.js";function k({downloadObjects:n}){const l=y(),t=g(),c=f(o=>{switch(o){case"yaml":return e(b,{});case"json":return e(h,{});default:return e(v,{})}},[]);return n?e(C,{children:(n||[]).map(({title:o,url:i,iconType:d})=>{const a=t?w(t,i):i;return s(D,{onClick:()=>{l.sendOpenapiDocsDownloadDefinitionClickedMessage(void 0)},children:[s(j,{children:[c(d),e("a",{href:a,target:"_blank",download:!0,rel:"noreferrer",children:o})]}),e("a",{href:a,target:"_blank",download:!0,rel:"noreferrer",children:e(u,{variant:"text",size:"small",icon:e(x,{})})})]},o)})}):e(m,{})}const N=p(k),D=r.div`
1
+ import{jsx as e,Fragment as d,jsxs as s}from"react/jsx-runtime";import{memo as p,useCallback as f}from"react";import{DownloadIcon as x}from"@redocly/theme/icons/DownloadIcon/DownloadIcon";import{getPathPrefix as g,combineUrls as w}from"@redocly/theme/core/openapi";import{Button as b}from"@redocly/theme/components/Button/Button";import{DocumentIcon as h}from"@redocly/theme/icons/DocumentIcon/DocumentIcon";import{JsonIcon as u}from"@redocly/theme/icons/JsonIcon/JsonIcon";import{FileIcon as v}from"@redocly/theme/icons/FileIcon/FileIcon";import{useTelemetry as y}from"../../hooks/index.js";import{styled as r}from"../../styled-components.js";function k({downloadObjects:t}){const l=y(),n=g(),c=f(o=>{switch(o){case"yaml":return e(h,{});case"json":return e(u,{});default:return e(v,{})}},[]);return t?e(C,{children:(t||[]).map(({title:o,url:a,iconType:m})=>{const i=n?w(n,a):a;return s(D,{onClick:()=>{l.sendOpenapiDocsDownloadDefinitionClickedMessage()},children:[s(j,{children:[c(m),e("a",{href:i,target:"_blank",download:!0,rel:"noreferrer",children:o})]}),e("a",{href:i,target:"_blank",download:!0,rel:"noreferrer",children:e(b,{variant:"text",size:"small",icon:e(x,{})})})]},o)})}):e(d,{})}const N=p(k),D=r.div`
2
2
  display: flex;
3
3
  align-items: baseline;
4
4
  justify-content: space-between;
@@ -1 +1 @@
1
- import{jsx as r,Fragment as _,jsxs as F}from"react/jsx-runtime";import{lazy as B,memo as M,Suspense as z,useCallback as u,useRef as J,useState as K}from"react";import{useAtom as f,useAtomValue as p}from"jotai";import w from"deepmerge";const H=B(async()=>import("@redocly/replay").then(t=>({default:t.ReplayOverlay})));import{Button as Q}from"@redocly/theme/components/Button/Button";import{useFocusTrap as W,useModalScrollLock as X}from"@redocly/theme/core/openapi";import{RocketIcon as Y}from"@redocly/theme/icons/RocketIcon/RocketIcon";import{CircleDashIcon as Z}from"@redocly/theme/icons/CircleDashIcon/CircleDashIcon";import{Portal as $}from"@redocly/theme/components/Portal/Portal";import{globalOptionsAtom as ee,globalStoreAtom as te}from"../../jotai/store.js";import{allOperationsAtom as oe,replayStateAtom as re}from"../../jotai/replay.js";import{allOperations as ne,getDefaultOperationStore as ae}from"../../jotai/operation.js";import{LOADING_STATE as a}from"../../constants.js";import{environmentAtom as se,userClaimsAtom as ie}from"../../jotai/app.js";import{convertOperationToReplayValueForRedoc as le}from"./utils.js";import{useTranslate as me,useTelemetry as pe}from"../../hooks/index.js";import{JsonPointer as ce}from"../../utils/index.js";import{getDefaultCollectorUrl as ue}from"../../utils/telemetry.js";import{createTryItOpenEvent as fe,createTryItSentEvent as de}from"../../events/index.js";function ye({operation:t,corsProxyUrl:D,fullOpenApi:d}){const y=me(),C=pe(),O=J(null),{mockServer:L,oAuth2RedirectURI:b,routingBasePath:c}=p(ee),I=p(oe),{parser:P,options:{events:s}}=p(te),N=p(ie),[l,E]=K(!1),[m,h]=f(re),[g,v]=f(ne),[[,V],A]=f(se);W(O),X(l);const q=u(({operations:e,environment:o,environments:i})=>{const k=e.reduce((S,n)=>{n.requestValues.body=n.requestValues.body instanceof URLSearchParams?Object.fromEntries(n.requestValues.body.entries()):n.requestValues.body;const{path:G,method:U}=n.apiPath,T=ce.compile(["paths",G,U]);return S[T]=w(ae(T),n),S},{});v({...g,...k}),A({environment:o,environments:i})},[g,v,A]),R=()=>{if(m!==a.LOADING){if(!l&&(C.sendOpenapiDocsTryItOpenedMessage(void 0),s?.tryItOpen&&t)){const e=fe({operation:t});s.tryItOpen(e)}E(!l)}m===a.NOT_LOADED&&h(a.LOADING)},x=u(e=>{if(s?.tryItSent&&t){const o=de({operation:t,isSuccess:e});s.tryItSent(o)}},[s,t]),j=u(e=>{if(!e)return;const o=I.find(i=>i.operationId===e);return c+o?.href},[I,c]);return d?F(_,{children:[r(Q,{onClick:R,variant:"primary",iconPosition:"left",icon:m===a.LOADING?r(Z,{}):r(Y,{}),children:m===a.LOADING?y("openapi.loading","Loading..."):y("openapi.tryIt","Try it")}),l&&r(z,{children:r($,{mountId:"api-content",children:r("div",{ref:O,children:r(H,{activeOperationId:t.operationId||t.pointer,api:d,onRequestChange:q,onClose:R,onLoad:()=>h(a.LOADED),settings:{corsProxyUrl:D,mockServer:L,environment:V,apiId:P?.definition.info?.["x-metadata"]?.apiId,oAuth2RedirectURI:b,disableCollectionsTab:!0,storageKey:c,telemetry:{tracerName:"try-it",collectorUrl:ue()},convertOperationToReplayValue:(e,o,i)=>le(N)(e,o,i),getOperationUrl:j},onRequestSent:x})})})})]}):null}const je=M(ye);export{je as Replay};
1
+ import{jsx as r,Fragment as _,jsxs as F}from"react/jsx-runtime";import{lazy as B,memo as M,Suspense as z,useCallback as u,useRef as J,useState as K}from"react";import{useAtom as f,useAtomValue as p}from"jotai";import w from"deepmerge";const H=B(async()=>import("@redocly/replay").then(t=>({default:t.ReplayOverlay})));import{Button as Q}from"@redocly/theme/components/Button/Button";import{useFocusTrap as W,useModalScrollLock as X}from"@redocly/theme/core/openapi";import{RocketIcon as Y}from"@redocly/theme/icons/RocketIcon/RocketIcon";import{CircleDashIcon as Z}from"@redocly/theme/icons/CircleDashIcon/CircleDashIcon";import{Portal as $}from"@redocly/theme/components/Portal/Portal";import{globalOptionsAtom as ee,globalStoreAtom as te}from"../../jotai/store.js";import{allOperationsAtom as oe,replayStateAtom as re}from"../../jotai/replay.js";import{allOperations as ne,getDefaultOperationStore as ae}from"../../jotai/operation.js";import{LOADING_STATE as a}from"../../constants.js";import{environmentAtom as se,userClaimsAtom as ie}from"../../jotai/app.js";import{convertOperationToReplayValueForRedoc as le}from"./utils.js";import{useTranslate as me,useTelemetry as pe}from"../../hooks/index.js";import{JsonPointer as ce}from"../../utils/index.js";import{getDefaultCollectorUrl as ue}from"../../utils/telemetry.js";import{createTryItOpenEvent as fe,createTryItSentEvent as de}from"../../events/index.js";function ye({operation:t,corsProxyUrl:D,fullOpenApi:d}){const y=me(),C=pe(),O=J(null),{mockServer:L,oAuth2RedirectURI:b,routingBasePath:c}=p(ee),I=p(oe),{parser:P,options:{events:s}}=p(te),N=p(ie),[l,E]=K(!1),[m,h]=f(re),[g,v]=f(ne),[[,V],A]=f(se);W(O),X(l);const q=u(({operations:e,environment:o,environments:i})=>{const k=e.reduce((S,n)=>{n.requestValues.body=n.requestValues.body instanceof URLSearchParams?Object.fromEntries(n.requestValues.body.entries()):n.requestValues.body;const{path:G,method:U}=n.apiPath,T=ce.compile(["paths",G,U]);return S[T]=w(ae(T),n),S},{});v({...g,...k}),A({environment:o,environments:i})},[g,v,A]),R=()=>{if(m!==a.LOADING){if(!l&&(C.sendOpenapiDocsTryItOpenedMessage(),s?.tryItOpen&&t)){const e=fe({operation:t});s.tryItOpen(e)}E(!l)}m===a.NOT_LOADED&&h(a.LOADING)},x=u(e=>{if(s?.tryItSent&&t){const o=de({operation:t,isSuccess:e});s.tryItSent(o)}},[s,t]),j=u(e=>{if(!e)return;const o=I.find(i=>i.operationId===e);return c+o?.href},[I,c]);return d?F(_,{children:[r(Q,{onClick:R,variant:"primary",iconPosition:"left",icon:m===a.LOADING?r(Z,{}):r(Y,{}),children:m===a.LOADING?y("openapi.loading","Loading..."):y("openapi.tryIt","Try it")}),l&&r(z,{children:r($,{mountId:"api-content",children:r("div",{ref:O,children:r(H,{activeOperationId:t.operationId||t.pointer,api:d,onRequestChange:q,onClose:R,onLoad:()=>h(a.LOADED),settings:{corsProxyUrl:D,mockServer:L,environment:V,apiId:P?.definition.info?.["x-metadata"]?.apiId,oAuth2RedirectURI:b,disableCollectionsTab:!0,storageKey:c,telemetry:{tracerName:"try-it",collectorUrl:ue()},convertOperationToReplayValue:(e,o,i)=>le(N)(e,o,i),getOperationUrl:j},onRequestSent:x})})})})]}):null}const je=M(ye);export{je as Replay};
@@ -605,6 +605,9 @@ export declare function loadRedoclyConfig(): Promise<{
605
605
  pagination?: "section" | "none" | "item" | undefined;
606
606
  pathInMiddlePanel?: boolean | undefined;
607
607
  payloadSampleIdx?: number | undefined;
608
+ requestInterceptor?: {
609
+ [x: string]: unknown;
610
+ } | undefined;
608
611
  requiredPropsFirst?: boolean | undefined;
609
612
  routingStrategy?: string | undefined;
610
613
  samplesTabsMaxCount?: number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/openapi-docs",
3
- "version": "3.13.0-next.6",
3
+ "version": "3.13.0-next.7",
4
4
  "description": "Redocly OpenAPI Docs",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -36,8 +36,8 @@
36
36
  "url-template": "^2.0.8",
37
37
  "util": "~0.12.5",
38
38
  "web-vitals": "3.3.1",
39
- "@redocly/config": "0.28.0",
40
- "@redocly/replay": "0.16.0-next.5"
39
+ "@redocly/config": "0.29.0",
40
+ "@redocly/replay": "0.16.0-next.6"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@jest/globals": "29.5.0",
@@ -62,7 +62,7 @@
62
62
  "js-yaml": "4.1.0",
63
63
  "json-schema": "0.4.0",
64
64
  "outdent": "0.8.0",
65
- "path-browserify": "^1.0.1",
65
+ "path-browserify": "1.0.1",
66
66
  "prettier-2": "npm:prettier@2.8.8",
67
67
  "react": "^19.1.0",
68
68
  "react-dom": "^19.1.0",
@@ -71,11 +71,11 @@
71
71
  "shiki": "1.24.4",
72
72
  "styled-components": "5.3.11",
73
73
  "ts-jest": "29.1.2",
74
- "tsx": "^4.20.3",
74
+ "tsx": "4.20.3",
75
75
  "typescript": "5.6.2",
76
76
  "url": "~0.11.0",
77
77
  "vite": "^6.3.5",
78
- "@redocly/theme": "0.57.0-next.4"
78
+ "@redocly/theme": "0.57.0-next.5"
79
79
  },
80
80
  "scripts": {
81
81
  "start": "npm run copy-highlight-hook && vite",