@redocly/openapi-docs 3.13.0-next.6 → 3.13.0-next.8
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.
- package/dist/redocly-openapi-docs.min.js +1449 -1418
- package/lib/components/Discriminator/Discriminator.js +1 -1
- package/lib/components/Download/DownloadSpecification.js +1 -1
- package/lib/components/Replay/Replay.js +1 -1
- package/lib/services/config-options/helpers.d.ts +2 -0
- package/lib/services/config-options/helpers.js +1 -1
- package/lib/services/config-options/normalizeOptions.js +1 -1
- package/lib/utils/loadAndBundleSpec.d.ts +3 -0
- package/package.json +6 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as r,jsxs as l}from"react/jsx-runtime";import{memo as p,useMemo as c}from"react";import{strikethroughText as d}from"../../utils/index.js";import{SchemaSelection as a}from"../common/SchemaSelection/SchemaSelection.js";import{SelectionTitle as f}from"../common/index.js";import{styled as u}from"../../styled-components.js";function x({activeOneOfIdx:t,parent:e,onChange:n,translate:o}){const m=c(()=>(e.oneOf||[]).map((i,s)=>({label:i.schema.deprecated?`${d(i.title)} (${o("openapi.badges.deprecated","deprecated").toLowerCase()}`:i.title,value:s})),[e.oneOf,o]);return e.oneOf===void 0?null:l(h,{children:[r(f,{children:o("openapi.discriminator","Discriminator")}),r(a,{options:m,pointer:e.operationPointer,onChange:n,schema:e,defaultOneOfIdx:t})]})}const y=p(x),h=u.div`
|
|
1
|
+
import{jsx as r,jsxs as l}from"react/jsx-runtime";import{memo as p,useMemo as c}from"react";import{strikethroughText as d}from"../../utils/index.js";import{SchemaSelection as a}from"../common/SchemaSelection/SchemaSelection.js";import{SelectionTitle as f}from"../common/index.js";import{styled as u}from"../../styled-components.js";function x({activeOneOfIdx:t,parent:e,onChange:n,translate:o}){const m=c(()=>(e.oneOf||[]).map((i,s)=>({label:i.schema.deprecated?`${d(i.title)} (${o("openapi.badges.deprecated","deprecated").toLowerCase()})`:i.title,value:s})),[e.oneOf,o]);return e.oneOf===void 0?null:l(h,{children:[r(f,{children:o("openapi.discriminator","Discriminator")}),r(a,{options:m,pointer:e.operationPointer,onChange:n,schema:e,defaultOneOfIdx:t})]})}const y=p(x),h=u.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
align-items: flex-start;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,Fragment as
|
|
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(
|
|
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};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { RedocConfig } from '@redocly/config';
|
|
2
|
+
import type { CodeSamplesConfig } from '../code-samples/index.js';
|
|
2
3
|
export declare function normalizeShowExtensions(value: RedocConfig['showExtensions']): string[] | boolean;
|
|
3
4
|
export declare function normalizeScrollYOffset(value: RedocConfig['scrollYOffset']): () => number;
|
|
5
|
+
export declare function normalizeCodeSamples(value?: RedocConfig['codeSamples']): CodeSamplesConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{querySelector as o}from"../../utils/dom.js";import{isNumeric as
|
|
1
|
+
import{querySelector as o}from"../../utils/dom.js";import{isNumeric as n}from"../../utils/helpers.js";import{Languages as f}from"../code-samples/constants.js";function c(e){if(typeof e>"u")return!1;if(e==="")return!0;if(typeof e!="string")return e;switch(e){case"true":return!0;case"false":return!1;default:return e.split(",").map(t=>t.trim()).filter(Boolean)}}function l(e){if(typeof e=="string"&&!n(e)){const t=o(e);t||console.warn("scrollYOffset value is a selector to non-existing element. Using offset 0 by default");const r=t&&t.getBoundingClientRect().bottom||0;return()=>r}else{if(typeof e=="number"||n(e))return()=>typeof e=="number"?e:parseFloat(e);if(typeof e=="function")return()=>{const t=e();return typeof t!="number"&&console.warn(`scrollYOffset should return number but returned value "${t}" of type ${typeof t}`),t};e!==void 0&&console.warn("Wrong value for scrollYOffset ReDoc option: should be string, number or function")}return()=>0}function m(e){const t=Object.values(f).map(r=>({lang:r}));return typeof e=="object"&&e!==null?{languages:t,...e}:{languages:t}}export{m as normalizeCodeSamples,l as normalizeScrollYOffset,c as normalizeShowExtensions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LayoutVariant as d}from"@redocly/config";import{isUndefined as m,addTrailingSlash as r}from"@redocly/theme/core/openapi";import{WindowReferenceOptions as
|
|
1
|
+
import{LayoutVariant as d}from"@redocly/config";import{isUndefined as m,addTrailingSlash as r}from"@redocly/theme/core/openapi";import{WindowReferenceOptions as n}from"../../constants.js";import{argValueToBoolean as o,argValueToExpandLevel as i,argValueToInt as p,argValueToNumber as c,getWindowReferenceOptions as a,normalizePath as h}from"../../utils/index.js";import{normalizeShowExtensions as u,normalizeScrollYOffset as f,normalizeCodeSamples as S}from"./helpers.js";function y(e,s){e={...s,...e,markdocOptions:{...e?.markdocOptions,components:{...s?.markdocOptions?.components,...e?.markdocOptions?.components},tags:{...s?.markdocOptions?.tags,...e?.markdocOptions?.tags},nodes:{...s?.markdocOptions?.nodes,...e?.markdocOptions?.nodes,heading:s?.markdocOptions?.nodes?.heading||e?.markdocOptions?.nodes.heading}}};const t=Array.isArray(e.ignoreNamedSchemas)?e.ignoreNamedSchemas:e.ignoreNamedSchemas?.split(",").map(l=>l.trim());return{downloadUrls:e.downloadUrls,schemaDefinitionsTagName:e.schemaDefinitionsTagName,corsProxyUrl:e.corsProxyUrl&&r(e.corsProxyUrl),hideSidebar:o(e.hideSidebar,!1),jsonSamplesExpandLevel:i(e.jsonSamplesExpandLevel,2),generatedSamplesMaxDepth:p(e.generatedSamplesMaxDepth,8),hideDownloadButtons:o(e.hideDownloadButtons,!1),hideInfoMetadata:o(e.hideInfoMetadata,!1),hideLoading:o(e.hideLoading,!1),hideSchemaTitles:o(e.hideSchemaTitles,!1),maxDisplayedEnumValues:c(e.maxDisplayedEnumValues),mockServer:e.mockServer?.url?{url:e.mockServer.url,position:e.mockServer.position||"first",description:e.mockServer.description||"Mock server"}:void 0,hideReplay:o(e.hideReplay,!1),oAuth2RedirectURI:e.oAuth2RedirectURI||null,onlyRequiredInSamples:o(e.onlyRequiredInSamples,!1),onDeepLinkClick:e.onDeepLinkClick||a(n.ON_DEEP_LINK_CLICK),routingBasePath:m(e.disableRouter)?"":e.routingBasePath&&h(e.routingBasePath)||"",schemasExpansionLevel:i(e.schemasExpansionLevel),feedback:e.feedback||{hide:!1},sortRequiredPropsFirst:o(e.sortRequiredPropsFirst,!1),scrollYOffset:f(e.scrollYOffset),showExtensions:u(e.showExtensions),sanitize:o(e.sanitize,!1),skipBundle:o(e.skipBundle,!1),ignoreNamedSchemas:new Set(t),markdocOptions:e?.markdocOptions,codeSamples:S(e.codeSamples),layout:e.layout||d.THREE_PANEL,events:e.events||{},unstable_hooks:e.unstable_hooks||a(n.HOOKS)||{},unstable_skipSamples:o(e.unstable_skipSamples,!1),unstable_externalCodeSamples:e.unstable_externalCodeSamples||[],hidePropertiesPrefix:o(e?.hidePropertiesPrefix,!1)}}export{y as normalizeOptions};
|
|
@@ -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.
|
|
3
|
+
"version": "3.13.0-next.8",
|
|
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.
|
|
40
|
-
"@redocly/replay": "0.16.0-next.
|
|
39
|
+
"@redocly/config": "0.29.0",
|
|
40
|
+
"@redocly/replay": "0.16.0-next.7"
|
|
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": "
|
|
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": "
|
|
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.
|
|
78
|
+
"@redocly/theme": "0.57.0-next.6"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"start": "npm run copy-highlight-hook && vite",
|