@stoplight/elements-core 9.0.25-beta-0.4 → 9.0.26-beta-0.0
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/components/Docs/Article/index.d.ts +2 -1
- package/components/Docs/HttpOperation/Body.d.ts +1 -0
- package/components/Docs/HttpOperation/Callbacks.d.ts +1 -0
- package/components/Docs/HttpOperation/HttpOperation.d.ts +2 -1
- package/components/Docs/HttpOperation/Responses.d.ts +1 -0
- package/components/Docs/HttpService/HttpService.d.ts +2 -1
- package/components/Docs/Model/Model.d.ts +2 -1
- package/components/Docs/Skeleton.d.ts +1 -0
- package/components/Docs/story-renderer-helper.d.ts +1 -0
- package/components/Layout/MobileTopNav.d.ts +1 -0
- package/components/Loading/Loading.d.ts +1 -0
- package/components/MarkdownViewer/CustomComponents/ReactRouterLink.d.ts +1 -0
- package/components/MarkdownViewer/CustomComponents/ResolvedImage.d.ts +1 -1
- package/components/MarkdownViewer/index.d.ts +1 -0
- package/components/ResponseExamples/ResponseExamples.d.ts +1 -0
- package/components/TableOfContents/types.d.ts +1 -0
- package/components/TryIt/Servers/ServersDropdown.d.ts +1 -0
- package/context/Persistence.d.ts +2 -2
- package/index.esm.js +5 -3
- package/index.js +5 -3
- package/index.mjs +5 -3
- package/package.json +2 -1
- package/styles.min.css +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IMarkdownViewerProps } from '@stoplight/markdown-viewer';
|
|
2
|
+
import * as React from 'react';
|
|
2
3
|
import { DocsComponentProps } from '..';
|
|
3
4
|
declare type ArticleProps = DocsComponentProps<IMarkdownViewerProps['markdown']>;
|
|
4
|
-
export declare const Article:
|
|
5
|
+
export declare const Article: React.FunctionComponent<ArticleProps & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
|
5
6
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { IHttpEndpointOperation } from '@stoplight/types';
|
|
2
|
+
import * as React from 'react';
|
|
2
3
|
import { DocsComponentProps } from '..';
|
|
3
4
|
export declare type HttpOperationProps = DocsComponentProps<IHttpEndpointOperation>;
|
|
4
|
-
export declare const HttpOperation:
|
|
5
|
+
export declare const HttpOperation: React.FunctionComponent<HttpOperationProps & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
|
5
6
|
export declare function OperationHeader({ id, noHeading, hasBadges, name, isDeprecated, isInternal, hideServerUrl, method, path, }: {
|
|
6
7
|
id: string;
|
|
7
8
|
noHeading?: boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IHttpService } from '@stoplight/types';
|
|
2
|
+
import * as React from 'react';
|
|
2
3
|
import { DocsComponentProps } from '..';
|
|
3
4
|
export declare type HttpServiceProps = DocsComponentProps<Partial<IHttpService>>;
|
|
4
|
-
export declare const HttpService:
|
|
5
|
+
export declare const HttpService: React.FunctionComponent<HttpServiceProps & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { JSONSchema7 } from 'json-schema';
|
|
2
|
+
import * as React from 'react';
|
|
2
3
|
import { DocsComponentProps } from '..';
|
|
3
4
|
export declare type ModelProps = DocsComponentProps<JSONSchema7>;
|
|
4
|
-
export declare const Model:
|
|
5
|
+
export declare const Model: React.FunctionComponent<ModelProps & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BundledBranchNode } from '../../../types';
|
|
3
|
-
export declare const createResolvedImageComponent: (branchNode: BundledBranchNode) => React.NamedExoticComponent<
|
|
3
|
+
export declare const createResolvedImageComponent: (branchNode: BundledBranchNode) => React.NamedExoticComponent<React.ImgHTMLAttributes<HTMLImageElement> & import("@stoplight/markdown/ast-types/hast").ImageProperties>;
|
package/context/Persistence.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare const PersistenceContextProvider: ({ initialValues, scope, children, }:
|
|
2
|
+
export declare const PersistenceContextProvider: ({ initialValues, scope, children, }: React.PropsWithChildren<{
|
|
3
3
|
initialValues?: Iterable<readonly [import("jotai").Atom<unknown>, unknown]> | undefined;
|
|
4
4
|
scope?: import("jotai/core/atom").Scope | undefined;
|
|
5
|
-
}>) =>
|
|
5
|
+
}>) => React.FunctionComponentElement<React.ProviderProps<import("jotai/core/contexts").ScopeContainer>>;
|
|
6
6
|
export declare function withPersistenceBoundary<T>(WrappedComponent: React.ComponentType<T>): React.FC<T>;
|
package/index.esm.js
CHANGED
|
@@ -39,6 +39,7 @@ import map from 'lodash/map.js';
|
|
|
39
39
|
import mapValues from 'lodash/mapValues.js';
|
|
40
40
|
import pickBy from 'lodash/pickBy.js';
|
|
41
41
|
import { CodeEditor } from '@stoplight/mosaic-code-editor';
|
|
42
|
+
import DOMPurify from 'dompurify';
|
|
42
43
|
import compact from 'lodash/compact.js';
|
|
43
44
|
import uniq from 'lodash/uniq.js';
|
|
44
45
|
import orderBy from 'lodash/orderBy.js';
|
|
@@ -2161,14 +2162,15 @@ const getQueryParams = ({ httpOperation, parameterValues, }) => {
|
|
|
2161
2162
|
function buildFetchRequest({ httpOperation, mediaTypeContent, bodyInput, parameterValues, serverVariableValues, mockData, auth, chosenServer, credentials = 'omit', corsProxy, }) {
|
|
2162
2163
|
var _a, _b, _c;
|
|
2163
2164
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2165
|
+
const sanitizedParameterValues = Object.fromEntries(Object.entries(parameterValues).map(([key, value]) => [key, DOMPurify.sanitize(value)]));
|
|
2164
2166
|
const serverUrl = getServerUrl({ httpOperation, mockData, chosenServer, corsProxy, serverVariableValues });
|
|
2165
2167
|
const shouldIncludeBody = ['PUT', 'POST', 'PATCH', 'DELETE'].includes(httpOperation.method.toUpperCase()) && bodyInput !== undefined;
|
|
2166
|
-
const queryParams = getQueryParams({ httpOperation, parameterValues });
|
|
2168
|
+
const queryParams = getQueryParams({ httpOperation, parameterValues: sanitizedParameterValues });
|
|
2167
2169
|
const rawHeaders = filterOutAuthorizationParams((_b = (_a = httpOperation.request) === null || _a === void 0 ? void 0 : _a.headers) !== null && _b !== void 0 ? _b : [], httpOperation.security)
|
|
2168
|
-
.map(header => { var _a; return ({ name: header.name, value: (_a =
|
|
2170
|
+
.map(header => { var _a; return ({ name: header.name, value: (_a = sanitizedParameterValues[header.name]) !== null && _a !== void 0 ? _a : '' }); })
|
|
2169
2171
|
.filter(({ value }) => value.length > 0);
|
|
2170
2172
|
const [queryParamsWithAuth, headersWithAuth] = runAuthRequestEhancements(auth, queryParams, rawHeaders);
|
|
2171
|
-
const expandedPath = uriExpand(httpOperation.path,
|
|
2173
|
+
const expandedPath = uriExpand(httpOperation.path, sanitizedParameterValues);
|
|
2172
2174
|
const urlObject = new URL(serverUrl + expandedPath);
|
|
2173
2175
|
urlObject.search = new URLSearchParams(queryParamsWithAuth.map(nameAndValueObjectToPair)).toString();
|
|
2174
2176
|
const body = typeof bodyInput === 'object' && !(bodyInput instanceof File)
|
package/index.js
CHANGED
|
@@ -39,6 +39,7 @@ var map = require('lodash/map.js');
|
|
|
39
39
|
var mapValues = require('lodash/mapValues.js');
|
|
40
40
|
var pickBy = require('lodash/pickBy.js');
|
|
41
41
|
var mosaicCodeEditor = require('@stoplight/mosaic-code-editor');
|
|
42
|
+
var DOMPurify = require('dompurify');
|
|
42
43
|
var compact = require('lodash/compact.js');
|
|
43
44
|
var uniq = require('lodash/uniq.js');
|
|
44
45
|
var orderBy = require('lodash/orderBy.js');
|
|
@@ -2182,14 +2183,15 @@ const getQueryParams = ({ httpOperation, parameterValues, }) => {
|
|
|
2182
2183
|
function buildFetchRequest({ httpOperation, mediaTypeContent, bodyInput, parameterValues, serverVariableValues, mockData, auth, chosenServer, credentials = 'omit', corsProxy, }) {
|
|
2183
2184
|
var _a, _b, _c;
|
|
2184
2185
|
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
2186
|
+
const sanitizedParameterValues = Object.fromEntries(Object.entries(parameterValues).map(([key, value]) => [key, DOMPurify.sanitize(value)]));
|
|
2185
2187
|
const serverUrl = getServerUrl({ httpOperation, mockData, chosenServer, corsProxy, serverVariableValues });
|
|
2186
2188
|
const shouldIncludeBody = ['PUT', 'POST', 'PATCH', 'DELETE'].includes(httpOperation.method.toUpperCase()) && bodyInput !== undefined;
|
|
2187
|
-
const queryParams = getQueryParams({ httpOperation, parameterValues });
|
|
2189
|
+
const queryParams = getQueryParams({ httpOperation, parameterValues: sanitizedParameterValues });
|
|
2188
2190
|
const rawHeaders = filterOutAuthorizationParams((_b = (_a = httpOperation.request) === null || _a === void 0 ? void 0 : _a.headers) !== null && _b !== void 0 ? _b : [], httpOperation.security)
|
|
2189
|
-
.map(header => { var _a; return ({ name: header.name, value: (_a =
|
|
2191
|
+
.map(header => { var _a; return ({ name: header.name, value: (_a = sanitizedParameterValues[header.name]) !== null && _a !== void 0 ? _a : '' }); })
|
|
2190
2192
|
.filter(({ value }) => value.length > 0);
|
|
2191
2193
|
const [queryParamsWithAuth, headersWithAuth] = runAuthRequestEhancements(auth, queryParams, rawHeaders);
|
|
2192
|
-
const expandedPath = uriExpand(httpOperation.path,
|
|
2194
|
+
const expandedPath = uriExpand(httpOperation.path, sanitizedParameterValues);
|
|
2193
2195
|
const urlObject = new URL(serverUrl + expandedPath);
|
|
2194
2196
|
urlObject.search = new URLSearchParams(queryParamsWithAuth.map(nameAndValueObjectToPair)).toString();
|
|
2195
2197
|
const body = typeof bodyInput === 'object' && !(bodyInput instanceof File)
|
package/index.mjs
CHANGED
|
@@ -39,6 +39,7 @@ import map from 'lodash/map.js';
|
|
|
39
39
|
import mapValues from 'lodash/mapValues.js';
|
|
40
40
|
import pickBy from 'lodash/pickBy.js';
|
|
41
41
|
import { CodeEditor } from '@stoplight/mosaic-code-editor';
|
|
42
|
+
import DOMPurify from 'dompurify';
|
|
42
43
|
import compact from 'lodash/compact.js';
|
|
43
44
|
import uniq from 'lodash/uniq.js';
|
|
44
45
|
import orderBy from 'lodash/orderBy.js';
|
|
@@ -2161,14 +2162,15 @@ const getQueryParams = ({ httpOperation, parameterValues, }) => {
|
|
|
2161
2162
|
function buildFetchRequest({ httpOperation, mediaTypeContent, bodyInput, parameterValues, serverVariableValues, mockData, auth, chosenServer, credentials = 'omit', corsProxy, }) {
|
|
2162
2163
|
var _a, _b, _c;
|
|
2163
2164
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2165
|
+
const sanitizedParameterValues = Object.fromEntries(Object.entries(parameterValues).map(([key, value]) => [key, DOMPurify.sanitize(value)]));
|
|
2164
2166
|
const serverUrl = getServerUrl({ httpOperation, mockData, chosenServer, corsProxy, serverVariableValues });
|
|
2165
2167
|
const shouldIncludeBody = ['PUT', 'POST', 'PATCH', 'DELETE'].includes(httpOperation.method.toUpperCase()) && bodyInput !== undefined;
|
|
2166
|
-
const queryParams = getQueryParams({ httpOperation, parameterValues });
|
|
2168
|
+
const queryParams = getQueryParams({ httpOperation, parameterValues: sanitizedParameterValues });
|
|
2167
2169
|
const rawHeaders = filterOutAuthorizationParams((_b = (_a = httpOperation.request) === null || _a === void 0 ? void 0 : _a.headers) !== null && _b !== void 0 ? _b : [], httpOperation.security)
|
|
2168
|
-
.map(header => { var _a; return ({ name: header.name, value: (_a =
|
|
2170
|
+
.map(header => { var _a; return ({ name: header.name, value: (_a = sanitizedParameterValues[header.name]) !== null && _a !== void 0 ? _a : '' }); })
|
|
2169
2171
|
.filter(({ value }) => value.length > 0);
|
|
2170
2172
|
const [queryParamsWithAuth, headersWithAuth] = runAuthRequestEhancements(auth, queryParams, rawHeaders);
|
|
2171
|
-
const expandedPath = uriExpand(httpOperation.path,
|
|
2173
|
+
const expandedPath = uriExpand(httpOperation.path, sanitizedParameterValues);
|
|
2172
2174
|
const urlObject = new URL(serverUrl + expandedPath);
|
|
2173
2175
|
urlObject.search = new URLSearchParams(queryParamsWithAuth.map(nameAndValueObjectToPair)).toString();
|
|
2174
2176
|
const body = typeof bodyInput === 'object' && !(bodyInput instanceof File)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stoplight/elements-core",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.26-beta-0.0",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"web-components.min.js",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"@stoplight/types": "^14.1.1",
|
|
41
41
|
"@stoplight/yaml": "^4.3.0",
|
|
42
42
|
"classnames": "^2.2.6",
|
|
43
|
+
"dompurify": "^3.4.15",
|
|
43
44
|
"httpsnippet-lite": "^3.0.5",
|
|
44
45
|
"jotai": "1.3.9",
|
|
45
46
|
"json-schema": "^0.4.0",
|