@redocly/openapi-docs 3.16.0 → 3.17.0-next.1
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 +2743 -2514
- package/lib/components/PayloadSamples/ExampleValue.js +1 -1
- package/lib/components/ResponseSamples/ResponseSamples.js +1 -1
- package/lib/constants.d.ts +6 -6
- package/lib/constants.js +1 -1
- package/lib/hooks/useRouter.d.ts +4 -0
- package/lib/models/mediaType.js +1 -1
- package/lib/models/types.d.ts +1 -0
- package/lib/services/code-samples/convertSampleToString.d.ts +2 -0
- package/lib/services/code-samples/convertSampleToString.js +17 -0
- package/lib/services/code-samples/httpsnippet/targets/__mocks__/mock.d.ts +2 -550
- package/lib/services/code-samples/index.d.ts +1 -0
- package/lib/services/code-samples/index.js +1 -1
- package/lib/services/history/helpers.d.ts +0 -1
- package/lib/services/history/helpers.js +1 -1
- package/lib/types/app.d.ts +0 -5
- package/lib/types/open-api.d.ts +1 -0
- package/lib/utils/helpers.js +1 -1
- package/lib/utils/index.d.ts +0 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/openapi.d.ts +2 -2
- package/lib/utils/openapi.js +1 -1
- package/lib/utils/string.js +1 -1
- package/lib/utils/url.js +1 -1
- package/package.json +18 -26
- package/lib/components/SchemaCatalogLink/tests/SchemaCatalogLink.test.d.ts +0 -1
- package/lib/components/SchemaCatalogLink/tests/SchemaCatalogLink.test.js +0 -1
- package/lib/utils/test-utils.d.ts +0 -1
- package/lib/utils/test-utils.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./generator.js";export*from"./types.js";
|
|
1
|
+
export*from"./generator.js";export*from"./types.js";export*from"./convertSampleToString.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { FieldModel } from '../../models/index.js';
|
|
2
|
-
export declare function isSameHash(a: string, b: string): boolean;
|
|
3
2
|
export declare function constructFieldDeepFragment(field: FieldModel, activeMimeName?: string): string;
|
|
4
3
|
export declare function joinWithSeparator(base?: string, path?: string, sep?: string): string;
|
|
5
4
|
export declare function makeDeepLink(operationId: string, suffix: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{encodeBackSlashes as o,queryString as s}from"../../utils/index.js";import{getActiveMediaType as r}from"../../models/mediaContent.js";function
|
|
1
|
+
import{encodeBackSlashes as o,queryString as s}from"../../utils/index.js";import{getActiveMediaType as r}from"../../models/mediaContent.js";function p(e,n){if(!e.in){if(e.deps.type==="request"&&e.deps.operation?.requestBody?.content?.mediaTypes)return e.deps.operation?.requestBody?.content?.mediaTypes.length>1?e.deps.operation?.requestBody?.content&&r(e.deps.operation.requestBody.content,n).name:void 0;if(e.deps.type==="response"&&e.deps.response?.content?.mediaTypes)return e.deps.response?.content?.mediaTypes.length>1?e.deps.response?.content&&r(e.deps.response.content,n).name:void 0}}function d(e,n){if(!e)return"";const t={t:e.deps.type,in:e.in||e.deps.in,c:e.deps.type==="response"?e.deps.response?.code:void 0,cb:e.deps.operation?.isCallback?e.deps.operation.callbackId:void 0,ct:p(e,n),path:e.fieldFullPath};return s.stringify(t,{encode:!1,sort:!1})}function c(e="",n="",t="/"){return e.endsWith(t)&&e!==t&&(e=e.slice(0,-t.length)),n.startsWith(t)&&(n=n.slice(t.length)),!e||!n||e===t?e+n:e+t+n}function y(e,n){return e=o(e),(`/${e}#`+c(e,n)).toLowerCase()}export{d as constructFieldDeepFragment,c as joinWithSeparator,y as makeDeepLink};
|
package/lib/types/app.d.ts
CHANGED
package/lib/types/open-api.d.ts
CHANGED
package/lib/utils/helpers.js
CHANGED
|
@@ -9,4 +9,4 @@ $4`);{const s=r===""||r.endsWith(`
|
|
|
9
9
|
|
|
10
10
|
`;return`${r}${s}# ${e}
|
|
11
11
|
|
|
12
|
-
${t}`}}const W=r=>Array.isArray(r)&&r.some(e=>i(e)),y=r=>r.filter(e=>!!e),C=r=>i(r)&&!Array.isArray(r);function x(r){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(r)}function N(r,e){let t;if(e.startsWith("//"))t=`${u(r,!0)?.protocol||"https:"}${e}`;else if(x(e))t=e;else if(!e.startsWith("/"))t=c(r)+"/"+e;else{const n=u(r);n?(n.pathname=e,t=n.toString()):t=e}return c(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 P(r){return r.replace(/["\\]/g,"\\$&")}function T(r){return r.replace(/&#(\d+);/g,(e,t)=>String.fromCharCode(parseInt(t,10))).replace(/&
|
|
12
|
+
${t}`}}const W=r=>Array.isArray(r)&&r.some(e=>i(e)),y=r=>r.filter(e=>!!e),C=r=>i(r)&&!Array.isArray(r);function x(r){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(r)}function N(r,e){let t;if(e.startsWith("//"))t=`${u(r,!0)?.protocol||"https:"}${e}`;else if(x(e))t=e;else if(!e.startsWith("/"))t=c(r)+"/"+e;else{const n=u(r);n?(n.pathname=e,t=n.toString()):t=e}return c(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 P(r){return r.replace(/["\\]/g,"\\$&")}function T(r){return r.replace(/&#(\d+);/g,(e,t)=>String.fromCharCode(parseInt(t,10))).replace(/"/g,'"').replace(/&/g,"&")}function j(r){return r&&r.replace(/#/g,"_").toLowerCase()}function z(r,e){return e||a(r)&&f.baseName(r)||""}function M(r={},e,t){return typeof e=="string"&&(e=e.split(".")),e.reduce((n,o)=>n&&n[o]?n[o]:t,r)}function g(r){return(...e)=>e.filter(Boolean).join(r)}const D=g(".");function F(r){return l?window?.REFERENCE_DOCS_OPTIONS?.[r]:null}const _=r=>p(r)?r:r?.raw,H=(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 d(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 B(r){return r.name||r.description}function d(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 U(r,e){return e===r.length-1}function V(r,e){const t=Object.keys(r);return t.indexOf(e)===t.length-1}export{E as appendToMdHeading,y as deleteEmptyArrayItem,D as dottedString,P as escapeHTMLAttrChars,R as flattenByProp,M as get,B as getServerDisplayName,H as getValueFromMdParsedExtension,F as getWindowReferenceOptions,x as isAbsoluteUrl,W as isArrayOfObjects,U as isLastInArray,V as isLastProperty,C as isMergeableObject,b as isNumeric,g as joinStringFactory,A as mapValues,w as mapWithLast,_ as normalizeText,L as removeQueryStringAndHash,N as resolveUrl,j as sanitizeItemId,c as stripTrailingSlash,I as titleize,T as unescapeHTMLChars,z as useSchemaTitle};
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export * from './session-storage.js';
|
|
|
12
12
|
export * from './local-storage.js';
|
|
13
13
|
export * from './parameters.js';
|
|
14
14
|
export * from './string.js';
|
|
15
|
-
export * from './test-utils.js';
|
|
16
15
|
export * from './compose.js';
|
|
17
16
|
export * from './saveTextBeforeHeading.js';
|
|
18
17
|
export * from './path.js';
|
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"./
|
|
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"./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"./hasNestedFields.js";export*from"./configure-helpers.js";export*from"./telemetry.js";
|
package/lib/utils/openapi.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { OpenAPIEncoding, OpenAPIMediaType, OpenAPIParameterStyle, OpenAPIRequestBody, OpenAPIResponse, OpenAPISchema, OpenAPIServer, Referenced } from '../types/index.js';
|
|
1
|
+
import type { OpenAPIEncoding, OpenAPIMediaType, OpenAPIParameterStyle, OpenAPIRequestBody, OpenAPIResponse, OpenAPISchema, OpenAPIServer, Referenced, OpenAPIParameter } from '../types/index.js';
|
|
2
2
|
import type { ExtendedOpenAPIOperation, OpenAPIParser } from '../services/index.js';
|
|
3
3
|
import type { FieldModel, GroupModel } from '../models/index.js';
|
|
4
|
-
import { OpenAPIParameter } from '../types/index.js';
|
|
5
4
|
export declare function isStatusCode(statusCode: string): boolean;
|
|
6
5
|
export declare function getStatusCodeType(statusCode: string | number, defaultAsError?: boolean): string;
|
|
7
6
|
export declare function isOperationName(key: string): boolean;
|
|
@@ -13,6 +12,7 @@ export declare function isJsonLike(contentType: string): boolean;
|
|
|
13
12
|
export declare function isXmlLike(contentType: string): boolean;
|
|
14
13
|
export declare function isFormUrlEncoded(contentType: string): boolean;
|
|
15
14
|
export declare function isMultipartFormData(contentType: string): boolean;
|
|
15
|
+
export declare function isSequentialMediaType(contentType: string): boolean;
|
|
16
16
|
export declare function urlFormEncodePayload(payload: GenericObject, encoding?: {
|
|
17
17
|
[field: string]: OpenAPIEncoding;
|
|
18
18
|
}): string;
|
package/lib/utils/openapi.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dirname as y}from"path";import f from"url-template";import{deleteEmptyArrayItem as M,isArrayOfObjects as E,isNumeric as T,removeQueryStringAndHash as S,resolveUrl as z,sanitizeItemId as m,normalizeText as b,getValueFromMdParsedExtension as g,isAbsoluteUrl as D}from"./helpers.js";import{DEFAULT_TAG_SLUG as N,MediaTypes as j}from"../constants.js";import{JsonPointer as $}from"./JsonPointer.js";import{joinWithSeparator as _}from"../services/index.js";import{tryDecodeURIComponent as R}from"./string.js";import{getUrlDirname as F}from"./url.js";import{IS_BROWSER as U}from"./dom.js";function P(e){return typeof e=="string"&&/\dxx/i.test(e)}function ne(e){return e==="default"||T(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?_(N,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 R(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 E(n)&&(n=M(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?S((()=>{if(!U)return globalThis.SSR_HOSTNAME||"";const i=window.location.href;return i.endsWith(".html")?y(i):i})()):D(e)?F(e):y(e);return r.length===0&&(r=[{url:"/"}]),r.map(i=>({...i,url:n?z(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-badges":!0,"x-hideReplay":!0,"x-feedback":!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 b}from"path";import m from"url-template";import{deleteEmptyArrayItem as w,isArrayOfObjects as E,isNumeric as S,removeQueryStringAndHash as T,resolveUrl as N,sanitizeItemId as l,normalizeText as g,getValueFromMdParsedExtension as j,isAbsoluteUrl as z}from"./helpers.js";import{DEFAULT_TAG_SLUG as D,MediaTypes as a}from"../constants.js";import{JsonPointer as _}from"./JsonPointer.js";import{joinWithSeparator as $}from"../services/index.js";import{tryDecodeURIComponent as R}from"./string.js";import{getUrlDirname as L}from"./url.js";import{IS_BROWSER as U}from"./dom.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 q={get:!0,post:!0,put:!0,head:!0,patch:!0,delete:!0,options:!0,$ref:!0};function oe(e){return e in q}function ue(e){const{operationId:r,pathName:t}=e,n=g(j(e,"description"));return g(j(e,"summary"))||r||n&&n.substring(0,50)||t||"<no summary>"}function se(e,r){return r?.id?$(r.id,l(e.operationId?e.operationId:d(e.pointer))).toLowerCase():e.tags?.length?l(e.operationId?e.operationId:d(e.pointer)):l(e.operationId?$(D,e.operationId):d(e.pointer))}function d(e){return e?.startsWith("/")?e.slice(1,e.length):e}const O={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(O);for(const t of r){const n=O[t];if(e[t]!==void 0)return n}return"any"}function F(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=F(e.items,e.items.type)),t)}function k(e){return e.search(/json/i)!==-1}function ce(e){return e?.search(/xml/i)!==-1}function pe(e){return e===a.URL_ENCODED}function fe(e){return e===a.MULTIPART}function me(e){return[a.JSONL,a.NDJSON,a.JSON_SEQ,a.EVENT_STREAM,a.MULTIPART_MIXED].includes(e)}function p(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 A(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 c(e,r,t){const n="__redoc_param_name__",i=r?"*":"";return m.parse(`{?${n}${i}}`).expand({[n]:t}).substring(1).replace(/__redoc_param_name__/g,e)}function I(e,r){const t=e?"*":"",n="__redoc_param_name__",i=m.parse(`{${n}${t}}`);return R(i.expand({[n]:r}))}function le(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 c(t,o,n);case"spaceDelimited":return p(n,t,"%20");case"pipeDelimited":return p(n,t,"|");case"deepObject":return A(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 m.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 c(e,t,o);case"spaceDelimited":return!Array.isArray(o)&&typeof o!="object"?(console.warn("The style spaceDelimited is applicable to arrays or objects"),""):t?c(e,t,o):p(n,e,"%20");case"pipeDelimited":return!Array.isArray(o)&&typeof o!="object"?(console.warn("The style pipeDelimited is applicable to arrays or objects"),""):t?c(e,t,o):p(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"),""):A(o,e);case"simple":return I(t,n);default:return console.warn("Unexpected style for query: "+r),""}};return E(n)&&(n=w(n).map(o=>i(o))),i(n)}function C(e,r,t){switch(e){case"simple":return I(r,t);default:return console.warn("Unexpected style for header: "+e),""}}function J(e,r,t,n){switch(r){case"form":return c(e,t,n);default:return console.warn("Unexpected style for cookie: "+r),""}}function M(e,r){return k(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 M(r,o);case"cookie":case"query":return`${t}=${M(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 J(t,n,i,r);default:return console.warn("Unexpected parameter location: "+e.in),""}}function xe(e){return e.search(/xml/i)!==-1?"xml":e.includes("application/json-seq")?"json-seq":e.includes("application/jsonl")?"jsonl":e.includes("json")?"json":e.includes("multipart/mixed")?"multipart-mixed":e.includes("text/event-stream")?"yaml":"clike"}const h=/^#\/components\/(schemas|pathItems)\/([^/]+)$/;function ye(e){return h.test(e||"")}function be(e){return e?.match(h)?.pop()}function B(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 x(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 G(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 ge(e){const r=[],t=x("characters",e.minLength,e.maxLength);t!==void 0&&r.push(t);const n=x("items",e.minItems,e.maxItems);n!==void 0&&r.push(n);const i=x(e.minProperties===1&&e.maxProperties===1?"property":"properties",e.minProperties,e.maxProperties);i!==void 0&&r.push(i);const o=B(e.multipleOf);o!==void 0&&r.push(o);const s=G(e);return s!==void 0&&r.push(s),e.uniqueItems&&r.push("unique"),r}function je(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 _e(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,f)=>({paramOrRef:u,pointer:_.join(n,["parameters",String(f)])})).filter(({paramOrRef:u})=>({resolved:u}=e.deref(u),!o[u.name+"_"+u.in])),y=t.map((u,f)=>({paramOrRef:u,pointer:_.join(i,["parameters",String(f)])}));return[...s,...y]}function Pe(e,r){const n=e===void 0?T((()=>{if(!U)return globalThis.SSR_HOSTNAME||"";const i=window.location.href;return i.endsWith(".html")?b(i):i})()):z(e)?L(e):b(e);return r.length===0&&(r=[{url:"/"}]),r.map(i=>({...i,url:n?N(n,i.url):i.url,description:i.description||""}))}const Oe=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-badges":!0,"x-hideReplay":!0,"x-feedback":!0,"x-assertionType":!0,"x-rbac":!0}||e.startsWith("x-parsed-md-")}function Ae(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 Ie(e){return e.split(" or ").map(r=>r.replace(/^(string|object|number|integer|array|boolean)s?( ?.*)/,"$1s$2")).join(" or ")}function Me(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,Ae as extractExtensions,Me as getContentWithLegacyExamples,be as getDefinitionName,se as getOperationId,ue as getOperationName,ie as getStatusCodeType,ge as humanizeConstraints,G as humanizeNumberRange,pe as isFormUrlEncoded,k as isJsonLike,fe as isMultipartFormData,ye as isNamedDefinition,oe as isOperationName,F as isPrimitiveType,Q as isRedocExtension,me as isSequentialMediaType,ne as isStatusCode,ce as isXmlLike,xe as langFromMime,$e as mergeParams,Pe as normalizeServers,Ie as pluralizeType,de as serializeParameterValue,M as serializeParameterValueWithMime,H as serializeQueryParameter,Oe as shortenHTTPVerb,_e as sortByDeprecated,je as sortByRequired,le as urlFormEncodePayload};
|
package/lib/utils/string.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"slugify";function o(e){return e.split("").map(r=>r+"\u0335").join("")}function c(e){return e.replace(/[.[\]]/g,r=>({".":"%2e","[":"%5b","]":"%5d"})[r]||"")}function p(e){return e.replace(/%2e|%5b|%5d/g,r=>({"%2e":".","%5b":"[","%5d":"]"})[r]||"")}function u(e){return e.replace(/\\/g,"%5C")}function a(e){return e.replace(/%/g,"")}function i(e){try{return decodeURIComponent(e)}catch(r){return console.error(
|
|
1
|
+
import t from"slugify";function o(e){return e.split("").map(r=>r+"\u0335").join("")}function c(e){return e.replace(/[.[\]]/g,r=>({".":"%2e","[":"%5b","]":"%5d"})[r]||"")}function p(e){return e.replace(/%2e|%5b|%5d/g,r=>({"%2e":".","%5b":"[","%5d":"]"})[r]||"")}function u(e){return e.replace(/\\/g,"%5C")}function a(e){return e.replace(/%/g,"")}function i(e){try{return decodeURIComponent(e)}catch(r){return console.error("Decoding failed: %s",e,r),e}}function f(e){return t(e)||e.toString().toLowerCase().replace(/\s+/g,"-").replace(/&/g,"-and-").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}function l(e,r={}){try{return JSON.parse(e)}catch{return r}}export{u as encodeBackSlashes,c as escapeFormId,a as removePercentChart,l as safeJsonParse,f as safeSlugify,o as strikethroughText,i as tryDecodeURIComponent,p as unescapeFormId};
|
package/lib/utils/url.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function s(t,e=!1){let r=t;e&&r.startsWith("//")&&(r="http:"+t);try{return URL?.parse?URL?.parse(r):new URL(r)}catch(n){return console.error(
|
|
1
|
+
function s(t,e=!1){let r=t;e&&r.startsWith("//")&&(r="http:"+t);try{return URL?.parse?URL?.parse(r):new URL(r)}catch(n){return console.error("Invalid URL: %s",r,n),null}}function o(t){try{const e=new URL(t);let r=e.pathname;if(r.endsWith("/"))return e.origin+r;const n=r.lastIndexOf("/");return n!==-1?(r=r.substring(0,n+1),e.origin+r):e.origin+"/"}catch(e){console.error(`Invalid URL: ${t}`,e);return}}export{o as getUrlDirname,s as urlParse};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-docs",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.17.0-next.1",
|
|
4
4
|
"description": "Redocly OpenAPI Docs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
"npm": ">=10.0.0"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@redocly/theme": ">=0.
|
|
17
|
+
"@redocly/theme": ">=0.61.0-next.0",
|
|
18
18
|
"react": "^19.2.1",
|
|
19
19
|
"react-dom": "^19.2.1",
|
|
20
20
|
"styled-components": "^4.1.1 || ^5.3.11 || ^6.0.0"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@markdoc/markdoc": "0.5.2",
|
|
24
|
-
"@redocly/openapi-core": "2.12.
|
|
24
|
+
"@redocly/openapi-core": "2.12.5",
|
|
25
25
|
"deepmerge": "^4.2.2",
|
|
26
26
|
"dompurify": "3.2.7",
|
|
27
27
|
"fast-deep-equal": "^3.1.3",
|
|
@@ -36,17 +36,14 @@
|
|
|
36
36
|
"url-template": "^2.0.8",
|
|
37
37
|
"util": "~0.12.5",
|
|
38
38
|
"web-vitals": "3.3.1",
|
|
39
|
-
"@redocly/
|
|
40
|
-
"@redocly/
|
|
39
|
+
"@redocly/config": "0.41.0",
|
|
40
|
+
"@redocly/replay": "0.20.0-next.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@jest/globals": "29.5.0",
|
|
44
43
|
"@shikijs/transformers": "1.24.0",
|
|
45
44
|
"@testing-library/jest-dom": "6.6.3",
|
|
46
45
|
"@testing-library/react": "16.3.0",
|
|
47
46
|
"@testing-library/user-event": "14.6.1",
|
|
48
|
-
"@types/jest": "29.5.11",
|
|
49
|
-
"@types/jest-when": "3.5.5",
|
|
50
47
|
"@types/json-pointer": "1.0.34",
|
|
51
48
|
"@types/json-schema": "^7.0.15",
|
|
52
49
|
"@types/node": "22.18.13",
|
|
@@ -54,12 +51,10 @@
|
|
|
54
51
|
"@types/react-dom": "^19.2.3",
|
|
55
52
|
"@types/styled-components": "5.1.34",
|
|
56
53
|
"@vitejs/plugin-react": "5.1.1",
|
|
54
|
+
"@vitest/coverage-v8": "^4.0.10",
|
|
57
55
|
"esbuild": "0.27.0",
|
|
58
|
-
"jest": "29.5.0",
|
|
59
|
-
"jest-environment-jsdom": "29.5.0",
|
|
60
56
|
"jest-styled-components": "7.2.0",
|
|
61
|
-
"
|
|
62
|
-
"js-yaml": "4.1.0",
|
|
57
|
+
"js-yaml": "4.1.1",
|
|
63
58
|
"json-schema": "0.4.0",
|
|
64
59
|
"outdent": "0.8.0",
|
|
65
60
|
"path-browserify": "1.0.1",
|
|
@@ -70,30 +65,29 @@
|
|
|
70
65
|
"rollup-plugin-bundle-stats": "^4.20.2",
|
|
71
66
|
"shiki": "1.24.4",
|
|
72
67
|
"styled-components": "5.3.11",
|
|
73
|
-
"ts-jest": "29.1.2",
|
|
74
|
-
"ts-jest-mock-import-meta": "1.1.0",
|
|
75
68
|
"tsx": "4.20.3",
|
|
76
69
|
"typescript": "5.9.3",
|
|
77
70
|
"url": "~0.11.0",
|
|
78
71
|
"vite": "7.2.6",
|
|
79
|
-
"
|
|
72
|
+
"vitest": "4.0.10",
|
|
73
|
+
"@redocly/theme": "0.61.0-next.1"
|
|
80
74
|
},
|
|
81
75
|
"scripts": {
|
|
82
76
|
"start": "npm run copy-highlight-hook && vite",
|
|
83
77
|
"build": "npm run clean && npm run build:lib && npm run build:standalone",
|
|
84
|
-
"build:lib": "tsc -p tsconfig.json && node scripts/minify.js lib",
|
|
78
|
+
"build:lib": "tsc -p tsconfig.build.json && node scripts/minify.js lib",
|
|
85
79
|
"build:standalone": "vite build && node scripts/minify.js dist",
|
|
86
80
|
"prepare:community-source": "npx tsx scripts/prepare-community-source.ts --",
|
|
87
81
|
"prepare:community-source-only": "npm run prepare:community-source --ignore /src/* private-readme.md",
|
|
88
82
|
"prepare:community-dependencies": "npx tsx scripts/prepare-community-dependencies.ts",
|
|
89
83
|
"apply:community-source": "npx tsx scripts/apply-changes-from-community-source.ts",
|
|
90
|
-
"test": "npm run prepare:community-source && npm run test:redoc &&
|
|
91
|
-
"test:redoc": "cd redoc &&
|
|
92
|
-
"unit": "
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
84
|
+
"test": "npm run prepare:community-source && npm run test:redoc && vitest run",
|
|
85
|
+
"test:redoc": "cd redoc && npm install ../../theme ../../redocly-config --no-save && npm run lint && npm run unit",
|
|
86
|
+
"unit": "vitest run",
|
|
87
|
+
"unit:update": "vitest run -u",
|
|
88
|
+
"unit:watch": "vitest",
|
|
89
|
+
"unit:coverage": "vitest run --coverage",
|
|
90
|
+
"unit:coverage:html": "vitest run --coverage --coverage.reporter=html",
|
|
97
91
|
"ts:check": "tsc --noEmit --skipLibCheck",
|
|
98
92
|
"clean": "rimraf bin dist lib redocly-static",
|
|
99
93
|
"clear:cache": "scripts/clear-cache.sh",
|
|
@@ -102,8 +96,6 @@
|
|
|
102
96
|
"license:check": "npx license-checker --production --onlyAllow 'MIT;ISC;Apache-2.0;Apache;CC0-1.0;BSD;BSD-2-Clause;BSD-3-Clause;UNKNOWN' --summary",
|
|
103
97
|
"precdn:serve": "mkdir -p playground/cdn-test/server-dist && cp -Rf dist/* playground/cdn-test/server-dist && cp -Rf playground/cdn-test/template-source/* playground/cdn-test/server-dist",
|
|
104
98
|
"cdn-serve": "http-server playground/cdn-test/server-dist",
|
|
105
|
-
"copy-highlight-hook": "cp -r ../portal/src/client/app/hooks/codeHighlight ./playground/hooks"
|
|
106
|
-
"redoc:use-workspace": "node scripts/use-workspace-deps.js",
|
|
107
|
-
"redoc:revert-workspace": "node scripts/use-workspace-deps.js revert"
|
|
99
|
+
"copy-highlight-hook": "cp -r ../portal/src/client/app/hooks/codeHighlight ./playground/hooks"
|
|
108
100
|
}
|
|
109
101
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{render as s,fireEvent as l}from"@testing-library/react";import*as o from"jotai";import{SchemaCatalogLink as a}from"../SchemaCatalogLink";jest.mock("jotai",()=>({...jest.requireActual("jotai"),useAtomValue:jest.fn()})),jest.mock("../../../utils/dom",()=>({...jest.requireActual("../../../utils/dom"),IS_BROWSER:!0})),describe("SchemaCatalogLink",()=>{beforeEach(()=>{jest.clearAllMocks(),jest.useFakeTimers(),Object.defineProperty(global,"navigator",{value:{clipboard:{writeText:jest.fn()}},writable:!0})}),afterEach(()=>{jest.useRealTimers()}),it("should render correctly",()=>{jest.spyOn(o,"useAtomValue").mockReturnValue({parser:{definition:{"x-schema-catalog-link":"/_bundle/test.yaml"}}});const e=s(t(a,{schemaRef:"#/components/schemas/test"}));expect(e.baseElement).toMatchSnapshot()}),it("should not render if x-schema-catalog-link is not defined",()=>{jest.spyOn(o,"useAtomValue").mockReturnValue({parser:{definition:{}}});const e=s(t(a,{schemaRef:"#/components/schemas/test"}));expect(e.baseElement).toMatchSnapshot()}),it("should render correctly on server",()=>{jest.mock("../../../utils/dom",()=>({...jest.requireActual("../../../utils/dom"),IS_BROWSER:jest.fn().mockReturnValue(!1)})),jest.spyOn(o,"useAtomValue").mockReturnValue({parser:{definition:{"x-schema-catalog-link":"/_bundle/test.yaml"}}});const e=s(t(a,{schemaRef:"#/components/schemas/test"}));expect(e.baseElement).toMatchSnapshot()}),it("should copy link to clipboard when copy button is clicked",async()=>{jest.mock("../../../utils/dom",()=>({...jest.requireActual("../../../utils/dom"),IS_BROWSER:jest.fn().mockReturnValue(!0)})),jest.spyOn(o,"useAtomValue").mockReturnValue({parser:{definition:{"x-schema-catalog-link":"/_bundle/test.yaml"}}});const{getByRole:e,findByText:n}=s(t(a,{schemaRef:"#/components/schemas/test"})),c=e("button");l.click(c),expect(await n("Copied!")).toBeDefined()})});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function filterPropsDeep<T extends GenericObject>(component: T, paths: string[]): T;
|
package/lib/utils/test-utils.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{objectHas as n,objectSet as o}from"./object.js";function t(r,f){if(r&&(f(r),r.children))for(const e of r.children)t(e,f)}function s(r,f){return t(r,e=>{if(e.props)for(const i of f)n(e.props,i)&&o(e.props,i,"<<<filtered>>>")}),r}export{s as filterPropsDeep};
|