@redocly/openapi-docs 3.12.0-next.0 → 3.12.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.
- package/dist/redocly-openapi-docs.min.js +7553 -7553
- package/lib/components/ApiInfo/ApiInfo.d.ts +1 -1
- package/lib/components/ApiInfo/ApiInfo.js +1 -1
- package/lib/components/ApiInfo/Metadata.d.ts +1 -1
- package/lib/components/ApiInfo/Metadata.js +1 -1
- package/lib/components/ApiInfo/styled.js +6 -6
- package/lib/components/CallbackSamples/CallbackSamples.d.ts +1 -1
- package/lib/components/CallbackSamples/CallbackSamples.js +1 -1
- package/lib/components/Callbacks/CallbackDetails.d.ts +1 -1
- package/lib/components/Callbacks/CallbackDetails.js +1 -1
- package/lib/components/Callbacks/CallbackSummary.d.ts +2 -1
- package/lib/components/Callbacks/CallbackSummary.js +2 -2
- package/lib/components/Callbacks/styled.js +1 -1
- package/lib/components/Content/useAutoScroll.js +1 -1
- package/lib/components/ContentItem/useIsExpanded.js +1 -1
- package/lib/components/ContentItems/VirtualList.js +1 -1
- package/lib/components/ContentItems/useScrollOnRender.js +1 -1
- package/lib/components/Discriminator/Discriminator.d.ts +1 -1
- package/lib/components/Download/DownloadSpecification.js +2 -2
- package/lib/components/ExpandAllButton/ExpandAllButton.js +2 -2
- package/lib/components/ExternalDocumentation/ExternalDocumentation.js +1 -1
- package/lib/components/Language/LanguageDropdown.js +1 -1
- package/lib/components/Language/LanguageItem.js +1 -1
- package/lib/components/Language/LanguageList.js +1 -1
- package/lib/components/Language/styled.js +9 -9
- package/lib/components/Markdown/Markdown.d.ts +1 -1
- package/lib/components/Markdown/Markdown.js +1 -1
- package/lib/components/Markdown/types.d.ts +11 -2
- package/lib/components/OperationItem/OperationItem.js +3 -3
- package/lib/components/Overview/Overview.d.ts +1 -1
- package/lib/components/Overview/Overview.js +1 -1
- package/lib/components/PageFooter/PageFooter.js +1 -1
- package/lib/components/Panel/ResponsePanel.js +1 -1
- package/lib/components/PanelItem/styled.js +1 -1
- package/lib/components/PayloadSamples/ExampleValue.js +1 -1
- package/lib/components/PayloadSamples/styled.js +1 -1
- package/lib/components/PropertyDetails/Extensions.js +1 -1
- package/lib/components/PropertyDetails/FieldDetails.js +1 -1
- package/lib/components/PropertyDetails/styled.js +1 -1
- package/lib/components/PropertyDetails/types.d.ts +1 -1
- package/lib/components/RedoclyOpenAPIDocs/Providers.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/types.d.ts +2 -2
- package/lib/components/Replay/EmbeddedReplay.d.ts +2 -1
- package/lib/components/Replay/EmbeddedReplay.js +3 -3
- package/lib/components/Replay/Replay.js +1 -1
- package/lib/components/Replay/utils.d.ts +4 -2
- package/lib/components/Replay/utils.js +1 -1
- package/lib/components/Request/types.d.ts +1 -1
- package/lib/components/RequestParameters/ParametersGroup.js +1 -1
- package/lib/components/RequestSamples/CodeSample.js +1 -1
- package/lib/components/RequestSamples/RequestSamples.js +1 -1
- package/lib/components/ResponseSamples/Summary.js +1 -1
- package/lib/components/RightPanel/RightPanel.js +1 -1
- package/lib/components/Schema/helpers.js +1 -1
- package/lib/components/SchemaDefinition/SchemaDefinition.js +1 -1
- package/lib/components/SectionContent/SectionContent.js +5 -5
- package/lib/components/SectionItem/SectionItem.d.ts +1 -1
- package/lib/components/SectionItem/SectionItem.js +1 -1
- package/lib/components/Security/OAuthScopes.js +1 -1
- package/lib/components/Security/Security.js +1 -1
- package/lib/components/Security/SecurityButton.js +2 -2
- package/lib/components/Security/SecurityModal.js +5 -5
- package/lib/components/ServerList/ServerList.js +1 -1
- package/lib/components/ServerList/types.d.ts +1 -1
- package/lib/components/ServerListDropdown/ServerListDropdown.js +1 -1
- package/lib/components/ServerListDropdown/styled.js +6 -6
- package/lib/components/SideMenu/SideMenu.js +1 -1
- package/lib/components/SideMenu/hooks/useMenuItems.js +1 -1
- package/lib/components/StickySidebar/SidebarActions.js +2 -2
- package/lib/components/StickySidebar/StickyResponsiveSidebar.js +3 -3
- package/lib/components/Tabs/Tabs.js +1 -1
- package/lib/components/Tabs/useTabsState.js +1 -1
- package/lib/components/TagItem/OperationNavigationItems.d.ts +1 -1
- package/lib/components/TagItem/OperationsNavigation.js +1 -1
- package/lib/components/TagItem/TagItem.js +7 -7
- package/lib/components/TagItem/styled.js +1 -1
- package/lib/components/ViewNested/ViewNested.js +1 -1
- package/lib/components/common/Badges.js +1 -1
- package/lib/components/common/BodyContent/BodyContent.js +1 -1
- package/lib/components/common/CodeBlockPanel.js +3 -3
- package/lib/components/common/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/common/Dropdown/Dropdown.js +4 -4
- package/lib/components/common/ExpandableExample/ExpandableExample.js +1 -1
- package/lib/components/common/Extensions.js +1 -1
- package/lib/components/common/Fields/fields-layout.js +1 -1
- package/lib/components/common/Fields/fields.js +1 -1
- package/lib/components/common/LinkToField.js +1 -1
- package/lib/components/common/OperationItemTitle.js +3 -3
- package/lib/components/common/SchemaSelection/SchemaSelection.d.ts +1 -1
- package/lib/components/common/SchemaSelection/SchemaSelection.js +1 -1
- package/lib/components/common/Select/styled.js +1 -1
- package/lib/components/common/Skeleton/Skeleton.js +1 -1
- package/lib/components/common/linkify.js +1 -1
- package/lib/components/common/panels.js +5 -5
- package/lib/components/common/styled.js +1 -1
- package/lib/hoc/types.d.ts +1 -1
- package/lib/hoc/withRouter.js +1 -1
- package/lib/hooks/usePerformanceMetrics.js +1 -1
- package/lib/hooks/useTelemetry.d.ts +1 -1
- package/lib/hooks/useTelemetry.js +1 -1
- package/lib/hooks/useTranslate.d.ts +1 -1
- package/lib/hooks/useTranslate.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/lib/jotai/app.d.ts +2 -2
- package/lib/jotai/app.js +1 -1
- package/lib/jotai/operation.d.ts +2 -2
- package/lib/jotai/operation.js +1 -1
- package/lib/models/callback.d.ts +1 -1
- package/lib/models/mediaType.js +1 -1
- package/lib/models/operation.d.ts +1 -1
- package/lib/models/operation.js +1 -1
- package/lib/models/schema.js +2 -2
- package/lib/services/OpenAPIParser.js +1 -1
- package/lib/services/code-samples/generator.d.ts +4 -1
- package/lib/services/code-samples/generator.js +1 -1
- package/lib/services/code-samples/httpsnippet/index.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/csharp/httpclient.js +1 -1
- package/lib/services/config-options/normalizeOptions.js +1 -1
- package/lib/services/config-options/types.d.ts +3 -11
- package/lib/services/menu/markdown.js +1 -1
- package/lib/services/utils.js +1 -1
- package/lib/types/open-api.d.ts +3 -1
- package/lib/utils/configure-helpers.d.ts +1 -1
- package/lib/utils/configure-helpers.js +1 -1
- package/lib/utils/helpers.js +2 -2
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -1
- package/lib/utils/loadAndBundleSpec.js +1 -1
- package/lib/utils/local-storage.js +1 -1
- package/lib/utils/openapi.js +1 -1
- package/lib/utils/saveTextBeforeHeading.js +1 -1
- package/lib/utils/security-details.js +1 -1
- package/lib/utils/session-storage.js +1 -1
- package/lib/utils/telemetry.d.ts +1 -0
- package/lib/utils/telemetry.js +1 -0
- package/package.json +7 -7
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
import type { ComponentType } from 'react';
|
|
2
|
-
import type { Schema, ConfigFunction } from '@markdoc/markdoc/dist/src/types';
|
|
3
1
|
import type { CodeSamplesConfig } from '../code-samples/index.js';
|
|
4
2
|
import type { HooksConfig, Unstable_ExternalCodeSample } from '../types.js';
|
|
5
3
|
import type { Events } from '../../events/index.js';
|
|
6
|
-
import type { LayoutVariant } from '@redocly/
|
|
4
|
+
import type { LayoutVariant } from '@redocly/config';
|
|
7
5
|
import type { OperationModel } from '../../models/types.js';
|
|
8
6
|
import type { DownloadUrlsConfig } from '../../components/Download/types.js';
|
|
7
|
+
import type { MarkdocOptions } from '../../components/Markdown/types.js';
|
|
9
8
|
export interface Options {
|
|
10
9
|
scrollYOffset: () => number;
|
|
11
10
|
hideLoading: boolean;
|
|
12
|
-
markdocOptions?:
|
|
13
|
-
tags: Record<string, Schema>;
|
|
14
|
-
nodes: Record<string, Schema>;
|
|
15
|
-
components: Record<string, ComponentType>;
|
|
16
|
-
variables?: Record<string, any>;
|
|
17
|
-
partials?: Record<string, any>;
|
|
18
|
-
functions?: Record<string, ConfigFunction>;
|
|
19
|
-
};
|
|
11
|
+
markdocOptions?: MarkdocOptions;
|
|
20
12
|
hideSidebar: boolean;
|
|
21
13
|
feedback: Record<string, any>;
|
|
22
14
|
unstable_hooks: HooksConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import y from"@markdoc/markdoc";import{isString as A}from"@redocly/theme";import{getTagOrGroup as S}from"../../models/index.js";import{safeSlugify as h,unescapeHTMLChars as T}from"../../utils/index.js";import{simplifyAstStructure as d}from"../../utils/simplifyAstStructure.js";function O(e,u,f){const i=A(e)?d(y.parse(e)):y.Ast.fromJSON(JSON.stringify(e?.result)),s=[];let o;const l=(t,n,g=s,r,p)=>{t=T(t);let a;r.attributes.id?a=r.attributes.id:(a=p?`${p}/${h(t)}`:`section/${h(t)}`,r.attributes.id=a);const b={id:a.toLowerCase(),name:t,level:n,items:[],ast:[r]};return g.push(b),b},c=(t,n)=>{t[t.length-1]?.ast?.push(n)},m=t=>{const n=C(t)||"",r=u&&u.type==="tag"?u.id:void 0;t.type==="heading"&&t.attributes.level===1?o=l(n,t.attributes.level,void 0,t,r):t.attributes.level?l(n,t.attributes.level,o?.items,t,o?.id??r):o?.items?.length?c(o?.items,t):s?.length&&c(s,t)};if(Array.isArray(i))for(const t of i)m(t);else m(i);return v(u,s,f)}function v(e,u,f=1){return u.map(i=>{const s=S("section",i,e);return s.depth=f,i.items&&(s.items=v(s,i.items,f+1)),s})}function C(e){if(typeof e?.attributes?.content=="string")return e.attributes?.content;if(e?.children)return C(e.children[0])}export{O as addMarkdownItems};
|
|
1
|
+
import y from"@markdoc/markdoc";import{isString as A}from"@redocly/theme/core/openapi";import{getTagOrGroup as S}from"../../models/index.js";import{safeSlugify as h,unescapeHTMLChars as T}from"../../utils/index.js";import{simplifyAstStructure as d}from"../../utils/simplifyAstStructure.js";function O(e,u,f){const i=A(e)?d(y.parse(e)):y.Ast.fromJSON(JSON.stringify(e?.result)),s=[];let o;const l=(t,n,g=s,r,p)=>{t=T(t);let a;r.attributes.id?a=r.attributes.id:(a=p?`${p}/${h(t)}`:`section/${h(t)}`,r.attributes.id=a);const b={id:a.toLowerCase(),name:t,level:n,items:[],ast:[r]};return g.push(b),b},c=(t,n)=>{t[t.length-1]?.ast?.push(n)},m=t=>{const n=C(t)||"",r=u&&u.type==="tag"?u.id:void 0;t.type==="heading"&&t.attributes.level===1?o=l(n,t.attributes.level,void 0,t,r):t.attributes.level?l(n,t.attributes.level,o?.items,t,o?.id??r):o?.items?.length?c(o?.items,t):s?.length&&c(s,t)};if(Array.isArray(i))for(const t of i)m(t);else m(i);return v(u,s,f)}function v(e,u,f=1){return u.map(i=>{const s=S("section",i,e);return s.depth=f,i.items&&(s.items=v(s,i.items,f+1)),s})}function C(e){if(typeof e?.attributes?.content=="string")return e.attributes?.content;if(e?.children)return C(e.children[0])}export{O as addMarkdownItems};
|
package/lib/services/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import c from"deepmerge";import{isObject as i}from"@redocly/theme";import{isMergeableObject as u}from"../utils/index.js";function b(e,r){return!e||!r?!1:s(e)===s(r)}function s(e){if(!e)return;const r=e.split(";")[0].toLowerCase(),[t,n]=r.split("/");if(n===void 0)return t;const p=n.split("+").pop();return`${t}/${p}`}function m(e){const r=new RegExp("%7B","g"),t=new RegExp("%7D","g");return e.replace(r,"{").replace(t,"}").replace("///","//").replace("./",".")}function a(e,r){if(!(e.length&&f(e)))return r;const t=e.filter(n=>Object.keys(n).length>0);return r.forEach(function(n,o){u(n)?t[o]=c(e[o],n,{arrayMerge:a}):Array.isArray(n)?t.push(n):t[o]=n}),t}const f=e=>e.some(r=>i(r)&&Object.keys(r).length>0);function w(e){return!!e&&Object.keys(e).length===0}const x=typeof window<"u"&&(window.crypto||window.msCrypto)||void 0;function l(e){if(typeof e!="object"||e===null)return e;const r=Array.isArray(e)?[]:{};for(const t in e){const n=e[t];r[t]=l(n)}return r}export{a as arrayMergeStrategy,x as cryptoLib,l as deepClone,w as isEmptyObject,b as isSameMime,s as normalizeMimeType,m as unescapeServerVariables};
|
|
1
|
+
import c from"deepmerge";import{isObject as i}from"@redocly/theme/core/openapi";import{isMergeableObject as u}from"../utils/index.js";function b(e,r){return!e||!r?!1:s(e)===s(r)}function s(e){if(!e)return;const r=e.split(";")[0].toLowerCase(),[t,n]=r.split("/");if(n===void 0)return t;const p=n.split("+").pop();return`${t}/${p}`}function m(e){const r=new RegExp("%7B","g"),t=new RegExp("%7D","g");return e.replace(r,"{").replace(t,"}").replace("///","//").replace("./",".")}function a(e,r){if(!(e.length&&f(e)))return r;const t=e.filter(n=>Object.keys(n).length>0);return r.forEach(function(n,o){u(n)?t[o]=c(e[o],n,{arrayMerge:a}):Array.isArray(n)?t.push(n):t[o]=n}),t}const f=e=>e.some(r=>i(r)&&Object.keys(r).length>0);function w(e){return!!e&&Object.keys(e).length===0}const x=typeof window<"u"&&(window.crypto||window.msCrypto)||void 0;function l(e){if(typeof e!="object"||e===null)return e;const r=Array.isArray(e)?[]:{};for(const t in e){const n=e[t];r[t]=l(n)}return r}export{a as arrayMergeStrategy,x as cryptoLib,l as deepClone,w as isEmptyObject,b as isSameMime,s as normalizeMimeType,m as unescapeServerVariables};
|
package/lib/types/open-api.d.ts
CHANGED
|
@@ -222,9 +222,10 @@ export interface OpenAPIEncoding {
|
|
|
222
222
|
export type OpenAPIParameterLocation = 'query' | 'header' | 'path' | 'cookie';
|
|
223
223
|
export type OpenAPIParameterStyle = 'matrix' | 'label' | 'form' | 'simple' | 'spaceDelimited' | 'pipeDelimited' | 'deepObject';
|
|
224
224
|
export interface OpenAPIRequestBody extends ParsedDescription {
|
|
225
|
+
$ref?: string;
|
|
225
226
|
description?: string;
|
|
226
227
|
required?: boolean;
|
|
227
|
-
content
|
|
228
|
+
content?: {
|
|
228
229
|
[mime: string]: OpenAPIMediaType;
|
|
229
230
|
};
|
|
230
231
|
'x-examples'?: {
|
|
@@ -250,6 +251,7 @@ export interface OpenAPIResponse extends ParsedDescription {
|
|
|
250
251
|
links?: {
|
|
251
252
|
[name: string]: Referenced<OpenAPILink>;
|
|
252
253
|
};
|
|
254
|
+
$ref?: string;
|
|
253
255
|
'x-examples'?: {
|
|
254
256
|
[mime: string]: {
|
|
255
257
|
[name: string]: Referenced<OpenAPIExample>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OperationModel, SecurityCredentials, FieldModel } from '../models/types.js';
|
|
2
|
-
import type { ConfigureRequestValues, ConfigureServerRequestValues, SecurityDetails } from '@redocly/theme';
|
|
2
|
+
import type { ConfigureRequestValues, ConfigureServerRequestValues, SecurityDetails } from '@redocly/theme/ext/configure';
|
|
3
3
|
export declare function updateOperationWithRequestValues(operation: OperationModel, userDefinedRequestValues: ConfigureRequestValues | ConfigureServerRequestValues): void;
|
|
4
4
|
export declare function updateParametersWithUserValues(param: FieldModel, userDefinedRequestValues?: ConfigureRequestValues | ConfigureServerRequestValues): void;
|
|
5
5
|
export declare function updateRequestBodyWithUserValues(operation: OperationModel, userDefinedRequestValues: ConfigureRequestValues, serverUrl?: string): OperationModel | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isObject as p}from"@redocly/theme";function v(e,t){Object.keys(t).length!==0&&(d(t)?(b(e,t),h(e,t.security),y(e,t.envVariables)):x(e,t))}function j(e,t){if(!t)return;const{in:r,name:s}=e;if(d(t)){const c=t,n={header:c.headers,query:c.query,path:c.path,cookie:c.cookie};r&&n[r]?.[s]&&(e.example=n[r][s])}else Object.entries(t).forEach(([c,n])=>{const f=n;if(!f)return;const o={header:f.headers,query:f.query,path:f.path,cookie:f.cookie};r&&o[r]?.[s]&&(e.serverValues||(e.serverValues={}),e.serverValues[c]={example:o[r][s]})})}function b(e,t,r){if(!e.requestBody||!t?.body)return;const s=e.requestBody.content;if(!s?.mediaTypes)return;const c=(n,f)=>{n[f]&&Object.keys(n[f]).forEach(o=>{const i=n[f]?.[o]?.value;let a;if(p(i)?a=l(i,t.body):a=t.body,!!a)if(r){const u=n[f][o];u.serverValues||(u.serverValues={}),u.serverValues[r]={value:a,rawValue:a},n[f][o]={...u,mime:n.name}}else n[f][o]={value:a,rawValue:a,mime:n.name}})};for(const n of s.mediaTypes)c(n,"examples"),c(n,"formExamples");return e}function h(e,t,r){!t||!e.security.length||e.security.forEach(s=>{r?s.schemes.forEach(c=>{c.serverValues||(c.serverValues={});const n=k(c,t);c.serverValues[r]=n}):s.schemes.forEach(c=>{const n=k(c,t);Object.assign(c,n)})})}function x(e,t){e.servers.forEach(r=>{if(t[r.url]){const s=t[r.url];s&&(b(e,s,r.url),h(e,s.security,r.url),y(e,s.envVariables,r.url))}})}function y(e,t,r){!t||Object.keys(t).length===0||(e.envVariables||(e.envVariables={}),r?(e.envVariables.serverValues||(e.envVariables.serverValues={}),e.envVariables.serverValues[r]={...e.envVariables.serverValues[r],...t}):e.envVariables.values={...e.envVariables.values,...t})}function d(e){return!e||typeof e!="object"?!1:"headers"in e||"body"in e||"query"in e||"path"in e||"cookie"in e||"security"in e||"envVariables"in e}function l(e,t){if(!e||typeof e!="object")return t;if(Array.isArray(e)&&Array.isArray(t)){if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){const s=Object.keys(e[0]),c=t.filter(n=>typeof n!="object"||n===null?!1:s.some(f=>f in n)&&Object.keys(n).every(f=>s.includes(f)));return c.length>0?c:e}return t}const r=Array.isArray(e)?[...e]:{...e};for(const[s,c]of Object.entries(t))s in e&&(Array.isArray(e[s])||typeof c=="object"&&c!==null&&typeof e[s]=="object"?r[s]=l(e[s],c):r[s]=c);return r}function k(e,t){const r={"x-defaultAccessToken":t.token?.access_token,"x-defaultTokenType":t.token?.token_type||"Bearer","x-defaultClientId":t.client_id,"x-defaultClientSecret":t.client_secret,scopes:t.scopes||e.scopes};return e.type==="http"&&e.scheme==="basic"?(r["x-defaultUsername"]=t.username,r["x-defaultPassword"]=t.password,delete r["x-defaultAccessToken"],delete r["x-defaultTokenType"]):e.type==="oauth2"&&!t.token?.access_token&&(delete r["x-defaultAccessToken"],delete r["x-defaultTokenType"]),r}export{k as createSecurityUpdates,d as isDirectRequestValues,y as updateEnvVariablesWithUserValues,l as updateObjectProperties,v as updateOperationWithRequestValues,x as updateOperationWithServerUserValues,j as updateParametersWithUserValues,b as updateRequestBodyWithUserValues,h as updateSecurityWithUserValues};
|
|
1
|
+
import{isObject as p}from"@redocly/theme/core/openapi";function v(e,t){Object.keys(t).length!==0&&(d(t)?(b(e,t),h(e,t.security),y(e,t.envVariables)):x(e,t))}function j(e,t){if(!t)return;const{in:r,name:s}=e;if(d(t)){const c=t,n={header:c.headers,query:c.query,path:c.path,cookie:c.cookie};r&&n[r]?.[s]&&(e.example=n[r][s])}else Object.entries(t).forEach(([c,n])=>{const f=n;if(!f)return;const o={header:f.headers,query:f.query,path:f.path,cookie:f.cookie};r&&o[r]?.[s]&&(e.serverValues||(e.serverValues={}),e.serverValues[c]={example:o[r][s]})})}function b(e,t,r){if(!e.requestBody||!t?.body)return;const s=e.requestBody.content;if(!s?.mediaTypes)return;const c=(n,f)=>{n[f]&&Object.keys(n[f]).forEach(o=>{const i=n[f]?.[o]?.value;let a;if(p(i)?a=l(i,t.body):a=t.body,!!a)if(r){const u=n[f][o];u.serverValues||(u.serverValues={}),u.serverValues[r]={value:a,rawValue:a},n[f][o]={...u,mime:n.name}}else n[f][o]={value:a,rawValue:a,mime:n.name}})};for(const n of s.mediaTypes)c(n,"examples"),c(n,"formExamples");return e}function h(e,t,r){!t||!e.security.length||e.security.forEach(s=>{r?s.schemes.forEach(c=>{c.serverValues||(c.serverValues={});const n=k(c,t);c.serverValues[r]=n}):s.schemes.forEach(c=>{const n=k(c,t);Object.assign(c,n)})})}function x(e,t){e.servers.forEach(r=>{if(t[r.url]){const s=t[r.url];s&&(b(e,s,r.url),h(e,s.security,r.url),y(e,s.envVariables,r.url))}})}function y(e,t,r){!t||Object.keys(t).length===0||(e.envVariables||(e.envVariables={}),r?(e.envVariables.serverValues||(e.envVariables.serverValues={}),e.envVariables.serverValues[r]={...e.envVariables.serverValues[r],...t}):e.envVariables.values={...e.envVariables.values,...t})}function d(e){return!e||typeof e!="object"?!1:"headers"in e||"body"in e||"query"in e||"path"in e||"cookie"in e||"security"in e||"envVariables"in e}function l(e,t){if(!e||typeof e!="object")return t;if(Array.isArray(e)&&Array.isArray(t)){if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){const s=Object.keys(e[0]),c=t.filter(n=>typeof n!="object"||n===null?!1:s.some(f=>f in n)&&Object.keys(n).every(f=>s.includes(f)));return c.length>0?c:e}return t}const r=Array.isArray(e)?[...e]:{...e};for(const[s,c]of Object.entries(t))s in e&&(Array.isArray(e[s])||typeof c=="object"&&c!==null&&typeof e[s]=="object"?r[s]=l(e[s],c):r[s]=c);return r}function k(e,t){const r={"x-defaultAccessToken":t.token?.access_token,"x-defaultTokenType":t.token?.token_type||"Bearer","x-defaultClientId":t.client_id,"x-defaultClientSecret":t.client_secret,scopes:t.scopes||e.scopes};return e.type==="http"&&e.scheme==="basic"?(r["x-defaultUsername"]=t.username,r["x-defaultPassword"]=t.password,delete r["x-defaultAccessToken"],delete r["x-defaultTokenType"]):e.type==="oauth2"&&!t.token?.access_token&&(delete r["x-defaultAccessToken"],delete r["x-defaultTokenType"]),r}export{k as createSecurityUpdates,d as isDirectRequestValues,y as updateEnvVariablesWithUserValues,l as updateObjectProperties,v as updateOperationWithRequestValues,x as updateOperationWithServerUserValues,j as updateParametersWithUserValues,b as updateRequestBodyWithUserValues,h as updateSecurityWithUserValues};
|
package/lib/utils/helpers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{isObject as i,isString as a,IS_BROWSER as u}from"@redocly/theme/core/openapi";import{isNamedDefinition as f}from"./openapi.js";import{JsonPointer as l}from"./JsonPointer.js";import{urlParse as c}from"./url.js";function w(r,e){const t=[];for(let n=0;n<r.length-1;n++)t.push(e(r[n],!1));return r.length!==0&&t.push(e(r[r.length-1],!0)),t}function O(r,e){const t={};for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=e(r[n],n,r));return t}function y(r,e){const t=[],n=o=>{for(const s of o)t.push(s),s[e]&&n(s[e])};return n(r),t}function p(r){return r.endsWith("/")?r.substring(0,r.length-1):r}function A(r){return!isNaN(parseFloat(r))&&isFinite(r)}function b(r,e,t){const n=new RegExp(`(^|\\n)#\\s?${e}\\s*\\n`,"i"),o=new RegExp(`((\\n|^)#\\s*${e}\\s*(\\n|$)(?:.|\\n)*?)(\\n#|$)`,"i");if(n.test(r))return r.replace(o,`$1
|
|
2
2
|
|
|
3
3
|
${t}
|
|
4
4
|
$4`);{const s=r===""||r.endsWith(`
|
|
@@ -9,4 +9,4 @@ $4`);{const s=r===""||r.endsWith(`
|
|
|
9
9
|
|
|
10
10
|
`;return`${r}${s}# ${e}
|
|
11
11
|
|
|
12
|
-
${t}`}}const E=r=>Array.isArray(r)&&r.some(e=>
|
|
12
|
+
${t}`}}const E=r=>Array.isArray(r)&&r.some(e=>i(e)),R=r=>r.filter(e=>!!e),W=r=>i(r)&&!Array.isArray(r);function d(r){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(r)}function C(r,e){let t;if(e.startsWith("//"))t=`${c(r,!0)?.protocol||"https:"}${e}`;else if(d(e))t=e;else if(!e.startsWith("/"))t=p(r)+"/"+e;else{const n=c(r);n?(n.pathname=e,t=n.toString()):t=e}return p(t)}function I(r){return r.charAt(0).toUpperCase()+r.slice(1)}function L(r){try{if(!r)return"";const e=new URL(r);return e.search="",e.hash="",e.toString()}catch{return r}}function M(r){return r.replace(/["\\]/g,"\\$&")}function N(r){return r.replace(/&#(\d+);/g,(e,t)=>String.fromCharCode(parseInt(t,10))).replace(/&/g,"&").replace(/"/g,'"')}function P(r){return r&&r.replace(/#/g,"_").toLowerCase()}function T(r,e){return e||f(r)&&l.baseName(r)||""}function j(r={},e,t){return typeof e=="string"&&(e=e.split(".")),e.reduce((n,o)=>n&&n[o]?n[o]:t,r)}function x(r){return(...e)=>e.filter(Boolean).join(r)}const z=x(".");function D(r){return u?window?.REFERENCE_DOCS_OPTIONS?.[r]:null}function F(){if(!u)return"";const r=+new Date+Math.random();try{return(!document.currentScript||!(document.currentScript.async||document.currentScript.defer))&&document.write(`<script id="dummy${r}"></script>`),(document.getElementById("dummy"+r)?.previousSibling).src}catch{return""}}const _=r=>a(r)?r:r?.raw,B=(r,e)=>{const t=r?.[`x-parsed-md-${e}`]||r?.[e];if(!t)return;if(!r?.[`x-parsed-md-${e}`]&&e!=="x-enumDescriptions")return r?.[e];if(e!=="x-enumDescriptions")return g(r,e);let n={};for(const o in t)o.startsWith("x-parsed-md")||(n[o]=t?.[`x-parsed-md-${o}`]||t?.[o]);return Object.keys(n).length?n:t};function g(r,e){const t=r?.[`x-parsed-md-${e}`]||r?.[e];return t?.raw?t:{result:t?.result||r?.[e]?.result||r?.[e],raw:r?.[e]}}function H(r,e){return e===r.length-1}function U(r,e){const t=Object.keys(r);return t.indexOf(e)===t.length-1}export{b as appendToMdHeading,R as deleteEmptyArrayItem,z as dottedString,M as escapeHTMLAttrChars,y as flattenByProp,j as get,F as getJsUrl,B as getValueFromMdParsedExtension,D as getWindowReferenceOptions,d as isAbsoluteUrl,E as isArrayOfObjects,H as isLastInArray,U as isLastProperty,W as isMergeableObject,A as isNumeric,x as joinStringFactory,O as mapValues,w as mapWithLast,_ as normalizeText,L as removeQueryStringAndHash,C as resolveUrl,P as sanitizeItemId,p as stripTrailingSlash,I as titleize,N as unescapeHTMLChars,T as useSchemaTitle};
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./JsonPointer.js";export*from"./openapi.js";export*from"./helpers.js";export*from"./dom.js";export*from"./debug.js";export*from"./sort.js";export*from"./argValuesHelpers.js";export*from"./theme-helpers.js";export*from"./debounce.js";export*from"./security-details.js";export*from"./session-storage.js";export*from"./local-storage.js";export*from"./parameters.js";export*from"./string.js";export*from"./test-utils.js";export*from"./compose.js";export*from"./saveTextBeforeHeading.js";export*from"./path.js";export*from"./queryString.js";export*from"./isMobile.js";export*from"./replaceVariables.js";export*from"./areArraysEqual.js";export*from"./configure-helpers.js";
|
|
1
|
+
export*from"./JsonPointer.js";export*from"./openapi.js";export*from"./helpers.js";export*from"./dom.js";export*from"./debug.js";export*from"./sort.js";export*from"./argValuesHelpers.js";export*from"./theme-helpers.js";export*from"./debounce.js";export*from"./security-details.js";export*from"./session-storage.js";export*from"./local-storage.js";export*from"./parameters.js";export*from"./string.js";export*from"./test-utils.js";export*from"./compose.js";export*from"./saveTextBeforeHeading.js";export*from"./path.js";export*from"./queryString.js";export*from"./isMobile.js";export*from"./replaceVariables.js";export*from"./areArraysEqual.js";export*from"./configure-helpers.js";export*from"./telemetry.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bundle as s,Config as f}from"@redocly/openapi-core";import{IS_BROWSER as i}from"@redocly/theme";import{convertSwagger2OpenAPI as r}from"./convertSwagger2OpenAPI.js";async function l(e){const t=new f({}),o={config:t,base:i?window.location.href:typeof globalThis.process<"u"?globalThis.process.cwd():""};i&&(t.resolve.http.customFetch=globalThis.fetch),typeof e=="object"&&e!==null?o.doc=a(e):o.ref=e;const{bundle:{parsed:n}}=await s(o);return n.swagger!==void 0?r(n):n}function a(e){return{source:{absoluteRef:""},parsed:e}}export{l as loadAndBundleDefinition};
|
|
1
|
+
import{bundle as s,Config as f}from"@redocly/openapi-core";import{IS_BROWSER as i}from"@redocly/theme/core/openapi";import{convertSwagger2OpenAPI as r}from"./convertSwagger2OpenAPI.js";async function l(e){const t=new f({}),o={config:t,base:i?window.location.href:typeof globalThis.process<"u"?globalThis.process.cwd():""};i&&(t.resolve.http.customFetch=globalThis.fetch),typeof e=="object"&&e!==null?o.doc=a(e):o.ref=e;const{bundle:{parsed:n}}=await s(o);return n.swagger!==void 0?r(n):n}function a(e){return{source:{absoluteRef:""},parsed:e}}export{l as loadAndBundleDefinition};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IS_BROWSER as t}from"@redocly/theme";function a(o,r){t&&window.localStorage.setItem("redoc."+o,r)}function c(o){return t&&window.localStorage.getItem("redoc."+o)||""}export{c as fromLocalStorage,a as toLocalStorage};
|
|
1
|
+
import{IS_BROWSER as t}from"@redocly/theme/core/openapi";function a(o,r){t&&window.localStorage.setItem("redoc."+o,r)}function c(o){return t&&window.localStorage.getItem("redoc."+o)||""}export{c as fromLocalStorage,a as toLocalStorage};
|
package/lib/utils/openapi.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dirname as y}from"path";import f from"url-template";import{IS_BROWSER as M}from"@redocly/theme";import{deleteEmptyArrayItem as E,isArrayOfObjects as T,isNumeric as S,removeQueryStringAndHash as z,resolveUrl as D,sanitizeItemId as m,normalizeText as b,getValueFromMdParsedExtension as g,isAbsoluteUrl as N}from"./helpers.js";import{DEFAULT_TAG_SLUG as R,MediaTypes as j}from"../constants.js";import{JsonPointer as $}from"./JsonPointer.js";import{joinWithSeparator as _}from"../services/index.js";import{tryDecodeURIComponent as F}from"./string.js";import{getUrlDirname as U}from"./url.js";function P(e){return typeof e=="string"&&/\dxx/i.test(e)}function ne(e){return e==="default"||S(e)||P(e)}function ie(e,r=!1){if(e==="default")return r?"error":"success";let t=typeof e=="string"?parseInt(e,10):e;if(P(e)&&(t*=100),t<100||t>599)throw new Error("invalid HTTP code");let n="success";return t>=300&&t<400?n="redirect":t>=400?n="error":t<200&&(n="info"),n}const L={get:!0,post:!0,put:!0,head:!0,patch:!0,delete:!0,options:!0,$ref:!0};function oe(e){return e in L}function ue(e){const{operationId:r,pathName:t}=e,n=b(g(e,"description"));return b(g(e,"summary"))||r||n&&n.substring(0,50)||t||"<no summary>"}function se(e,r){return r?.id?_(r.id,m(e.operationId?e.operationId:d(e.pointer))).toLowerCase():e.tags?.length?m(e.operationId?e.operationId:d(e.pointer)):m(e.operationId?_(R,e.operationId):d(e.pointer))}function d(e){return e?.startsWith("/")?e.slice(1,e.length):e}const h={multipleOf:"number",maximum:"number",exclusiveMaximum:"number",minimum:"number",exclusiveMinimum:"number",maxLength:"string",minLength:"string",pattern:"string",contentEncoding:"string",contentMediaType:"string",items:"array",maxItems:"array",minItems:"array",uniqueItems:"array",maxProperties:"object",minProperties:"object",required:"object",additionalProperties:"object",unevaluatedProperties:"object",patternProperties:"object",properties:"object"};function ae(e){if(e.type!==void 0&&!Array.isArray(e.type))return e.type;const r=Object.keys(h);for(const t of r){const n=h[t];if(e[t]!==void 0)return n}return"any"}function k(e,r=e.type){if(e["x-circular-ref"]||e["x-complex"])return!0;if(e.oneOf!==void 0||e.anyOf!==void 0||e.if&&e.then||e.if&&e.else)return!1;let t=!0;const n=Array.isArray(r);return(r==="object"||n&&r?.includes("object"))&&(t=e.properties!==void 0?Object.keys(e.properties).length===0:e.additionalProperties===void 0&&e.unevaluatedProperties===void 0&&e.patternProperties===void 0),Array.isArray(e.items)||Array.isArray(e.prefixItems)?!1:(e.items!==void 0&&typeof e.items!="boolean"&&(r==="array"||n&&r?.includes("array"))&&(t=k(e.items,e.items.type)),t)}function q(e){return e.search(/json/i)!==-1}function ce(e){return e?.search(/xml/i)!==-1}function pe(e){return e===j.URL_ENCODED}function fe(e){return e===j.MULTIPART}function c(e,r,t){return Array.isArray(e)?e.map(n=>n.toString()).join(t):typeof e=="object"?Object.keys(e).map(n=>`${n}${t}${e[n]}`).join(t):r+"="+e.toString()}function w(e,r){return Array.isArray(e)?(console.warn("deepObject style cannot be used with array value:"+e.toString()),""):typeof e=="object"?Object.keys(e).map(t=>e[t]?`${r}[${t}]=${e[t]}`:void 0).filter(Boolean).join("&"):(console.warn("deepObject style cannot be used with non-object value:"+e.toString()),"")}function a(e,r,t){const n="__redoc_param_name__",i=r?"*":"";return f.parse(`{?${n}${i}}`).expand({[n]:t}).substring(1).replace(/__redoc_param_name__/g,e)}function O(e,r){const t=e?"*":"",n="__redoc_param_name__",i=f.parse(`{${n}${t}}`);return F(i.expand({[n]:r}))}function me(e,r={}){if(Array.isArray(e))throw new Error("Payload must have fields: "+e.toString());return Object.keys(e).map(t=>{const n=e[t],{style:i="form",explode:o=!0}=r[t]||{};switch(i){case"form":return a(t,o,n);case"spaceDelimited":return c(n,t,"%20");case"pipeDelimited":return c(n,t,"|");case"deepObject":return w(n,t);default:return console.warn("Incorrect or unsupported encoding style: "+i),""}}).join("&")}function W(e,r,t,n){const i=t?"*":"";let o="";r==="label"?o=".":r==="matrix"&&(o=";");const s="__redoc_param_name__";return f.parse(`{${o}${s}${i}}`).expand({[s]:n}).replace(/__redoc_param_name__/g,e)}function H(e,r,t,n){const i=o=>{switch(r){case"form":return a(e,t,o);case"spaceDelimited":return!Array.isArray(o)&&typeof o!="object"?(console.warn("The style spaceDelimited is applicable to arrays or objects"),""):t?a(e,t,o):c(n,e,"%20");case"pipeDelimited":return!Array.isArray(o)&&typeof o!="object"?(console.warn("The style pipeDelimited is applicable to arrays or objects"),""):t?a(e,t,o):c(n,e,"|");case"deepObject":return!t||Array.isArray(o)||typeof o!="object"?(console.warn("The style deepObject is only applicable for objects with explode=true"),""):w(o,e);case"simple":return O(t,n);default:return console.warn("Unexpected style for query: "+r),""}};return T(n)&&(n=E(n).map(o=>i(o))),i(n)}function C(e,r,t){switch(e){case"simple":return O(r,t);default:return console.warn("Unexpected style for header: "+e),""}}function B(e,r,t,n){switch(r){case"form":return a(e,t,n);default:return console.warn("Unexpected style for cookie: "+r),""}}function A(e,r){return q(r)?JSON.stringify(e):(console.warn(`Parameter serialization as ${r} is not supported`),"")}function de(e,r){const{name:t,style:n,explode:i=!1,serializationMime:o}=e;if(o)switch(e.in){case"path":case"header":return A(r,o);case"cookie":case"query":return`${t}=${A(r,o)}`;default:return console.warn("Unexpected parameter location: "+e.in),""}if(!n)return console.warn(`Missing style attribute or content for parameter ${t}`),"";switch(e.in){case"path":return W(t,n,i,r);case"query":return H(t,n,i,r);case"header":return C(n,i,r);case"cookie":return B(t,n,i,r);default:return console.warn("Unexpected parameter location: "+e.in),""}}function le(e){return e.search(/xml/i)!==-1?"xml":"clike"}const I=/^#\/components\/(schemas|pathItems)\/([^/]+)$/;function xe(e){return I.test(e||"")}function ye(e){return e?.match(I)?.pop()}function G(e){if(e===void 0)return;const r=e.toString(10);return/^0\.0*1$/.test(r)?`decimal places <= ${r.split(".")[1].length}`:`multiple of ${r}`}function l(e,r,t){let n;return r!==void 0&&t!==void 0?r===t?n=`= ${r} ${e}`:n=`[ ${r} .. ${t} ] ${e}`:t!==void 0?n=`<= ${t} ${e}`:r!==void 0&&(r===1?n="non-empty":n=`>= ${r} ${e}`),n}function J(e){const r=typeof e.exclusiveMinimum=="number"?Math.min(e.exclusiveMinimum,e.minimum??1/0):e.minimum,t=typeof e.exclusiveMaximum=="number"?Math.max(e.exclusiveMaximum,e.maximum??-1/0):e.maximum,n=typeof e.exclusiveMinimum=="number"||e.exclusiveMinimum,i=typeof e.exclusiveMaximum=="number"||e.exclusiveMaximum;if(r!==void 0&&t!==void 0)return`${n?"( ":"[ "}${r} .. ${t}${i?" )":" ]"}`;if(t!==void 0)return`${i?"< ":"<= "}${t}`;if(r!==void 0)return`${n?"> ":">= "}${r}`}function be(e){const r=[],t=l("characters",e.minLength,e.maxLength);t!==void 0&&r.push(t);const n=l("items",e.minItems,e.maxItems);n!==void 0&&r.push(n);const i=l(e.minProperties===1&&e.maxProperties===1?"property":"properties",e.minProperties,e.maxProperties);i!==void 0&&r.push(i);const o=G(e.multipleOf);o!==void 0&&r.push(o);const s=J(e);return s!==void 0&&r.push(s),e.uniqueItems&&r.push("unique"),r}function ge(e,r=[]){const t=[],n=[],i=[];return e.forEach(o=>{o.required?r.includes(o.name)?n.push(o):i.push(o):t.push(o)}),n.sort((o,s)=>r.indexOf(o.name)-r.indexOf(s.name)),[...n,...i,...t]}function je(e){return e.sort((r,t)=>Number(r.deprecated)-Number(t.deprecated))}function $e(e,r=[],t=[],{pathPointer:n,operationPointer:i}){const o={};t.forEach(u=>{({resolved:u}=e.deref(u)),o[u.name+"_"+u.in]=!0});const s=r.map((u,p)=>({paramOrRef:u,pointer:$.join(n,["parameters",String(p)])})).filter(({paramOrRef:u})=>({resolved:u}=e.deref(u),!o[u.name+"_"+u.in])),x=t.map((u,p)=>({paramOrRef:u,pointer:$.join(i,["parameters",String(p)])}));return[...s,...x]}function _e(e,r){const n=e===void 0?z((()=>{if(!M)return globalThis.SSR_HOSTNAME||"";const i=window.location.href;return i.endsWith(".html")?y(i):i})()):N(e)?U(e):y(e);return r.length===0&&(r=[{url:"/"}]),r.map(i=>({...i,url:n?D(n,i.url):i.url,description:i.description||""}))}const Pe=e=>({delete:"del",options:"opts"})[e]||e;function Q(e){return e in{"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-hideReplay":!0,"x-feedback":!0,"x-badges":!0,"x-assertionType":!0,"x-rbac":!0}||e.startsWith("x-parsed-md-")}function he(e,r){return Object.keys(e).filter(t=>r===!0?t.startsWith("x-")&&!Q(t):t.startsWith("x-")&&r.indexOf(t)>-1).reduce((t,n)=>(t[n]=e[n],t),{})}function we(e){return e.split(" or ").map(r=>r.replace(/^(string|object|number|integer|array|boolean)s?( ?.*)/,"$1s$2")).join(" or ")}function Oe(e){let r=e.content;const t=e["x-examples"],n=e["x-example"];if(t){r={...r};for(const i of Object.keys(t)){const o=t[i];r[i]={...r[i],examples:o}}}else if(n){r={...r};for(const i of Object.keys(n)){const o=n[i];r[i]={...r[i],example:o}}}return r}export{ae as detectType,he as extractExtensions,Oe as getContentWithLegacyExamples,ye as getDefinitionName,se as getOperationId,ue as getOperationName,ie as getStatusCodeType,be as humanizeConstraints,J as humanizeNumberRange,pe as isFormUrlEncoded,q as isJsonLike,fe as isMultipartFormData,xe as isNamedDefinition,oe as isOperationName,k as isPrimitiveType,Q as isRedocExtension,ne as isStatusCode,ce as isXmlLike,le as langFromMime,$e as mergeParams,_e as normalizeServers,we as pluralizeType,de as serializeParameterValue,A as serializeParameterValueWithMime,H as serializeQueryParameter,Pe as shortenHTTPVerb,je as sortByDeprecated,ge as sortByRequired,me as urlFormEncodePayload};
|
|
1
|
+
import{dirname as y}from"path";import f from"url-template";import{IS_BROWSER as M}from"@redocly/theme/core/openapi";import{deleteEmptyArrayItem as E,isArrayOfObjects as T,isNumeric as S,removeQueryStringAndHash as z,resolveUrl as D,sanitizeItemId as m,normalizeText as b,getValueFromMdParsedExtension as g,isAbsoluteUrl as N}from"./helpers.js";import{DEFAULT_TAG_SLUG as R,MediaTypes as j}from"../constants.js";import{JsonPointer as $}from"./JsonPointer.js";import{joinWithSeparator as _}from"../services/index.js";import{tryDecodeURIComponent as F}from"./string.js";import{getUrlDirname as U}from"./url.js";function P(e){return typeof e=="string"&&/\dxx/i.test(e)}function ne(e){return e==="default"||S(e)||P(e)}function ie(e,r=!1){if(e==="default")return r?"error":"success";let t=typeof e=="string"?parseInt(e,10):e;if(P(e)&&(t*=100),t<100||t>599)throw new Error("invalid HTTP code");let n="success";return t>=300&&t<400?n="redirect":t>=400?n="error":t<200&&(n="info"),n}const L={get:!0,post:!0,put:!0,head:!0,patch:!0,delete:!0,options:!0,$ref:!0};function oe(e){return e in L}function ue(e){const{operationId:r,pathName:t}=e,n=b(g(e,"description"));return b(g(e,"summary"))||r||n&&n.substring(0,50)||t||"<no summary>"}function se(e,r){return r?.id?_(r.id,m(e.operationId?e.operationId:d(e.pointer))).toLowerCase():e.tags?.length?m(e.operationId?e.operationId:d(e.pointer)):m(e.operationId?_(R,e.operationId):d(e.pointer))}function d(e){return e?.startsWith("/")?e.slice(1,e.length):e}const h={multipleOf:"number",maximum:"number",exclusiveMaximum:"number",minimum:"number",exclusiveMinimum:"number",maxLength:"string",minLength:"string",pattern:"string",contentEncoding:"string",contentMediaType:"string",items:"array",maxItems:"array",minItems:"array",uniqueItems:"array",maxProperties:"object",minProperties:"object",required:"object",additionalProperties:"object",unevaluatedProperties:"object",patternProperties:"object",properties:"object"};function ae(e){if(e.type!==void 0&&!Array.isArray(e.type))return e.type;const r=Object.keys(h);for(const t of r){const n=h[t];if(e[t]!==void 0)return n}return"any"}function k(e,r=e.type){if(e["x-circular-ref"]||e["x-complex"])return!0;if(e.oneOf!==void 0||e.anyOf!==void 0||e.if&&e.then||e.if&&e.else)return!1;let t=!0;const n=Array.isArray(r);return(r==="object"||n&&r?.includes("object"))&&(t=e.properties!==void 0?Object.keys(e.properties).length===0:e.additionalProperties===void 0&&e.unevaluatedProperties===void 0&&e.patternProperties===void 0),Array.isArray(e.items)||Array.isArray(e.prefixItems)?!1:(e.items!==void 0&&typeof e.items!="boolean"&&(r==="array"||n&&r?.includes("array"))&&(t=k(e.items,e.items.type)),t)}function q(e){return e.search(/json/i)!==-1}function ce(e){return e?.search(/xml/i)!==-1}function pe(e){return e===j.URL_ENCODED}function fe(e){return e===j.MULTIPART}function c(e,r,t){return Array.isArray(e)?e.map(n=>n.toString()).join(t):typeof e=="object"?Object.keys(e).map(n=>`${n}${t}${e[n]}`).join(t):r+"="+e.toString()}function w(e,r){return Array.isArray(e)?(console.warn("deepObject style cannot be used with array value:"+e.toString()),""):typeof e=="object"?Object.keys(e).map(t=>e[t]?`${r}[${t}]=${e[t]}`:void 0).filter(Boolean).join("&"):(console.warn("deepObject style cannot be used with non-object value:"+e.toString()),"")}function a(e,r,t){const n="__redoc_param_name__",i=r?"*":"";return f.parse(`{?${n}${i}}`).expand({[n]:t}).substring(1).replace(/__redoc_param_name__/g,e)}function O(e,r){const t=e?"*":"",n="__redoc_param_name__",i=f.parse(`{${n}${t}}`);return F(i.expand({[n]:r}))}function me(e,r={}){if(Array.isArray(e))throw new Error("Payload must have fields: "+e.toString());return Object.keys(e).map(t=>{const n=e[t],{style:i="form",explode:o=!0}=r[t]||{};switch(i){case"form":return a(t,o,n);case"spaceDelimited":return c(n,t,"%20");case"pipeDelimited":return c(n,t,"|");case"deepObject":return w(n,t);default:return console.warn("Incorrect or unsupported encoding style: "+i),""}}).join("&")}function W(e,r,t,n){const i=t?"*":"";let o="";r==="label"?o=".":r==="matrix"&&(o=";");const s="__redoc_param_name__";return f.parse(`{${o}${s}${i}}`).expand({[s]:n}).replace(/__redoc_param_name__/g,e)}function H(e,r,t,n){const i=o=>{switch(r){case"form":return a(e,t,o);case"spaceDelimited":return!Array.isArray(o)&&typeof o!="object"?(console.warn("The style spaceDelimited is applicable to arrays or objects"),""):t?a(e,t,o):c(n,e,"%20");case"pipeDelimited":return!Array.isArray(o)&&typeof o!="object"?(console.warn("The style pipeDelimited is applicable to arrays or objects"),""):t?a(e,t,o):c(n,e,"|");case"deepObject":return!t||Array.isArray(o)||typeof o!="object"?(console.warn("The style deepObject is only applicable for objects with explode=true"),""):w(o,e);case"simple":return O(t,n);default:return console.warn("Unexpected style for query: "+r),""}};return T(n)&&(n=E(n).map(o=>i(o))),i(n)}function C(e,r,t){switch(e){case"simple":return O(r,t);default:return console.warn("Unexpected style for header: "+e),""}}function B(e,r,t,n){switch(r){case"form":return a(e,t,n);default:return console.warn("Unexpected style for cookie: "+r),""}}function A(e,r){return q(r)?JSON.stringify(e):(console.warn(`Parameter serialization as ${r} is not supported`),"")}function de(e,r){const{name:t,style:n,explode:i=!1,serializationMime:o}=e;if(o)switch(e.in){case"path":case"header":return A(r,o);case"cookie":case"query":return`${t}=${A(r,o)}`;default:return console.warn("Unexpected parameter location: "+e.in),""}if(!n)return console.warn(`Missing style attribute or content for parameter ${t}`),"";switch(e.in){case"path":return W(t,n,i,r);case"query":return H(t,n,i,r);case"header":return C(n,i,r);case"cookie":return B(t,n,i,r);default:return console.warn("Unexpected parameter location: "+e.in),""}}function le(e){return e.search(/xml/i)!==-1?"xml":"clike"}const I=/^#\/components\/(schemas|pathItems)\/([^/]+)$/;function xe(e){return I.test(e||"")}function ye(e){return e?.match(I)?.pop()}function G(e){if(e===void 0)return;const r=e.toString(10);return/^0\.0*1$/.test(r)?`decimal places <= ${r.split(".")[1].length}`:`multiple of ${r}`}function l(e,r,t){let n;return r!==void 0&&t!==void 0?r===t?n=`= ${r} ${e}`:n=`[ ${r} .. ${t} ] ${e}`:t!==void 0?n=`<= ${t} ${e}`:r!==void 0&&(r===1?n="non-empty":n=`>= ${r} ${e}`),n}function J(e){const r=typeof e.exclusiveMinimum=="number"?Math.min(e.exclusiveMinimum,e.minimum??1/0):e.minimum,t=typeof e.exclusiveMaximum=="number"?Math.max(e.exclusiveMaximum,e.maximum??-1/0):e.maximum,n=typeof e.exclusiveMinimum=="number"||e.exclusiveMinimum,i=typeof e.exclusiveMaximum=="number"||e.exclusiveMaximum;if(r!==void 0&&t!==void 0)return`${n?"( ":"[ "}${r} .. ${t}${i?" )":" ]"}`;if(t!==void 0)return`${i?"< ":"<= "}${t}`;if(r!==void 0)return`${n?"> ":">= "}${r}`}function be(e){const r=[],t=l("characters",e.minLength,e.maxLength);t!==void 0&&r.push(t);const n=l("items",e.minItems,e.maxItems);n!==void 0&&r.push(n);const i=l(e.minProperties===1&&e.maxProperties===1?"property":"properties",e.minProperties,e.maxProperties);i!==void 0&&r.push(i);const o=G(e.multipleOf);o!==void 0&&r.push(o);const s=J(e);return s!==void 0&&r.push(s),e.uniqueItems&&r.push("unique"),r}function ge(e,r=[]){const t=[],n=[],i=[];return e.forEach(o=>{o.required?r.includes(o.name)?n.push(o):i.push(o):t.push(o)}),n.sort((o,s)=>r.indexOf(o.name)-r.indexOf(s.name)),[...n,...i,...t]}function je(e){return e.sort((r,t)=>Number(r.deprecated)-Number(t.deprecated))}function $e(e,r=[],t=[],{pathPointer:n,operationPointer:i}){const o={};t.forEach(u=>{({resolved:u}=e.deref(u)),o[u.name+"_"+u.in]=!0});const s=r.map((u,p)=>({paramOrRef:u,pointer:$.join(n,["parameters",String(p)])})).filter(({paramOrRef:u})=>({resolved:u}=e.deref(u),!o[u.name+"_"+u.in])),x=t.map((u,p)=>({paramOrRef:u,pointer:$.join(i,["parameters",String(p)])}));return[...s,...x]}function _e(e,r){const n=e===void 0?z((()=>{if(!M)return globalThis.SSR_HOSTNAME||"";const i=window.location.href;return i.endsWith(".html")?y(i):i})()):N(e)?U(e):y(e);return r.length===0&&(r=[{url:"/"}]),r.map(i=>({...i,url:n?D(n,i.url):i.url,description:i.description||""}))}const Pe=e=>({delete:"del",options:"opts"})[e]||e;function Q(e){return e in{"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-hideReplay":!0,"x-feedback":!0,"x-badges":!0,"x-assertionType":!0,"x-rbac":!0}||e.startsWith("x-parsed-md-")}function he(e,r){return Object.keys(e).filter(t=>r===!0?t.startsWith("x-")&&!Q(t):t.startsWith("x-")&&r.indexOf(t)>-1).reduce((t,n)=>(t[n]=e[n],t),{})}function we(e){return e.split(" or ").map(r=>r.replace(/^(string|object|number|integer|array|boolean)s?( ?.*)/,"$1s$2")).join(" or ")}function Oe(e){let r=e.content;const t=e["x-examples"],n=e["x-example"];if(t){r={...r};for(const i of Object.keys(t)){const o=t[i];r[i]={...r[i],examples:o}}}else if(n){r={...r};for(const i of Object.keys(n)){const o=n[i];r[i]={...r[i],example:o}}}return r}export{ae as detectType,he as extractExtensions,Oe as getContentWithLegacyExamples,ye as getDefinitionName,se as getOperationId,ue as getOperationName,ie as getStatusCodeType,be as humanizeConstraints,J as humanizeNumberRange,pe as isFormUrlEncoded,q as isJsonLike,fe as isMultipartFormData,xe as isNamedDefinition,oe as isOperationName,k as isPrimitiveType,Q as isRedocExtension,ne as isStatusCode,ce as isXmlLike,le as langFromMime,$e as mergeParams,_e as normalizeServers,we as pluralizeType,de as serializeParameterValue,A as serializeParameterValueWithMime,H as serializeQueryParameter,Pe as shortenHTTPVerb,je as sortByDeprecated,ge as sortByRequired,me as urlFormEncodePayload};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import f from"@markdoc/markdoc";import{isString as d}from"@redocly/theme";function u(r){if(!r)return"";if(!d(r))return r?.result?{result:g(f.Ast.fromJSON(JSON.stringify(r.result)))||"",raw:u(r.raw)}:r;const n=new RegExp("^#{1,6}?\\s+","m"),e=r.search(n);return e>-1?r.substring(0,e):r}function g(r){if(Array.isArray(r)){const e=r.findIndex(i=>i.type==="heading");return e===-1?r:r.slice(0,e)}if(!r.children||!Array.isArray(r.children))return;const n=r.children.findIndex(e=>e.type==="heading");return n===-1||(r.children=r.children.slice(0,n)),r}export{u as saveTextBeforeHeading};
|
|
1
|
+
import f from"@markdoc/markdoc";import{isString as d}from"@redocly/theme/core/openapi";function u(r){if(!r)return"";if(!d(r))return r?.result?{result:g(f.Ast.fromJSON(JSON.stringify(r.result)))||"",raw:u(r.raw)}:r;const n=new RegExp("^#{1,6}?\\s+","m"),e=r.search(n);return e>-1?r.substring(0,e):r}function g(r){if(Array.isArray(r)){const e=r.findIndex(i=>i.type==="heading");return e===-1?r:r.slice(0,e)}if(!r.children||!Array.isArray(r.children))return;const n=r.children.findIndex(e=>e.type==="heading");return n===-1||(r.children=r.children.slice(0,n)),r}export{u as saveTextBeforeHeading};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SecurityVariablesEnvSuffix as o}from"@redocly/theme";import{escapeFormId as c}from"./string.js";import{fromSessionStorage as e,toSessionStorage as r}from"./session-storage.js";function p(t,s){t=c(t),r(`auth.${t}.variants`,JSON.stringify(s))}function S(t,s={}){return{raw:s[t+o.APIKey],password:s[t+o.Password],username:s[t+o.Username],token:s[t+o.Token]?{access_token:s[t+o.Token]}:void 0,client_id:s[t+o.ClientId],client_secret:s[t+o.ClientSecret],scopes:e(`auth.${t}.scopes`)}}function h(t,s){t=c(t),typeof s=="string"?r("auth."+t,s):s&&(r(`auth.${t}.password`,s.password||""),r(`auth.${t}.username`,s.username||""),r(`auth.${t}.token`,s.token&&JSON.stringify(s.token)||""),r(`auth.${t}.client_id`,s.client_id||""),r(`auth.${t}.client_secret`,s.client_secret||""),r(`auth.${t}.scopes`,s.scopes&&JSON.stringify(s.scopes)||""))}export{S as getSecurityDetails,h as setSecurityDetails,p as setSecurityDetailsVariants};
|
|
1
|
+
import{SecurityVariablesEnvSuffix as o}from"@redocly/theme/core/openapi";import{escapeFormId as c}from"./string.js";import{fromSessionStorage as e,toSessionStorage as r}from"./session-storage.js";function p(t,s){t=c(t),r(`auth.${t}.variants`,JSON.stringify(s))}function S(t,s={}){return{raw:s[t+o.APIKey],password:s[t+o.Password],username:s[t+o.Username],token:s[t+o.Token]?{access_token:s[t+o.Token]}:void 0,client_id:s[t+o.ClientId],client_secret:s[t+o.ClientSecret],scopes:e(`auth.${t}.scopes`)}}function h(t,s){t=c(t),typeof s=="string"?r("auth."+t,s):s&&(r(`auth.${t}.password`,s.password||""),r(`auth.${t}.username`,s.username||""),r(`auth.${t}.token`,s.token&&JSON.stringify(s.token)||""),r(`auth.${t}.client_id`,s.client_id||""),r(`auth.${t}.client_secret`,s.client_secret||""),r(`auth.${t}.scopes`,s.scopes&&JSON.stringify(s.scopes)||""))}export{S as getSecurityDetails,h as setSecurityDetails,p as setSecurityDetailsVariants};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IS_BROWSER as e}from"@redocly/theme";function n(o,t){e&&window.sessionStorage.setItem("redoc."+o,t)}function i(o){return e&&window.sessionStorage.getItem("redoc."+o)||""}export{i as fromSessionStorage,n as toSessionStorage};
|
|
1
|
+
import{IS_BROWSER as e}from"@redocly/theme/core/openapi";function n(o,t){e&&window.sessionStorage.setItem("redoc."+o,t)}function i(o){return e&&window.sessionStorage.getItem("redoc."+o)||""}export{i as fromSessionStorage,n as toSessionStorage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getDefaultCollectorUrl(): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{withPathPrefix as o}from"@redocly/theme/core/openapi";function e(){return process.env.NODE_ENV==="development"?"http://localhost:4318":window.location.origin+o("/_otel")}export{e as getDefaultCollectorUrl};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-docs",
|
|
3
|
-
"version": "3.12.0-next.
|
|
3
|
+
"version": "3.12.0-next.10",
|
|
4
4
|
"description": "Redocly OpenAPI Docs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"styled-components": "^4.1.1 || ^5.3.11 || ^6.0.0"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@markdoc/markdoc": "0.5.
|
|
24
|
-
"@redocly/openapi-core": "
|
|
23
|
+
"@markdoc/markdoc": "0.5.2",
|
|
24
|
+
"@redocly/openapi-core": "2.0.0-next.4",
|
|
25
25
|
"deepmerge": "^4.2.2",
|
|
26
26
|
"dompurify": "3.2.6",
|
|
27
27
|
"fast-deep-equal": "^3.1.3",
|
|
@@ -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.26.
|
|
40
|
-
"@redocly/replay": "0.15.0-next.
|
|
39
|
+
"@redocly/config": "0.26.3",
|
|
40
|
+
"@redocly/replay": "0.15.0-next.6"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@jest/globals": "29.5.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@types/react-dom": "^19.1.4",
|
|
55
55
|
"@types/styled-components": "5.1.34",
|
|
56
56
|
"@vitejs/plugin-react": "^4.2.1",
|
|
57
|
-
"esbuild": "
|
|
57
|
+
"esbuild": "0.25.5",
|
|
58
58
|
"jest": "29.5.0",
|
|
59
59
|
"jest-environment-jsdom": "29.5.0",
|
|
60
60
|
"jest-styled-components": "7.2.0",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"typescript": "5.6.2",
|
|
75
75
|
"url": "~0.11.0",
|
|
76
76
|
"vite": "^6.3.5",
|
|
77
|
-
"@redocly/theme": "0.56.0-next.
|
|
77
|
+
"@redocly/theme": "0.56.0-next.3"
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|
|
80
80
|
"start": "npm run copy-highlight-hook && vite",
|