@asyncapi/react-component 1.0.0-next.41 → 1.0.0-next.43

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.
@@ -96,7 +96,7 @@ var Schema = function (_a) {
96
96
  schema.writeOnly() && (react_1.default.createElement("div", { className: "text-gray-500 text-xs" }, "write-only")),
97
97
  schema.readOnly() && (react_1.default.createElement("div", { className: "text-gray-500 text-xs" }, "read-only"))),
98
98
  rawValue ? (react_1.default.createElement("div", null,
99
- react_1.default.createElement("div", { className: "text-sm" }, schema.const()))) : (react_1.default.createElement("div", null,
99
+ react_1.default.createElement("div", { className: "text-sm" }, helpers_1.SchemaHelpers.prettifyValue(schema.const(), false)))) : (react_1.default.createElement("div", null,
100
100
  react_1.default.createElement("div", null,
101
101
  renderType && (react_1.default.createElement("div", { className: "capitalize text-sm text-teal-500 font-bold inline-block mr-2" }, isCircular ? "".concat(schemaType, " [CIRCULAR]") : schemaType)),
102
102
  react_1.default.createElement("div", { className: "inline-block" },
@@ -1 +1 @@
1
- {"version":3,"file":"Schema.js","sourceRoot":"","sources":["../../../src/components/Schema.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+D;AAG/D,iCAAqE;AACrE,sCAA2C;AAc3C,IAAM,aAAa,GAAG,eAAK,CAAC,aAAa,CAAC;IACxC,OAAO,EAAE,KAAK;IACd,YAAY,EAAE,KAAK;CACpB,CAAC,CAAC;AAEI,IAAM,MAAM,GAAmC,UAAC,EAUtD;QATC,UAAU,gBAAA,EACV,MAAM,YAAA,EACN,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,yBAAyB,EAAzB,iBAAiB,mBAAG,KAAK,KAAA,EACzB,kBAAkB,EAAlB,UAAU,mBAAG,KAAK,KAAA,EAClB,kBAAkB,EAAlB,UAAU,mBAAG,KAAK,KAAA,EAClB,iBAAiB,uBAAA,EACjB,gBAA8B,EAApB,YAAY,mBAAG,KAA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I,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC3C,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QAC3B,OAAO,IAAI,CAAC;KACb;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE;QAClC,OAAO,IAAI,CAAC;KACb;IAED,IAAM,eAAe,GAAG,MAAM,CAAC,eAAe,EAAS,CAAC;IACxD,IAAI,eAAe,KAAK,IAAI,IAAI,eAAe,KAAK,SAAS,EAAE;QAC7D,OAAO,CACL,qCAAG,SAAS,EAAC,4BAA4B,oCAErC,CACL,CAAC;KACH;IACD,IAAI,eAAe,KAAK,KAAK,EAAE;QAC7B,OAAO,CACL,qCAAG,SAAS,EAAC,4BAA4B;;YAClB,oDAAoB;wBACvC,CACL,CAAC;KACH;IACD,OAAO,8BAAC,cAAM,IAAC,UAAU,EAAC,mBAAmB,EAAC,MAAM,EAAE,eAAe,GAAI,CAAC;AAC5E,CAAC,CAAC","sourcesContent":["import React, { useState, useEffect, useContext } from 'react';\nimport { Schema as SchemaType } from '@asyncapi/parser';\n\nimport { Href, CollapseButton, Markdown, Extensions } from './index';\nimport { SchemaHelpers } from '../helpers';\n\ninterface Props {\n schemaName?: React.ReactNode;\n schema?: SchemaType;\n required?: boolean;\n isPatternProperty?: boolean;\n isProperty?: boolean;\n isCircular?: boolean;\n dependentRequired?: string[];\n expanded?: boolean;\n onlyTitle?: boolean;\n}\n\nconst SchemaContext = React.createContext({\n reverse: false,\n deepExpanded: false,\n});\n\nexport const Schema: React.FunctionComponent<Props> = ({\n schemaName,\n schema,\n required = false,\n isPatternProperty = false,\n isProperty = false,\n isCircular = false,\n dependentRequired,\n expanded: propExpanded = false,\n onlyTitle = false,\n}) => {\n const { reverse, deepExpanded } = useContext(SchemaContext);\n const [expanded, setExpanded] = useState(propExpanded);\n const [deepExpand, setDeepExpand] = useState(false);\n\n useEffect(() => {\n setDeepExpand(deepExpanded);\n }, [deepExpanded, setDeepExpand]);\n\n useEffect(() => {\n setExpanded(deepExpand);\n }, [deepExpand, setExpanded]);\n\n if (\n !schema ||\n (typeof schemaName === 'string' &&\n (schemaName?.startsWith('x-parser-') ||\n schemaName?.startsWith('x-schema-private-')))\n ) {\n return null;\n }\n\n const dependentSchemas = SchemaHelpers.getDependentSchemas(schema);\n\n const constraints = SchemaHelpers.humanizeConstraints(schema);\n const externalDocs = schema.externalDocs();\n\n const renderType = schema.ext(SchemaHelpers.extRenderType) !== false;\n const rawValue = schema.ext(SchemaHelpers.extRawValue) === true;\n const parameterLocation = schema.ext(SchemaHelpers.extParameterLocation);\n const isExpandable = SchemaHelpers.isExpandable(schema) || dependentSchemas;\n\n let schemaType = SchemaHelpers.toSchemaType(schema);\n isCircular =\n isCircular ||\n schema.isCircular() ||\n schema.ext('x-parser-circular') ||\n false;\n const uid = schema.uid();\n\n const schemaItems = schema.items();\n if (schemaItems && !Array.isArray(schemaItems)) {\n /**\n * fallback for older logic for circular references:\n *\n * checking uid for circular items\n * `x-parser-circular` extension is added to every schema which has circular `items` field,\n * so we must check that `items` is schema (not array of schemas) and infer UID of schema to display which schema is circular (by the name of schema)\n */\n isCircular =\n isCircular ||\n schemaItems.isCircular() ||\n schemaItems.ext('x-parser-circular') ||\n false;\n if (\n isCircular &&\n typeof (schemaItems as any).circularSchema === 'function'\n ) {\n schemaType = SchemaHelpers.toSchemaType(\n (schemaItems as any).circularSchema(),\n );\n }\n } else if (\n isCircular &&\n typeof (schema as any).circularSchema === 'function'\n ) {\n schemaType = SchemaHelpers.toSchemaType((schema as any).circularSchema());\n }\n\n const styledSchemaName = isProperty ? 'italic' : '';\n const renderedSchemaName =\n typeof schemaName === 'string' ? (\n <span className={`break-words text-sm ${styledSchemaName}`}>\n {schemaName}\n </span>\n ) : (\n schemaName\n );\n\n return (\n <SchemaContext.Provider\n value={{ reverse: !reverse, deepExpanded: deepExpand }}\n >\n <div>\n <div className=\"flex py-2\">\n <div className={`${onlyTitle ? '' : 'min-w-1/4'} mr-2`}>\n {isExpandable && !isCircular ? (\n <>\n <CollapseButton\n onClick={() => setExpanded(prev => !prev)}\n expanded={expanded}\n >\n {renderedSchemaName}\n </CollapseButton>\n <button\n type=\"button\"\n onClick={() => setDeepExpand(prev => !prev)}\n className=\"ml-1 text-sm text-gray-500\"\n >\n {deepExpand ? 'Collapse all' : 'Expand all'}\n </button>\n </>\n ) : (\n <span\n className={`break-words text-sm ${isProperty ? 'italic' : ''}`}\n >\n {schemaName}\n </span>\n )}\n {isPatternProperty && (\n <div className=\"text-gray-500 text-xs italic\">\n (pattern property)\n </div>\n )}\n {required && <div className=\"text-red-600 text-xs\">required</div>}\n {dependentRequired && (\n <>\n <div className=\"text-gray-500 text-xs\">\n required when defined:\n </div>\n <div className=\"text-red-600 text-xs\">\n {dependentRequired.join(', ')}\n </div>\n </>\n )}\n {schema.deprecated() && (\n <div className=\"text-red-600 text-xs\">deprecated</div>\n )}\n {schema.writeOnly() && (\n <div className=\"text-gray-500 text-xs\">write-only</div>\n )}\n {schema.readOnly() && (\n <div className=\"text-gray-500 text-xs\">read-only</div>\n )}\n </div>\n {rawValue ? (\n <div>\n <div className=\"text-sm\">{schema.const()}</div>\n </div>\n ) : (\n <div>\n <div>\n {renderType && (\n <div className=\"capitalize text-sm text-teal-500 font-bold inline-block mr-2\">\n {isCircular ? `${schemaType} [CIRCULAR]` : schemaType}\n </div>\n )}\n <div className=\"inline-block\">\n {schema.format() && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\">\n format: {schema.format()}\n </span>\n )}\n\n {/* related to string */}\n {schema.pattern() !== undefined && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded mr-2 p-1 text-xs\">\n must match: {schema.pattern()}\n </span>\n )}\n {schema.contentMediaType() !== undefined && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\">\n media type: {schema.contentMediaType()}\n </span>\n )}\n {schema.contentEncoding() !== undefined && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\">\n encoding: {schema.contentEncoding()}\n </span>\n )}\n\n {/* constraints */}\n {!!constraints.length &&\n constraints.map(c => (\n <span\n className=\"bg-purple-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\"\n key={c}\n >\n {c}\n </span>\n ))}\n\n {uid && !uid.startsWith('<anonymous-') && (\n <span className=\"border text-orange-600 rounded mr-2 p-1 text-xs\">\n uid: {uid}\n </span>\n )}\n </div>\n\n {schema.hasDescription() && (\n <div>\n <Markdown>{schema.description()}</Markdown>\n </div>\n )}\n\n {schema.default() !== undefined && (\n <div className=\"text-xs\">\n Default value:\n <span className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2\">\n {SchemaHelpers.prettifyValue(schema.default())}\n </span>\n </div>\n )}\n {schema.const() !== undefined && (\n <div className=\"text-xs\">\n Const:\n <span className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2\">\n {SchemaHelpers.prettifyValue(schema.const())}\n </span>\n </div>\n )}\n {schema.enum() && (\n <ul className=\"text-xs\">\n Allowed values:{' '}\n {schema.enum().map((e, idx) => (\n <li\n key={idx}\n className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2\"\n >\n <span>{SchemaHelpers.prettifyValue(e)}</span>\n </li>\n ))}\n </ul>\n )}\n {parameterLocation && (\n <div className=\"text-xs\">\n Parameter location:{' '}\n <span className=\"border text-orange-600 rounded mr-2 p-1 text-xs\">\n {parameterLocation}\n </span>\n </div>\n )}\n {externalDocs && (\n <span className=\"border border-solid border-orange-300 hover:bg-orange-300 hover:text-orange-600 text-orange-500 font-bold no-underline text-xs uppercase rounded px-2 py-0\">\n <Href\n href={externalDocs.url()}\n title={externalDocs.description() || ''}\n >\n Documentation\n </Href>\n </span>\n )}\n {schema.examples() && (\n <ul className=\"text-xs\">\n Examples values:{' '}\n {schema.examples().map((e, idx) => (\n <li\n key={idx}\n className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2 break-all\"\n >\n <span>{SchemaHelpers.prettifyValue(e)}</span>\n </li>\n ))}\n </ul>\n )}\n </div>\n </div>\n )}\n </div>\n\n {isCircular || !isExpandable ? null : (\n <div\n className={`rounded p-4 py-2 border bg-gray-100 ${\n reverse ? 'bg-gray-200' : ''\n } ${expanded ? 'block' : 'hidden'}`}\n >\n <SchemaProperties schema={schema} />\n <SchemaItems schema={schema} />\n\n {schema.oneOf() &&\n schema\n .oneOf()\n .map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={idx === 0 ? 'Adheres to:' : 'Or to:'}\n />\n ))}\n {schema.anyOf() &&\n schema\n .anyOf()\n .map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={idx === 0 ? 'Can adhere to:' : 'Or to:'}\n />\n ))}\n {schema.allOf() &&\n schema\n .allOf()\n .map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={idx === 0 ? 'Consists of:' : 'And with:'}\n />\n ))}\n {schema.not() && (\n <Schema schema={schema.not()} schemaName=\"Cannot adhere to:\" />\n )}\n\n {schema.propertyNames() && (\n <Schema\n schema={schema.propertyNames()}\n schemaName=\"Property names must adhere to:\"\n />\n )}\n {schema.contains() && (\n <Schema\n schema={schema.contains()}\n schemaName=\"Array must contain at least one of:\"\n />\n )}\n\n {schema.if() && (\n <Schema schema={schema.if()} schemaName=\"If schema adheres to:\" />\n )}\n {schema.then() && (\n <Schema\n schema={schema.then()}\n schemaName=\"Then must adhere to:\"\n />\n )}\n {schema.else() && (\n <Schema schema={schema.else()} schemaName=\"Otherwise:\" />\n )}\n\n {dependentSchemas && (\n <Schema\n schema={dependentSchemas}\n schemaName=\"Dependent schemas:\"\n />\n )}\n\n <Extensions item={schema} />\n\n <AdditionalProperties schema={schema} />\n <AdditionalItems schema={schema} />\n </div>\n )}\n </div>\n </SchemaContext.Provider>\n );\n};\n\ninterface SchemaPropertiesProps {\n schema: SchemaType;\n}\n\nconst SchemaProperties: React.FunctionComponent<SchemaPropertiesProps> = ({\n schema,\n}) => {\n const properties = schema.properties() || {};\n if (!Object.keys(properties)) {\n return null;\n }\n\n const required = schema.required() || [];\n const patternProperties = schema.patternProperties();\n const circularProps = schema.ext('x-parser-circular-props') || [];\n\n return (\n <>\n {Object.entries(properties).map(([propertyName, property]) => (\n <Schema\n schema={property}\n schemaName={propertyName}\n required={required.includes(propertyName)}\n isProperty={true}\n isCircular={circularProps.includes(propertyName)}\n dependentRequired={SchemaHelpers.getDependentRequired(\n propertyName,\n schema,\n )}\n key={propertyName}\n />\n ))}\n {Object.entries(patternProperties).map(([propertyName, property]) => (\n <Schema\n schema={property}\n schemaName={propertyName}\n isPatternProperty={true}\n isProperty={true}\n isCircular={circularProps.includes(propertyName)}\n key={propertyName}\n />\n ))}\n </>\n );\n};\n\ninterface AdditionalPropertiesProps {\n schema: SchemaType;\n}\n\nconst AdditionalProperties: React.FunctionComponent<AdditionalPropertiesProps> = ({\n schema,\n}) => {\n if (schema.ext(SchemaHelpers.extRenderAdditionalInfo) === false) {\n return null;\n }\n\n let type = schema.type();\n type = Array.isArray(type) ? type : [type];\n if (!type.includes('object')) {\n return null;\n }\n\n const additionalProperties = schema.additionalProperties();\n if (additionalProperties === true || additionalProperties === undefined) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional properties are allowed.\n </p>\n );\n }\n if (additionalProperties === false) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional properties are <strong>NOT</strong> allowed.\n </p>\n );\n }\n return (\n <Schema schemaName=\"Additional properties:\" schema={additionalProperties} />\n );\n};\n\ninterface SchemaItemsProps {\n schema: SchemaType;\n}\n\nconst SchemaItems: React.FunctionComponent<SchemaItemsProps> = ({ schema }) => {\n let type = schema.type();\n type = Array.isArray(type) ? type : [type];\n if (!type.includes('array')) {\n return null;\n }\n const items = schema.items();\n\n // object in items\n if (\n items &&\n !Array.isArray(items) &&\n Object.keys(items.properties() || {}).length\n ) {\n return <SchemaProperties schema={items} />;\n } else if (Array.isArray(items)) {\n return (\n <>\n {items.map((item, idx) => (\n <Schema schema={item} schemaName={`${idx + 1} item:`} key={idx} />\n ))}\n </>\n );\n }\n return <Schema schema={items} schemaName=\"Items:\" />;\n};\n\ninterface AdditionalItemsProps {\n schema: SchemaType;\n}\n\nconst AdditionalItems: React.FunctionComponent<AdditionalItemsProps> = ({\n schema,\n}) => {\n if (schema.ext(SchemaHelpers.extRenderAdditionalInfo) === false) {\n return null;\n }\n\n let type = schema.type();\n type = Array.isArray(type) ? type : [type];\n if (!type.includes('array')) {\n return null;\n }\n if (!Array.isArray(schema.items())) {\n return null;\n }\n\n const additionalItems = schema.additionalItems() as any;\n if (additionalItems === true || additionalItems === undefined) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional items are allowed.\n </p>\n );\n }\n if (additionalItems === false) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional items are <strong>NOT</strong> allowed.\n </p>\n );\n }\n return <Schema schemaName=\"Additional items:\" schema={additionalItems} />;\n};\n"]}
1
+ {"version":3,"file":"Schema.js","sourceRoot":"","sources":["../../../src/components/Schema.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+D;AAG/D,iCAAqE;AACrE,sCAA2C;AAc3C,IAAM,aAAa,GAAG,eAAK,CAAC,aAAa,CAAC;IACxC,OAAO,EAAE,KAAK;IACd,YAAY,EAAE,KAAK;CACpB,CAAC,CAAC;AAEI,IAAM,MAAM,GAAmC,UAAC,EAUtD;QATC,UAAU,gBAAA,EACV,MAAM,YAAA,EACN,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,yBAAyB,EAAzB,iBAAiB,mBAAG,KAAK,KAAA,EACzB,kBAAkB,EAAlB,UAAU,mBAAG,KAAK,KAAA,EAClB,kBAAkB,EAAlB,UAAU,mBAAG,KAAK,KAAA,EAClB,iBAAiB,uBAAA,E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;IACzB,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC3C,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QAC3B,OAAO,IAAI,CAAC;KACb;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE;QAClC,OAAO,IAAI,CAAC;KACb;IAED,IAAM,eAAe,GAAG,MAAM,CAAC,eAAe,EAAS,CAAC;IACxD,IAAI,eAAe,KAAK,IAAI,IAAI,eAAe,KAAK,SAAS,EAAE;QAC7D,OAAO,CACL,qCAAG,SAAS,EAAC,4BAA4B,oCAErC,CACL,CAAC;KACH;IACD,IAAI,eAAe,KAAK,KAAK,EAAE;QAC7B,OAAO,CACL,qCAAG,SAAS,EAAC,4BAA4B;;YAClB,oDAAoB;wBACvC,CACL,CAAC;KACH;IACD,OAAO,8BAAC,cAAM,IAAC,UAAU,EAAC,mBAAmB,EAAC,MAAM,EAAE,eAAe,GAAI,CAAC;AAC5E,CAAC,CAAC","sourcesContent":["import React, { useState, useEffect, useContext } from 'react';\nimport { Schema as SchemaType } from '@asyncapi/parser';\n\nimport { Href, CollapseButton, Markdown, Extensions } from './index';\nimport { SchemaHelpers } from '../helpers';\n\ninterface Props {\n schemaName?: React.ReactNode;\n schema?: SchemaType;\n required?: boolean;\n isPatternProperty?: boolean;\n isProperty?: boolean;\n isCircular?: boolean;\n dependentRequired?: string[];\n expanded?: boolean;\n onlyTitle?: boolean;\n}\n\nconst SchemaContext = React.createContext({\n reverse: false,\n deepExpanded: false,\n});\n\nexport const Schema: React.FunctionComponent<Props> = ({\n schemaName,\n schema,\n required = false,\n isPatternProperty = false,\n isProperty = false,\n isCircular = false,\n dependentRequired,\n expanded: propExpanded = false,\n onlyTitle = false,\n}) => {\n const { reverse, deepExpanded } = useContext(SchemaContext);\n const [expanded, setExpanded] = useState(propExpanded);\n const [deepExpand, setDeepExpand] = useState(false);\n\n useEffect(() => {\n setDeepExpand(deepExpanded);\n }, [deepExpanded, setDeepExpand]);\n\n useEffect(() => {\n setExpanded(deepExpand);\n }, [deepExpand, setExpanded]);\n\n if (\n !schema ||\n (typeof schemaName === 'string' &&\n (schemaName?.startsWith('x-parser-') ||\n schemaName?.startsWith('x-schema-private-')))\n ) {\n return null;\n }\n\n const dependentSchemas = SchemaHelpers.getDependentSchemas(schema);\n\n const constraints = SchemaHelpers.humanizeConstraints(schema);\n const externalDocs = schema.externalDocs();\n\n const renderType = schema.ext(SchemaHelpers.extRenderType) !== false;\n const rawValue = schema.ext(SchemaHelpers.extRawValue) === true;\n const parameterLocation = schema.ext(SchemaHelpers.extParameterLocation);\n const isExpandable = SchemaHelpers.isExpandable(schema) || dependentSchemas;\n\n let schemaType = SchemaHelpers.toSchemaType(schema);\n isCircular =\n isCircular ||\n schema.isCircular() ||\n schema.ext('x-parser-circular') ||\n false;\n const uid = schema.uid();\n\n const schemaItems = schema.items();\n if (schemaItems && !Array.isArray(schemaItems)) {\n /**\n * fallback for older logic for circular references:\n *\n * checking uid for circular items\n * `x-parser-circular` extension is added to every schema which has circular `items` field,\n * so we must check that `items` is schema (not array of schemas) and infer UID of schema to display which schema is circular (by the name of schema)\n */\n isCircular =\n isCircular ||\n schemaItems.isCircular() ||\n schemaItems.ext('x-parser-circular') ||\n false;\n if (\n isCircular &&\n typeof (schemaItems as any).circularSchema === 'function'\n ) {\n schemaType = SchemaHelpers.toSchemaType(\n (schemaItems as any).circularSchema(),\n );\n }\n } else if (\n isCircular &&\n typeof (schema as any).circularSchema === 'function'\n ) {\n schemaType = SchemaHelpers.toSchemaType((schema as any).circularSchema());\n }\n\n const styledSchemaName = isProperty ? 'italic' : '';\n const renderedSchemaName =\n typeof schemaName === 'string' ? (\n <span className={`break-words text-sm ${styledSchemaName}`}>\n {schemaName}\n </span>\n ) : (\n schemaName\n );\n\n return (\n <SchemaContext.Provider\n value={{ reverse: !reverse, deepExpanded: deepExpand }}\n >\n <div>\n <div className=\"flex py-2\">\n <div className={`${onlyTitle ? '' : 'min-w-1/4'} mr-2`}>\n {isExpandable && !isCircular ? (\n <>\n <CollapseButton\n onClick={() => setExpanded(prev => !prev)}\n expanded={expanded}\n >\n {renderedSchemaName}\n </CollapseButton>\n <button\n type=\"button\"\n onClick={() => setDeepExpand(prev => !prev)}\n className=\"ml-1 text-sm text-gray-500\"\n >\n {deepExpand ? 'Collapse all' : 'Expand all'}\n </button>\n </>\n ) : (\n <span\n className={`break-words text-sm ${isProperty ? 'italic' : ''}`}\n >\n {schemaName}\n </span>\n )}\n {isPatternProperty && (\n <div className=\"text-gray-500 text-xs italic\">\n (pattern property)\n </div>\n )}\n {required && <div className=\"text-red-600 text-xs\">required</div>}\n {dependentRequired && (\n <>\n <div className=\"text-gray-500 text-xs\">\n required when defined:\n </div>\n <div className=\"text-red-600 text-xs\">\n {dependentRequired.join(', ')}\n </div>\n </>\n )}\n {schema.deprecated() && (\n <div className=\"text-red-600 text-xs\">deprecated</div>\n )}\n {schema.writeOnly() && (\n <div className=\"text-gray-500 text-xs\">write-only</div>\n )}\n {schema.readOnly() && (\n <div className=\"text-gray-500 text-xs\">read-only</div>\n )}\n </div>\n {rawValue ? (\n <div>\n <div className=\"text-sm\">\n {SchemaHelpers.prettifyValue(schema.const(), false)}\n </div>\n </div>\n ) : (\n <div>\n <div>\n {renderType && (\n <div className=\"capitalize text-sm text-teal-500 font-bold inline-block mr-2\">\n {isCircular ? `${schemaType} [CIRCULAR]` : schemaType}\n </div>\n )}\n <div className=\"inline-block\">\n {schema.format() && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\">\n format: {schema.format()}\n </span>\n )}\n\n {/* related to string */}\n {schema.pattern() !== undefined && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded mr-2 p-1 text-xs\">\n must match: {schema.pattern()}\n </span>\n )}\n {schema.contentMediaType() !== undefined && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\">\n media type: {schema.contentMediaType()}\n </span>\n )}\n {schema.contentEncoding() !== undefined && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\">\n encoding: {schema.contentEncoding()}\n </span>\n )}\n\n {/* constraints */}\n {!!constraints.length &&\n constraints.map(c => (\n <span\n className=\"bg-purple-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\"\n key={c}\n >\n {c}\n </span>\n ))}\n\n {uid && !uid.startsWith('<anonymous-') && (\n <span className=\"border text-orange-600 rounded mr-2 p-1 text-xs\">\n uid: {uid}\n </span>\n )}\n </div>\n\n {schema.hasDescription() && (\n <div>\n <Markdown>{schema.description()}</Markdown>\n </div>\n )}\n\n {schema.default() !== undefined && (\n <div className=\"text-xs\">\n Default value:\n <span className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2\">\n {SchemaHelpers.prettifyValue(schema.default())}\n </span>\n </div>\n )}\n {schema.const() !== undefined && (\n <div className=\"text-xs\">\n Const:\n <span className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2\">\n {SchemaHelpers.prettifyValue(schema.const())}\n </span>\n </div>\n )}\n {schema.enum() && (\n <ul className=\"text-xs\">\n Allowed values:{' '}\n {schema.enum().map((e, idx) => (\n <li\n key={idx}\n className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2\"\n >\n <span>{SchemaHelpers.prettifyValue(e)}</span>\n </li>\n ))}\n </ul>\n )}\n {parameterLocation && (\n <div className=\"text-xs\">\n Parameter location:{' '}\n <span className=\"border text-orange-600 rounded mr-2 p-1 text-xs\">\n {parameterLocation}\n </span>\n </div>\n )}\n {externalDocs && (\n <span className=\"border border-solid border-orange-300 hover:bg-orange-300 hover:text-orange-600 text-orange-500 font-bold no-underline text-xs uppercase rounded px-2 py-0\">\n <Href\n href={externalDocs.url()}\n title={externalDocs.description() || ''}\n >\n Documentation\n </Href>\n </span>\n )}\n {schema.examples() && (\n <ul className=\"text-xs\">\n Examples values:{' '}\n {schema.examples().map((e, idx) => (\n <li\n key={idx}\n className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2 break-all\"\n >\n <span>{SchemaHelpers.prettifyValue(e)}</span>\n </li>\n ))}\n </ul>\n )}\n </div>\n </div>\n )}\n </div>\n\n {isCircular || !isExpandable ? null : (\n <div\n className={`rounded p-4 py-2 border bg-gray-100 ${\n reverse ? 'bg-gray-200' : ''\n } ${expanded ? 'block' : 'hidden'}`}\n >\n <SchemaProperties schema={schema} />\n <SchemaItems schema={schema} />\n\n {schema.oneOf() &&\n schema\n .oneOf()\n .map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={idx === 0 ? 'Adheres to:' : 'Or to:'}\n />\n ))}\n {schema.anyOf() &&\n schema\n .anyOf()\n .map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={idx === 0 ? 'Can adhere to:' : 'Or to:'}\n />\n ))}\n {schema.allOf() &&\n schema\n .allOf()\n .map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={idx === 0 ? 'Consists of:' : 'And with:'}\n />\n ))}\n {schema.not() && (\n <Schema schema={schema.not()} schemaName=\"Cannot adhere to:\" />\n )}\n\n {schema.propertyNames() && (\n <Schema\n schema={schema.propertyNames()}\n schemaName=\"Property names must adhere to:\"\n />\n )}\n {schema.contains() && (\n <Schema\n schema={schema.contains()}\n schemaName=\"Array must contain at least one of:\"\n />\n )}\n\n {schema.if() && (\n <Schema schema={schema.if()} schemaName=\"If schema adheres to:\" />\n )}\n {schema.then() && (\n <Schema\n schema={schema.then()}\n schemaName=\"Then must adhere to:\"\n />\n )}\n {schema.else() && (\n <Schema schema={schema.else()} schemaName=\"Otherwise:\" />\n )}\n\n {dependentSchemas && (\n <Schema\n schema={dependentSchemas}\n schemaName=\"Dependent schemas:\"\n />\n )}\n\n <Extensions item={schema} />\n\n <AdditionalProperties schema={schema} />\n <AdditionalItems schema={schema} />\n </div>\n )}\n </div>\n </SchemaContext.Provider>\n );\n};\n\ninterface SchemaPropertiesProps {\n schema: SchemaType;\n}\n\nconst SchemaProperties: React.FunctionComponent<SchemaPropertiesProps> = ({\n schema,\n}) => {\n const properties = schema.properties() || {};\n if (!Object.keys(properties)) {\n return null;\n }\n\n const required = schema.required() || [];\n const patternProperties = schema.patternProperties();\n const circularProps = schema.ext('x-parser-circular-props') || [];\n\n return (\n <>\n {Object.entries(properties).map(([propertyName, property]) => (\n <Schema\n schema={property}\n schemaName={propertyName}\n required={required.includes(propertyName)}\n isProperty={true}\n isCircular={circularProps.includes(propertyName)}\n dependentRequired={SchemaHelpers.getDependentRequired(\n propertyName,\n schema,\n )}\n key={propertyName}\n />\n ))}\n {Object.entries(patternProperties).map(([propertyName, property]) => (\n <Schema\n schema={property}\n schemaName={propertyName}\n isPatternProperty={true}\n isProperty={true}\n isCircular={circularProps.includes(propertyName)}\n key={propertyName}\n />\n ))}\n </>\n );\n};\n\ninterface AdditionalPropertiesProps {\n schema: SchemaType;\n}\n\nconst AdditionalProperties: React.FunctionComponent<AdditionalPropertiesProps> = ({\n schema,\n}) => {\n if (schema.ext(SchemaHelpers.extRenderAdditionalInfo) === false) {\n return null;\n }\n\n let type = schema.type();\n type = Array.isArray(type) ? type : [type];\n if (!type.includes('object')) {\n return null;\n }\n\n const additionalProperties = schema.additionalProperties();\n if (additionalProperties === true || additionalProperties === undefined) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional properties are allowed.\n </p>\n );\n }\n if (additionalProperties === false) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional properties are <strong>NOT</strong> allowed.\n </p>\n );\n }\n return (\n <Schema schemaName=\"Additional properties:\" schema={additionalProperties} />\n );\n};\n\ninterface SchemaItemsProps {\n schema: SchemaType;\n}\n\nconst SchemaItems: React.FunctionComponent<SchemaItemsProps> = ({ schema }) => {\n let type = schema.type();\n type = Array.isArray(type) ? type : [type];\n if (!type.includes('array')) {\n return null;\n }\n const items = schema.items();\n\n // object in items\n if (\n items &&\n !Array.isArray(items) &&\n Object.keys(items.properties() || {}).length\n ) {\n return <SchemaProperties schema={items} />;\n } else if (Array.isArray(items)) {\n return (\n <>\n {items.map((item, idx) => (\n <Schema schema={item} schemaName={`${idx + 1} item:`} key={idx} />\n ))}\n </>\n );\n }\n return <Schema schema={items} schemaName=\"Items:\" />;\n};\n\ninterface AdditionalItemsProps {\n schema: SchemaType;\n}\n\nconst AdditionalItems: React.FunctionComponent<AdditionalItemsProps> = ({\n schema,\n}) => {\n if (schema.ext(SchemaHelpers.extRenderAdditionalInfo) === false) {\n return null;\n }\n\n let type = schema.type();\n type = Array.isArray(type) ? type : [type];\n if (!type.includes('array')) {\n return null;\n }\n if (!Array.isArray(schema.items())) {\n return null;\n }\n\n const additionalItems = schema.additionalItems() as any;\n if (additionalItems === true || additionalItems === undefined) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional items are allowed.\n </p>\n );\n }\n if (additionalItems === false) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional items are <strong>NOT</strong> allowed.\n </p>\n );\n }\n return <Schema schemaName=\"Additional items:\" schema={additionalItems} />;\n};\n"]}
@@ -34,7 +34,10 @@ var Server = function (_a) {
34
34
  react_1.default.createElement("div", { id: "".concat(helpers_1.CommonHelpers.getIdentifier("server-".concat(serverName, "-security"), config)) },
35
35
  react_1.default.createElement(Security_1.Security, { protocol: server.protocol(), security: security })),
36
36
  server.hasBindings() && (react_1.default.createElement("div", { className: "mt-2" },
37
- react_1.default.createElement(components_1.Bindings, { name: "Server specific information", bindings: server.bindings() }))))),
37
+ react_1.default.createElement(components_1.Bindings, { name: "Server specific information", bindings: server.bindings() }))),
38
+ react_1.default.createElement(components_1.Extensions, { name: "Server Extensions", item: server }),
39
+ typeof server.hasTags === 'function' && server.hasTags() && (react_1.default.createElement("div", { className: "mt-2" },
40
+ react_1.default.createElement(components_1.Tags, { tags: server.tags() }))))),
38
41
  react_1.default.createElement("div", { className: "panel-item--right" })));
39
42
  };
40
43
  exports.Server = Server;
@@ -1 +1 @@
1
- {"version":3,"file":"Server.js","sourceRoot":"","sources":["../../../../src/containers/Servers/Server.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAG1B,uCAAsC;AACtC,+CAA8D;AAE9D,2CAA2C;AAC3C,yCAA6D;AAOtD,IAAM,MAAM,GAAmC,UAAC,EAGtD;QAFC,UAAU,gBAAA,EACV,MAAM,YAAA;IAEN,IAAM,MAAM,GAAG,IAAA,oBAAS,GAAE,CAAC;IAE3B,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,IAAI,CAAC;KACb;IAED,IAAM,YAAY,GAAG,uBAAa,CAAC,uBAAuB,CACxD,MAAM,CAAC,SAAS,EAAE,CACnB,CAAC;IACF,IAAM,eAAe,GAAG,MAAM,CAAC,eAAe,EAAE,CAAC;IACjD,IAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IAEnC,OAAO,CACL,uCAAK,SAAS,EAAC,YAAY;QACzB,uCAAK,SAAS,EAAC,yBAAyB;YACtC,uCAAK,SAAS,EAAC,mDAAmD;gBAChE;oBACE,wCAAM,SAAS,EAAC,qBAAqB,IAAE,MAAM,CAAC,GAAG,EAAE,CAAQ;oBAC3D,wCAAM,SAAS,EAAC,wFAAwF,IACrG,eAAe;wBACd,CAAC,CAAC,UAAG,MAAM,CAAC,QAAQ,EAAE,cAAI,eAAe,CAAE;wBAC3C,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAChB;oBACP,wCAAM,SAAS,EAAC,mFAAmF,IAChG,UAAU,CACN,CACH;gBAEL,MAAM,CAAC,cAAc,EAAE,IAAI,CAC1B,uCAAK,SAAS,EAAC,MAAM;oBACnB,8BAAC,qBAAQ,QAAE,MAAM,CAAC,WAAW,EAAE,CAAY,CACvC,CACP;gBAEA,YAAY,IAAI,CACf,uCACE,SAAS,EAAC,MAAM,EAChB,EAAE,EAAE,UAAG,uBAAa,CAAC,aAAa,CAChC,iBAAU,UAAU,mBAAgB,EACpC,MAAM,CACP,CAAE;oBAEH,8BAAC,mBAAM,IACL,UAAU,EAAC,eAAe,EAC1B,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,IAAI,GACd,CACE,CACP;gBAGC,uCACE,EAAE,EAAE,UAAG,uBAAa,CAAC,aAAa,CAChC,iBAAU,UAAU,cAAW,EAC/B,MAAM,CACP,CAAE;oBAEH,8BAAC,mBAAQ,IAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,QAAQ,GAAI,CACzD;gBAGP,MAAM,CAAC,WAAW,EAAE,IAAI,CACvB,uCAAK,SAAS,EAAC,MAAM;oBACnB,8BAAC,qBAAQ,IACP,IAAI,EAAC,6BAA6B,EAClC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,GAC3B,CACE,CACP,CACG,CACF;QAEN,uCAAK,SAAS,EAAC,mBAAmB,GAAG,CACjC,CACP,CAAC;AACJ,CAAC,CAAC;AA/EW,QAAA,MAAM,UA+EjB","sourcesContent":["import React from 'react';\nimport { Server as ServerType } from '@asyncapi/parser';\n\nimport { Security } from './Security';\nimport { Markdown, Schema, Bindings } from '../../components';\n\nimport { useConfig } from '../../contexts';\nimport { CommonHelpers, SchemaHelpers } from '../../helpers';\n\ninterface Props {\n serverName: string;\n server: ServerType;\n}\n\nexport const Server: React.FunctionComponent<Props> = ({\n serverName,\n server,\n}) => {\n const config = useConfig();\n\n if (!server) {\n return null;\n }\n\n const urlVariables = SchemaHelpers.serverVariablesToSchema(\n server.variables(),\n );\n const protocolVersion = server.protocolVersion();\n const security = server.security();\n\n return (\n <div className=\"panel-item\">\n <div className=\"panel-item--center px-8\">\n <div className=\"shadow rounded bg-gray-200 p-4 border bg-gray-100\">\n <div>\n <span className=\"font-mono text-base\">{server.url()}</span>\n <span className=\"bg-teal-500 font-bold no-underline text-white uppercase rounded mx-2 px-2 py-1 text-sm\">\n {protocolVersion\n ? `${server.protocol()} ${protocolVersion}`\n : server.protocol()}\n </span>\n <span className=\"bg-blue-500 font-bold no-underline text-white uppercase rounded px-2 py-1 text-sm\">\n {serverName}\n </span>\n </div>\n\n {server.hasDescription() && (\n <div className=\"mt-2\">\n <Markdown>{server.description()}</Markdown>\n </div>\n )}\n\n {urlVariables && (\n <div\n className=\"mt-2\"\n id={`${CommonHelpers.getIdentifier(\n `server-${serverName}-url-variables`,\n config,\n )}`}\n >\n <Schema\n schemaName=\"URL Variables\"\n schema={urlVariables}\n expanded={true}\n />\n </div>\n )}\n\n {\n <div\n id={`${CommonHelpers.getIdentifier(\n `server-${serverName}-security`,\n config,\n )}`}\n >\n <Security protocol={server.protocol()} security={security} />\n </div>\n }\n\n {server.hasBindings() && (\n <div className=\"mt-2\">\n <Bindings\n name=\"Server specific information\"\n bindings={server.bindings()}\n />\n </div>\n )}\n </div>\n </div>\n\n <div className=\"panel-item--right\" />\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"Server.js","sourceRoot":"","sources":["../../../../src/containers/Servers/Server.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAG1B,uCAAsC;AACtC,+CAAgF;AAEhF,2CAA2C;AAC3C,yCAA6D;AAOtD,IAAM,MAAM,GAAmC,UAAC,EAGtD;QAFC,UAAU,gBAAA,EACV,MAAM,YAAA;IAEN,IAAM,MAAM,GAAG,IAAA,oBAAS,GAAE,CAAC;IAE3B,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,IAAI,CAAC;KACb;IAED,IAAM,YAAY,GAAG,uBAAa,CAAC,uBAAuB,CACxD,MAAM,CAAC,SAAS,EAAE,CACnB,CAAC;IACF,IAAM,eAAe,GAAG,MAAM,CAAC,eAAe,EAAE,CAAC;IACjD,IAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IAEnC,OAAO,CACL,uCAAK,SAAS,EAAC,YAAY;QACzB,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M,CAAC,OAAO,KAAK,UAAU,IAAI,MAAM,CAAC,OAAO,EAAE,IAAI,CAC3D,uCAAK,SAAS,EAAC,MAAM;oBACnB,8BAAC,iBAAI,IAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,GAAI,CACzB,CACP,CACG,CACF;QAEN,uCAAK,SAAS,EAAC,mBAAmB,GAAG,CACjC,CACP,CAAC;AACJ,CAAC,CAAC;AAvFW,QAAA,MAAM,UAuFjB","sourcesContent":["import React from 'react';\nimport { Server as ServerType } from '@asyncapi/parser';\n\nimport { Security } from './Security';\nimport { Markdown, Schema, Bindings, Tags, Extensions } from '../../components';\n\nimport { useConfig } from '../../contexts';\nimport { CommonHelpers, SchemaHelpers } from '../../helpers';\n\ninterface Props {\n serverName: string;\n server: ServerType;\n}\n\nexport const Server: React.FunctionComponent<Props> = ({\n serverName,\n server,\n}) => {\n const config = useConfig();\n\n if (!server) {\n return null;\n }\n\n const urlVariables = SchemaHelpers.serverVariablesToSchema(\n server.variables(),\n );\n const protocolVersion = server.protocolVersion();\n const security = server.security();\n\n return (\n <div className=\"panel-item\">\n <div className=\"panel-item--center px-8\">\n <div className=\"shadow rounded bg-gray-200 p-4 border bg-gray-100\">\n <div>\n <span className=\"font-mono text-base\">{server.url()}</span>\n <span className=\"bg-teal-500 font-bold no-underline text-white uppercase rounded mx-2 px-2 py-1 text-sm\">\n {protocolVersion\n ? `${server.protocol()} ${protocolVersion}`\n : server.protocol()}\n </span>\n <span className=\"bg-blue-500 font-bold no-underline text-white uppercase rounded px-2 py-1 text-sm\">\n {serverName}\n </span>\n </div>\n\n {server.hasDescription() && (\n <div className=\"mt-2\">\n <Markdown>{server.description()}</Markdown>\n </div>\n )}\n\n {urlVariables && (\n <div\n className=\"mt-2\"\n id={`${CommonHelpers.getIdentifier(\n `server-${serverName}-url-variables`,\n config,\n )}`}\n >\n <Schema\n schemaName=\"URL Variables\"\n schema={urlVariables}\n expanded={true}\n />\n </div>\n )}\n\n {\n <div\n id={`${CommonHelpers.getIdentifier(\n `server-${serverName}-security`,\n config,\n )}`}\n >\n <Security protocol={server.protocol()} security={security} />\n </div>\n }\n\n {server.hasBindings() && (\n <div className=\"mt-2\">\n <Bindings\n name=\"Server specific information\"\n bindings={server.bindings()}\n />\n </div>\n )}\n\n <Extensions name=\"Server Extensions\" item={server} />\n\n {typeof server.hasTags === 'function' && server.hasTags() && (\n <div className=\"mt-2\">\n <Tags tags={server.tags()} />\n </div>\n )}\n </div>\n </div>\n\n <div className=\"panel-item--right\" />\n </div>\n );\n};\n"]}
@@ -85,13 +85,14 @@ var SchemaHelpers = (function () {
85
85
  }
86
86
  return type;
87
87
  };
88
- SchemaHelpers.prettifyValue = function (value) {
88
+ SchemaHelpers.prettifyValue = function (value, strict) {
89
+ if (strict === void 0) { strict = true; }
89
90
  var typeOf = typeof value;
90
91
  if (typeOf === 'string') {
91
- return "\"".concat(value, "\"");
92
+ return strict ? "\"".concat(value, "\"") : value;
92
93
  }
93
94
  if (typeOf === 'number' || typeOf === 'bigint' || typeOf === 'boolean') {
94
- return value;
95
+ return "".concat(value);
95
96
  }
96
97
  if (Array.isArray(value)) {
97
98
  return "[".concat(value.toString(), "]");
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/helpers/schema.ts"],"names":[],"mappings":";;;;;;AAEA,8EAA6D;AAE7D,IAAY,iBASX;AATD,WAAY,iBAAiB;IAE3B,gCAAW,CAAA;IAEX,sDAAiC,CAAA;IAEjC,oCAAe,CAAA;IAEf,wCAAmB,CAAA;AACrB,CAAC,EATW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAS5B;AAED,IAAM,eAAe,GAAG;IACtB,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,SAAS;IACT,OAAO;IACP,QAAQ;IACR,MAAM;CACP,CAAC;AACF,IAAM,sBAAsB,GAA2B;IAErD,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,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,CAAC;IA6dtE,oBAAC;CAAA,AAjeD,IAieC;AAjeY,sCAAa","sourcesContent":["import { ChannelParameter, ServerVariable, Schema } from '@asyncapi/parser';\n// @ts-ignore\nimport SchemaClass from '@asyncapi/parser/lib/models/schema';\n\nexport enum SchemaCustomTypes {\n // for `true` and `{}` schemas\n ANY = 'any',\n // for schemas without `type` keyword\n RESTRICTED_ANY = 'restricted any',\n // for `false` and `{ not: {}, ... }` schemas\n NEVER = 'never',\n // for types that we cannot infer\n UNKNOWN = 'unknown',\n}\n\nconst jsonSchemaTypes = [\n 'string',\n 'number',\n 'integer',\n 'boolean',\n 'array',\n 'object',\n 'null',\n];\nconst jsonSchemaKeywordTypes: Record<string, string> = {\n // string\n maxLength: 'string',\n minLength: 'string',\n pattern: 'string',\n contentMediaType: 'string',\n contentEncoding: 'string',\n // number\n multipleOf: 'number',\n maximum: 'number',\n exclusiveMaximum: 'number',\n minimum: 'number',\n exclusiveMinimum: 'number',\n // array\n items: 'array',\n maxItems: 'array',\n minItems: 'array',\n uniqueItems: 'array',\n contains: 'array',\n additionalItems: 'array',\n // object\n maxProperties: 'object',\n minProperties: 'object',\n required: 'object',\n properties: 'object',\n patternProperties: 'object',\n propertyNames: 'object',\n dependencies: 'object',\n additionalProperties: 'object',\n};\nconst jsonSchemaKeywords = Object.keys(jsonSchemaKeywordTypes);\n\nexport class SchemaHelpers {\n static extRenderType = 'x-schema-private-render-type';\n static extRenderAdditionalInfo = 'x-schema-private-render-additional-info';\n static extRawValue = 'x-schema-private-raw-value';\n static extParameterLocation = 'x-schema-private-parameter-location';\n\n static toSchemaType(schema: Schema): string {\n if (!schema || typeof schema.json !== 'function') {\n return SchemaCustomTypes.UNKNOWN;\n }\n if (schema.isBooleanSchema()) {\n if (schema.json() === true) {\n return SchemaCustomTypes.ANY;\n } else {\n return SchemaCustomTypes.NEVER;\n }\n }\n // handle case with `{}` schemas\n if (Object.keys(schema.json()).length === 0) {\n return SchemaCustomTypes.ANY;\n }\n // handle case with `{ not: {}, ... }` schemas\n const not = schema.not();\n if (not && this.inferType(not) === SchemaCustomTypes.ANY) {\n return SchemaCustomTypes.NEVER;\n }\n\n let type = this.inferType(schema);\n if (Array.isArray(type)) {\n return type.map(t => this.toType(t, schema)).join(' | ');\n }\n type = this.toType(type, schema);\n const combinedType = this.toCombinedType(schema);\n\n if (type && combinedType) {\n return `${type} ${combinedType}`;\n }\n if (combinedType) {\n return combinedType;\n }\n return type;\n }\n\n static prettifyValue(value: any) {\n const typeOf = typeof value;\n if (typeOf === 'string') {\n return `\"${value}\"`;\n }\n if (typeOf === 'number' || typeOf === 'bigint' || typeOf === 'boolean') {\n return value;\n }\n if (Array.isArray(value)) {\n return `[${value.toString()}]`;\n }\n return JSON.stringify(value);\n }\n\n static humanizeConstraints(schema: Schema): string[] {\n const constraints: string[] = [];\n\n // related to number/integer\n const numberRange = this.humanizeNumberRangeConstraint(\n schema.minimum(),\n schema.exclusiveMinimum(),\n schema.maximum(),\n schema.exclusiveMaximum(),\n );\n if (numberRange !== undefined) {\n constraints.push(numberRange);\n }\n const multipleOfConstraint = this.humanizeMultipleOfConstraint(\n schema.multipleOf(),\n );\n if (multipleOfConstraint !== undefined) {\n constraints.push(multipleOfConstraint);\n }\n\n // related to string\n const stringRange = this.humanizeRangeConstraint(\n 'characters',\n schema.minLength(),\n schema.maxLength(),\n );\n if (stringRange !== undefined) {\n constraints.push(stringRange);\n }\n\n // related to array\n const hasUniqueItems = schema.uniqueItems();\n const arrayRange = this.humanizeRangeConstraint(\n hasUniqueItems ? 'unique items' : 'items',\n schema.minItems(),\n schema.maxItems(),\n );\n if (arrayRange !== undefined) {\n constraints.push(arrayRange);\n }\n\n // related to object\n const objectRange = this.humanizeRangeConstraint(\n 'properties',\n schema.minProperties(),\n schema.maxProperties(),\n );\n if (objectRange !== undefined) {\n constraints.push(objectRange);\n }\n\n return constraints;\n }\n\n static isExpandable(schema: Schema): boolean {\n let type = this.inferType(schema);\n type = Array.isArray(type) ? type : [type];\n if (type.includes('object') || type.includes('array')) {\n return true;\n }\n\n if (\n schema.oneOf() ||\n schema.anyOf() ||\n schema.allOf() ||\n Object.keys(schema.properties()).length ||\n schema.items() ||\n schema.not() ||\n schema.if() ||\n schema.then() ||\n schema.else()\n ) {\n return true;\n }\n\n const customExtensions = this.getCustomExtensions(schema);\n if (customExtensions && Object.keys(customExtensions).length) {\n return true;\n }\n\n return false;\n }\n\n static serverVariablesToSchema(\n urlVariables?: Record<string, ServerVariable>,\n ): Schema | undefined {\n if (!urlVariables || !Object.keys(urlVariables).length) {\n return undefined;\n }\n\n const json = {\n type: 'object',\n properties: Object.entries(urlVariables).reduce(\n (obj, [variableName, variable]) => {\n obj[variableName] = Object.assign({}, variable.json() || {});\n obj[variableName].type = 'string';\n return obj;\n },\n {},\n ),\n required: Object.keys(urlVariables),\n [this.extRenderType]: false,\n [this.extRenderAdditionalInfo]: false,\n };\n return new SchemaClass(json);\n }\n\n static parametersToSchema(\n parameters?: Record<string, ChannelParameter>,\n ): Schema | undefined {\n if (!parameters || !Object.keys(parameters).length) {\n return undefined;\n }\n\n const json = {\n type: 'object',\n properties: Object.entries(parameters).reduce(\n (obj, [paramaterName, parameter]) => {\n const parameterSchema = parameter.schema();\n obj[paramaterName] = Object.assign(\n {},\n parameterSchema ? parameterSchema.json() : {},\n );\n obj[paramaterName].description =\n parameter.description() || obj[paramaterName].description;\n obj[paramaterName][this.extParameterLocation] = parameter.location();\n return obj;\n },\n {},\n ),\n required: Object.keys(parameters),\n [this.extRenderType]: false,\n [this.extRenderAdditionalInfo]: false,\n };\n return new SchemaClass(json);\n }\n\n static jsonToSchema(value: any): any {\n const json = this.jsonFieldToSchema(value);\n return new SchemaClass(json);\n }\n\n /**\n * Retrieves from given value all custom extensions (value with key started by `x-`).\n * However, it skips those private extensions that begin with `x-parser-` and `x-schema-private-`.\n *\n * @param value\n */\n static getCustomExtensions(value: any) {\n if (!value || typeof value.extensions !== 'function') {\n return;\n }\n return Object.entries(value.extensions() || {}).reduce(\n (obj, [extName, ext]) => {\n if (\n !extName.startsWith('x-parser-') &&\n !extName.startsWith('x-schema-private-')\n ) {\n obj[extName] = ext;\n }\n return obj;\n },\n {},\n );\n }\n\n /**\n * Retrieves from given schema all dependent required requires by given propertyName from `dependencies` object.\n *\n * @param propertyName\n * @param schema\n */\n static getDependentRequired(\n propertyName: string,\n schema: Schema,\n ): string[] | undefined {\n const dependentRequired: string[] = [];\n const dependencies = schema.dependencies();\n if (!dependencies) {\n return;\n }\n\n for (const [prop, array] of Object.entries(dependencies)) {\n if (Array.isArray(array) && array.includes(propertyName)) {\n dependentRequired.push(prop);\n }\n }\n return dependentRequired.length ? dependentRequired : undefined;\n }\n\n /**\n * Retrieves from given schema all dependent schemas from `dependencies` object.\n *\n * @param schema\n */\n static getDependentSchemas(schema: Schema): Schema | undefined {\n const dependencies = schema.dependencies();\n if (!dependencies) {\n return;\n }\n\n const records: Record<string, Schema> = {};\n for (const [prop, propSchema] of Object.entries(dependencies)) {\n if (typeof propSchema === 'object' && !Array.isArray(propSchema)) {\n records[prop] = propSchema;\n }\n }\n if (!Object.keys(records).length) {\n return undefined;\n }\n\n const json = {\n type: 'object',\n properties: Object.entries(records).reduce(\n (obj, [propertyName, propertySchema]) => {\n obj[propertyName] = Object.assign({}, propertySchema.json());\n return obj;\n },\n {},\n ),\n [this.extRenderType]: false,\n [this.extRenderAdditionalInfo]: false,\n };\n return new SchemaClass(json);\n }\n\n private static toType(type: string, schema: Schema): string {\n if (schema.isCircular()) {\n return type;\n }\n if (type === 'array') {\n const items = schema.items();\n if (Array.isArray(items)) {\n return this.toItemsType(items, schema);\n }\n if (!items) {\n return `array<${SchemaCustomTypes.ANY}>`;\n }\n return `array<${this.toSchemaType(items) || SchemaCustomTypes.UNKNOWN}>`;\n }\n return type;\n }\n\n private static toItemsType(items: Schema[], schema: Schema): string {\n const types = items.map(item => this.toSchemaType(item)).join(', ');\n const additionalItems = schema.additionalItems() as any;\n if (additionalItems === undefined || additionalItems.json()) {\n const additionalType =\n additionalItems === undefined || additionalItems.json() === true\n ? SchemaCustomTypes.ANY\n : this.toSchemaType(additionalItems);\n return `tuple<${types ||\n SchemaCustomTypes.UNKNOWN}, ...optional<${additionalType}>>`;\n }\n return `tuple<${types || SchemaCustomTypes.UNKNOWN}>`;\n }\n\n private static toCombinedType(schema: Schema): string | undefined {\n const oneOf = schema.oneOf();\n if (oneOf) {\n return 'oneOf';\n }\n if (schema.anyOf()) {\n return 'anyOf';\n }\n if (schema.allOf()) {\n return 'allOf';\n }\n return;\n }\n\n private static inferType(schema: Schema): string[] | string {\n let types = schema.type();\n\n if (types !== undefined) {\n if (Array.isArray(types)) {\n // if types have `integer` and `number` types, `integer` is unnecessary\n if (types.includes('integer') && types.includes('number')) {\n types = types.filter(t => t !== 'integer');\n }\n return types.length === 1 ? types[0] : types;\n }\n return types;\n }\n\n const constValue = schema.const();\n if (constValue !== undefined) {\n return typeof constValue;\n }\n const enumValue = schema.enum();\n if (Array.isArray(enumValue) && enumValue.length) {\n const inferredType = Array.from(new Set(enumValue.map(e => typeof e)));\n return inferredType.length === 1 ? inferredType[0] : inferredType;\n }\n\n const schemaKeys = Object.keys(schema.json() || {}) || [];\n const hasInferredTypes = jsonSchemaKeywords.some(key =>\n schemaKeys.includes(key),\n );\n if (hasInferredTypes === true) {\n return SchemaCustomTypes.RESTRICTED_ANY;\n }\n if (this.toCombinedType(schema)) {\n return '';\n }\n return SchemaCustomTypes.ANY;\n }\n\n private static humanizeNumberRangeConstraint(\n min: number | undefined,\n exclusiveMin: number | undefined,\n max: number | undefined,\n exclusiveMax: number | undefined,\n ): string | undefined {\n const hasExclusiveMin = exclusiveMin !== undefined;\n const hasMin = min !== undefined || hasExclusiveMin;\n const hasExclusiveMax = exclusiveMax !== undefined;\n const hasMax = max !== undefined || hasExclusiveMax;\n\n let numberRange;\n if (hasMin && hasMax) {\n numberRange = hasExclusiveMin ? '( ' : '[ ';\n numberRange += hasExclusiveMin ? exclusiveMin : min;\n numberRange += ' .. ';\n numberRange += hasExclusiveMax ? exclusiveMax : max;\n numberRange += hasExclusiveMax ? ' )' : ' ]';\n } else if (hasMin) {\n numberRange = hasExclusiveMin ? '> ' : '>= ';\n numberRange += hasExclusiveMin ? exclusiveMin : min;\n } else if (hasMax) {\n numberRange = hasExclusiveMax ? '< ' : '<= ';\n numberRange += hasExclusiveMax ? exclusiveMax : max;\n }\n return numberRange;\n }\n\n private static humanizeMultipleOfConstraint(\n multipleOf: number | undefined,\n ): string | undefined {\n if (multipleOf === undefined) {\n return;\n }\n const strigifiedMultipleOf = multipleOf.toString(10);\n if (!/^0\\.0*1$/.test(strigifiedMultipleOf)) {\n return `multiple of ${strigifiedMultipleOf}`;\n }\n return `decimal places <= ${strigifiedMultipleOf.split('.')[1].length}`;\n }\n\n private static humanizeRangeConstraint(\n description: string,\n min: number | undefined,\n max: number | undefined,\n ): string | undefined {\n let stringRange;\n if (min !== undefined && max !== undefined) {\n if (min === max) {\n stringRange = `${min} ${description}`;\n } else {\n stringRange = `[ ${min} .. ${max} ] ${description}`;\n }\n } else if (max !== undefined) {\n stringRange = `<= ${max} ${description}`;\n } else if (min !== undefined) {\n if (min === 1) {\n stringRange = 'non-empty';\n } else {\n stringRange = `>= ${min} ${description}`;\n }\n }\n return stringRange;\n }\n\n private static jsonFieldToSchema(value: any): any {\n if (value === undefined || value === null) {\n return {\n type: 'string',\n const: '',\n [this.extRawValue]: true,\n };\n }\n if (typeof value !== 'object') {\n const str =\n typeof value.toString === 'function' ? value.toString() : value;\n return {\n type: 'string',\n const: str,\n [this.extRawValue]: true,\n };\n }\n if (this.isJSONSchema(value)) {\n return value;\n }\n if (Array.isArray(value)) {\n return {\n type: 'array',\n items: value.map(v => this.jsonFieldToSchema(v)),\n [this.extRenderType]: false,\n [this.extRenderAdditionalInfo]: false,\n };\n }\n return {\n type: 'object',\n properties: Object.entries(value).reduce((obj, [k, v]) => {\n obj[k] = this.jsonFieldToSchema(v);\n return obj;\n }, {}),\n [this.extRenderType]: false,\n [this.extRenderAdditionalInfo]: false,\n };\n }\n\n private static isJSONSchema(value: any): boolean {\n if (\n value &&\n typeof value === 'object' &&\n (jsonSchemaTypes.includes(value.type) ||\n (Array.isArray(value.type) &&\n value.type.some((t: string) => !jsonSchemaTypes.includes(t))))\n ) {\n return true;\n }\n return false;\n }\n}\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/helpers/schema.ts"],"names":[],"mappings":";;;;;;AAEA,8EAA6D;AAE7D,IAAY,iBASX;AATD,WAAY,iBAAiB;IAE3B,gCAAW,CAAA;IAEX,sDAAiC,CAAA;IAEjC,oCAAe,CAAA;IAEf,wCAAmB,CAAA;AACrB,CAAC,EATW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAS5B;AAED,IAAM,eAAe,GAAG;IACtB,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,SAAS;IACT,OAAO;IACP,QAAQ;IACR,MAAM;CACP,CAAC;AACF,IAAM,sBAAsB,GAA2B;IAErD,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,QAAQ;IACjB,gBAAgB,EAAE,QAAQ;IAC1B,eAAe,EAAE,QAAQ;IAEzB,UAAU,EAAE,QAAQ;IACpB,OAAO,EAAE,QAAQ;IACjB,gBAAgB,EAAE,QAAQ;IAC1B,OAAO,EAAE,QAAQ;IACjB,gBAAgB,EAAE,QAAQ;IAE1B,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,OAAO;IACjB,QAAQ,EAAE,OAAO;IACjB,WAAW,EAAE,OAAO;IACpB,QAAQ,EAAE,OAAO;IACjB,eAAe,EAAE,OAAO;IAExB,aAAa,EAAE,QAAQ;IACvB,aAAa,EAAE,QAAQ;IACvB,QAAQ,EAAE,QAAQ;IAClB,UAAU,EAAE,QAAQ;IACpB,iBAAiB,EAAE,QAAQ;IAC3B,aAAa,EAAE,QAAQ;IACvB,YAAY,EAAE,QAAQ;IACtB,oBA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QAAA;oBAClD,GAAG,CAAC,CAAC,CAAC,GAAG,KAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;oBACnC,OAAO,GAAG,CAAC;gBACb,CAAC,EAAE,EAAE,CAAC;;YACN,GAAC,IAAI,CAAC,aAAa,IAAG,KAAK;YAC3B,GAAC,IAAI,CAAC,uBAAuB,IAAG,KAAK;eACrC;IACJ,CAAC;IAEc,0BAAY,GAA3B,UAA4B,KAAU;QACpC,IACE,KAAK;YACL,OAAO,KAAK,KAAK,QAAQ;YACzB,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC;gBACnC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;oBACxB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAC,CAAS,IAAK,OAAA,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,EAA5B,CAA4B,CAAC,CAAC,CAAC,EAClE;YACA,OAAO,IAAI,CAAC;SACb;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IA/dM,2BAAa,GAAG,8BAA8B,CAAC;IAC/C,qCAAuB,GAAG,yCAAyC,CAAC;IACpE,yBAAW,GAAG,4BAA4B,CAAC;IAC3C,kCAAoB,GAAG,qCAAqC,CAAC;IA6dtE,oBAAC;CAAA,AAjeD,IAieC;AAjeY,sCAAa","sourcesContent":["import { ChannelParameter, ServerVariable, Schema } from '@asyncapi/parser';\n// @ts-ignore\nimport SchemaClass from '@asyncapi/parser/lib/models/schema';\n\nexport enum SchemaCustomTypes {\n // for `true` and `{}` schemas\n ANY = 'any',\n // for schemas without `type` keyword\n RESTRICTED_ANY = 'restricted any',\n // for `false` and `{ not: {}, ... }` schemas\n NEVER = 'never',\n // for types that we cannot infer\n UNKNOWN = 'unknown',\n}\n\nconst jsonSchemaTypes = [\n 'string',\n 'number',\n 'integer',\n 'boolean',\n 'array',\n 'object',\n 'null',\n];\nconst jsonSchemaKeywordTypes: Record<string, string> = {\n // string\n maxLength: 'string',\n minLength: 'string',\n pattern: 'string',\n contentMediaType: 'string',\n contentEncoding: 'string',\n // number\n multipleOf: 'number',\n maximum: 'number',\n exclusiveMaximum: 'number',\n minimum: 'number',\n exclusiveMinimum: 'number',\n // array\n items: 'array',\n maxItems: 'array',\n minItems: 'array',\n uniqueItems: 'array',\n contains: 'array',\n additionalItems: 'array',\n // object\n maxProperties: 'object',\n minProperties: 'object',\n required: 'object',\n properties: 'object',\n patternProperties: 'object',\n propertyNames: 'object',\n dependencies: 'object',\n additionalProperties: 'object',\n};\nconst jsonSchemaKeywords = Object.keys(jsonSchemaKeywordTypes);\n\nexport class SchemaHelpers {\n static extRenderType = 'x-schema-private-render-type';\n static extRenderAdditionalInfo = 'x-schema-private-render-additional-info';\n static extRawValue = 'x-schema-private-raw-value';\n static extParameterLocation = 'x-schema-private-parameter-location';\n\n static toSchemaType(schema: Schema): string {\n if (!schema || typeof schema.json !== 'function') {\n return SchemaCustomTypes.UNKNOWN;\n }\n if (schema.isBooleanSchema()) {\n if (schema.json() === true) {\n return SchemaCustomTypes.ANY;\n } else {\n return SchemaCustomTypes.NEVER;\n }\n }\n // handle case with `{}` schemas\n if (Object.keys(schema.json()).length === 0) {\n return SchemaCustomTypes.ANY;\n }\n // handle case with `{ not: {}, ... }` schemas\n const not = schema.not();\n if (not && this.inferType(not) === SchemaCustomTypes.ANY) {\n return SchemaCustomTypes.NEVER;\n }\n\n let type = this.inferType(schema);\n if (Array.isArray(type)) {\n return type.map(t => this.toType(t, schema)).join(' | ');\n }\n type = this.toType(type, schema);\n const combinedType = this.toCombinedType(schema);\n\n if (type && combinedType) {\n return `${type} ${combinedType}`;\n }\n if (combinedType) {\n return combinedType;\n }\n return type;\n }\n\n static prettifyValue(value: any, strict = true): string {\n const typeOf = typeof value;\n if (typeOf === 'string') {\n return strict ? `\"${value}\"` : value;\n }\n if (typeOf === 'number' || typeOf === 'bigint' || typeOf === 'boolean') {\n return `${value}`;\n }\n if (Array.isArray(value)) {\n return `[${value.toString()}]`;\n }\n return JSON.stringify(value);\n }\n\n static humanizeConstraints(schema: Schema): string[] {\n const constraints: string[] = [];\n\n // related to number/integer\n const numberRange = this.humanizeNumberRangeConstraint(\n schema.minimum(),\n schema.exclusiveMinimum(),\n schema.maximum(),\n schema.exclusiveMaximum(),\n );\n if (numberRange !== undefined) {\n constraints.push(numberRange);\n }\n const multipleOfConstraint = this.humanizeMultipleOfConstraint(\n schema.multipleOf(),\n );\n if (multipleOfConstraint !== undefined) {\n constraints.push(multipleOfConstraint);\n }\n\n // related to string\n const stringRange = this.humanizeRangeConstraint(\n 'characters',\n schema.minLength(),\n schema.maxLength(),\n );\n if (stringRange !== undefined) {\n constraints.push(stringRange);\n }\n\n // related to array\n const hasUniqueItems = schema.uniqueItems();\n const arrayRange = this.humanizeRangeConstraint(\n hasUniqueItems ? 'unique items' : 'items',\n schema.minItems(),\n schema.maxItems(),\n );\n if (arrayRange !== undefined) {\n constraints.push(arrayRange);\n }\n\n // related to object\n const objectRange = this.humanizeRangeConstraint(\n 'properties',\n schema.minProperties(),\n schema.maxProperties(),\n );\n if (objectRange !== undefined) {\n constraints.push(objectRange);\n }\n\n return constraints;\n }\n\n static isExpandable(schema: Schema): boolean {\n let type = this.inferType(schema);\n type = Array.isArray(type) ? type : [type];\n if (type.includes('object') || type.includes('array')) {\n return true;\n }\n\n if (\n schema.oneOf() ||\n schema.anyOf() ||\n schema.allOf() ||\n Object.keys(schema.properties()).length ||\n schema.items() ||\n schema.not() ||\n schema.if() ||\n schema.then() ||\n schema.else()\n ) {\n return true;\n }\n\n const customExtensions = this.getCustomExtensions(schema);\n if (customExtensions && Object.keys(customExtensions).length) {\n return true;\n }\n\n return false;\n }\n\n static serverVariablesToSchema(\n urlVariables?: Record<string, ServerVariable>,\n ): Schema | undefined {\n if (!urlVariables || !Object.keys(urlVariables).length) {\n return undefined;\n }\n\n const json = {\n type: 'object',\n properties: Object.entries(urlVariables).reduce(\n (obj, [variableName, variable]) => {\n obj[variableName] = Object.assign({}, variable.json() || {});\n obj[variableName].type = 'string';\n return obj;\n },\n {},\n ),\n required: Object.keys(urlVariables),\n [this.extRenderType]: false,\n [this.extRenderAdditionalInfo]: false,\n };\n return new SchemaClass(json);\n }\n\n static parametersToSchema(\n parameters?: Record<string, ChannelParameter>,\n ): Schema | undefined {\n if (!parameters || !Object.keys(parameters).length) {\n return undefined;\n }\n\n const json = {\n type: 'object',\n properties: Object.entries(parameters).reduce(\n (obj, [paramaterName, parameter]) => {\n const parameterSchema = parameter.schema();\n obj[paramaterName] = Object.assign(\n {},\n parameterSchema ? parameterSchema.json() : {},\n );\n obj[paramaterName].description =\n parameter.description() || obj[paramaterName].description;\n obj[paramaterName][this.extParameterLocation] = parameter.location();\n return obj;\n },\n {},\n ),\n required: Object.keys(parameters),\n [this.extRenderType]: false,\n [this.extRenderAdditionalInfo]: false,\n };\n return new SchemaClass(json);\n }\n\n static jsonToSchema(value: any): any {\n const json = this.jsonFieldToSchema(value);\n return new SchemaClass(json);\n }\n\n /**\n * Retrieves from given value all custom extensions (value with key started by `x-`).\n * However, it skips those private extensions that begin with `x-parser-` and `x-schema-private-`.\n *\n * @param value\n */\n static getCustomExtensions(value: any) {\n if (!value || typeof value.extensions !== 'function') {\n return;\n }\n return Object.entries(value.extensions() || {}).reduce(\n (obj, [extName, ext]) => {\n if (\n !extName.startsWith('x-parser-') &&\n !extName.startsWith('x-schema-private-')\n ) {\n obj[extName] = ext;\n }\n return obj;\n },\n {},\n );\n }\n\n /**\n * Retrieves from given schema all dependent required requires by given propertyName from `dependencies` object.\n *\n * @param propertyName\n * @param schema\n */\n static getDependentRequired(\n propertyName: string,\n schema: Schema,\n ): string[] | undefined {\n const dependentRequired: string[] = [];\n const dependencies = schema.dependencies();\n if (!dependencies) {\n return;\n }\n\n for (const [prop, array] of Object.entries(dependencies)) {\n if (Array.isArray(array) && array.includes(propertyName)) {\n dependentRequired.push(prop);\n }\n }\n return dependentRequired.length ? dependentRequired : undefined;\n }\n\n /**\n * Retrieves from given schema all dependent schemas from `dependencies` object.\n *\n * @param schema\n */\n static getDependentSchemas(schema: Schema): Schema | undefined {\n const dependencies = schema.dependencies();\n if (!dependencies) {\n return;\n }\n\n const records: Record<string, Schema> = {};\n for (const [prop, propSchema] of Object.entries(dependencies)) {\n if (typeof propSchema === 'object' && !Array.isArray(propSchema)) {\n records[prop] = propSchema;\n }\n }\n if (!Object.keys(records).length) {\n return undefined;\n }\n\n const json = {\n type: 'object',\n properties: Object.entries(records).reduce(\n (obj, [propertyName, propertySchema]) => {\n obj[propertyName] = Object.assign({}, propertySchema.json());\n return obj;\n },\n {},\n ),\n [this.extRenderType]: false,\n [this.extRenderAdditionalInfo]: false,\n };\n return new SchemaClass(json);\n }\n\n private static toType(type: string, schema: Schema): string {\n if (schema.isCircular()) {\n return type;\n }\n if (type === 'array') {\n const items = schema.items();\n if (Array.isArray(items)) {\n return this.toItemsType(items, schema);\n }\n if (!items) {\n return `array<${SchemaCustomTypes.ANY}>`;\n }\n return `array<${this.toSchemaType(items) || SchemaCustomTypes.UNKNOWN}>`;\n }\n return type;\n }\n\n private static toItemsType(items: Schema[], schema: Schema): string {\n const types = items.map(item => this.toSchemaType(item)).join(', ');\n const additionalItems = schema.additionalItems() as any;\n if (additionalItems === undefined || additionalItems.json()) {\n const additionalType =\n additionalItems === undefined || additionalItems.json() === true\n ? SchemaCustomTypes.ANY\n : this.toSchemaType(additionalItems);\n return `tuple<${types ||\n SchemaCustomTypes.UNKNOWN}, ...optional<${additionalType}>>`;\n }\n return `tuple<${types || SchemaCustomTypes.UNKNOWN}>`;\n }\n\n private static toCombinedType(schema: Schema): string | undefined {\n const oneOf = schema.oneOf();\n if (oneOf) {\n return 'oneOf';\n }\n if (schema.anyOf()) {\n return 'anyOf';\n }\n if (schema.allOf()) {\n return 'allOf';\n }\n return;\n }\n\n private static inferType(schema: Schema): string[] | string {\n let types = schema.type();\n\n if (types !== undefined) {\n if (Array.isArray(types)) {\n // if types have `integer` and `number` types, `integer` is unnecessary\n if (types.includes('integer') && types.includes('number')) {\n types = types.filter(t => t !== 'integer');\n }\n return types.length === 1 ? types[0] : types;\n }\n return types;\n }\n\n const constValue = schema.const();\n if (constValue !== undefined) {\n return typeof constValue;\n }\n const enumValue = schema.enum();\n if (Array.isArray(enumValue) && enumValue.length) {\n const inferredType = Array.from(new Set(enumValue.map(e => typeof e)));\n return inferredType.length === 1 ? inferredType[0] : inferredType;\n }\n\n const schemaKeys = Object.keys(schema.json() || {}) || [];\n const hasInferredTypes = jsonSchemaKeywords.some(key =>\n schemaKeys.includes(key),\n );\n if (hasInferredTypes === true) {\n return SchemaCustomTypes.RESTRICTED_ANY;\n }\n if (this.toCombinedType(schema)) {\n return '';\n }\n return SchemaCustomTypes.ANY;\n }\n\n private static humanizeNumberRangeConstraint(\n min: number | undefined,\n exclusiveMin: number | undefined,\n max: number | undefined,\n exclusiveMax: number | undefined,\n ): string | undefined {\n const hasExclusiveMin = exclusiveMin !== undefined;\n const hasMin = min !== undefined || hasExclusiveMin;\n const hasExclusiveMax = exclusiveMax !== undefined;\n const hasMax = max !== undefined || hasExclusiveMax;\n\n let numberRange;\n if (hasMin && hasMax) {\n numberRange = hasExclusiveMin ? '( ' : '[ ';\n numberRange += hasExclusiveMin ? exclusiveMin : min;\n numberRange += ' .. ';\n numberRange += hasExclusiveMax ? exclusiveMax : max;\n numberRange += hasExclusiveMax ? ' )' : ' ]';\n } else if (hasMin) {\n numberRange = hasExclusiveMin ? '> ' : '>= ';\n numberRange += hasExclusiveMin ? exclusiveMin : min;\n } else if (hasMax) {\n numberRange = hasExclusiveMax ? '< ' : '<= ';\n numberRange += hasExclusiveMax ? exclusiveMax : max;\n }\n return numberRange;\n }\n\n private static humanizeMultipleOfConstraint(\n multipleOf: number | undefined,\n ): string | undefined {\n if (multipleOf === undefined) {\n return;\n }\n const strigifiedMultipleOf = multipleOf.toString(10);\n if (!/^0\\.0*1$/.test(strigifiedMultipleOf)) {\n return `multiple of ${strigifiedMultipleOf}`;\n }\n return `decimal places <= ${strigifiedMultipleOf.split('.')[1].length}`;\n }\n\n private static humanizeRangeConstraint(\n description: string,\n min: number | undefined,\n max: number | undefined,\n ): string | undefined {\n let stringRange;\n if (min !== undefined && max !== undefined) {\n if (min === max) {\n stringRange = `${min} ${description}`;\n } else {\n stringRange = `[ ${min} .. ${max} ] ${description}`;\n }\n } else if (max !== undefined) {\n stringRange = `<= ${max} ${description}`;\n } else if (min !== undefined) {\n if (min === 1) {\n stringRange = 'non-empty';\n } else {\n stringRange = `>= ${min} ${description}`;\n }\n }\n return stringRange;\n }\n\n private static jsonFieldToSchema(value: any): any {\n if (value === undefined || value === null) {\n return {\n type: 'string',\n const: '',\n [this.extRawValue]: true,\n };\n }\n if (typeof value !== 'object') {\n const str =\n typeof value.toString === 'function' ? value.toString() : value;\n return {\n type: 'string',\n const: str,\n [this.extRawValue]: true,\n };\n }\n if (this.isJSONSchema(value)) {\n return value;\n }\n if (Array.isArray(value)) {\n return {\n type: 'array',\n items: value.map(v => this.jsonFieldToSchema(v)),\n [this.extRenderType]: false,\n [this.extRenderAdditionalInfo]: false,\n };\n }\n return {\n type: 'object',\n properties: Object.entries(value).reduce((obj, [k, v]) => {\n obj[k] = this.jsonFieldToSchema(v);\n return obj;\n }, {}),\n [this.extRenderType]: false,\n [this.extRenderAdditionalInfo]: false,\n };\n }\n\n private static isJSONSchema(value: any): boolean {\n if (\n value &&\n typeof value === 'object' &&\n (jsonSchemaTypes.includes(value.type) ||\n (Array.isArray(value.type) &&\n value.type.some((t: string) => !jsonSchemaTypes.includes(t))))\n ) {\n return true;\n }\n return false;\n }\n}\n"]}
@@ -70,7 +70,7 @@ export var Schema = function (_a) {
70
70
  schema.writeOnly() && (React.createElement("div", { className: "text-gray-500 text-xs" }, "write-only")),
71
71
  schema.readOnly() && (React.createElement("div", { className: "text-gray-500 text-xs" }, "read-only"))),
72
72
  rawValue ? (React.createElement("div", null,
73
- React.createElement("div", { className: "text-sm" }, schema.const()))) : (React.createElement("div", null,
73
+ React.createElement("div", { className: "text-sm" }, SchemaHelpers.prettifyValue(schema.const(), false)))) : (React.createElement("div", null,
74
74
  React.createElement("div", null,
75
75
  renderType && (React.createElement("div", { className: "capitalize text-sm text-teal-500 font-bold inline-block mr-2" }, isCircular ? "".concat(schemaType, " [CIRCULAR]") : schemaType)),
76
76
  React.createElement("div", { className: "inline-block" },
@@ -1 +1 @@
1
- {"version":3,"file":"Schema.js","sourceRoot":"","sources":["../../../src/components/Schema.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG/D,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAc3C,IAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;IACxC,OAAO,EAAE,KAAK;IACd,YAAY,EAAE,KAAK;CACpB,CAAC,CAAC;AAEH,MAAM,CAAC,IAAM,MAAM,GAAmC,UAAC,EAUtD;QATC,UAAU,gBAAA,EACV,MAAM,YAAA,EACN,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,yBAAyB,EAAzB,iBAAiB,mBAAG,KAAK,KAAA,EACzB,kBAAkB,EAAlB,UAAU,mBAAG,KAAK,KAAA,EAClB,kBAAkB,EAAlB,UAAU,mBAAG,KAAK,KAAA,EAClB,iBAAiB,uBAAA,EACjB,gBAA8B,EAApB,YAAY,mBAAG,KAAK,KAAA,EAC9B,iBAAiB,EAAjB,SAAS,mBAAG,KAAK,KAAA;IAEX,IAAA,KAA4B,UAAU,CAAC,aAAa,CAAC,EAAnD,OAAO,aAAA,EAAE,YAAY,kBAA8B,CAAC;IACtD,IAAA,KAA0B,QAAQ,CAAC,YAAY,CAAC,EAA/C,QAAQ,QAAA,EAAE,WAAW,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AAe,KAAK,IAAI,IAAI,eAAe,KAAK,SAAS,EAAE;QAC7D,OAAO,CACL,2BAAG,SAAS,EAAC,4BAA4B,oCAErC,CACL,CAAC;KACH;IACD,IAAI,eAAe,KAAK,KAAK,EAAE;QAC7B,OAAO,CACL,2BAAG,SAAS,EAAC,4BAA4B;;YAClB,0CAAoB;wBACvC,CACL,CAAC;KACH;IACD,OAAO,oBAAC,MAAM,IAAC,UAAU,EAAC,mBAAmB,EAAC,MAAM,EAAE,eAAe,GAAI,CAAC;AAC5E,CAAC,CAAC","sourcesContent":["import React, { useState, useEffect, useContext } from 'react';\nimport { Schema as SchemaType } from '@asyncapi/parser';\n\nimport { Href, CollapseButton, Markdown, Extensions } from './index';\nimport { SchemaHelpers } from '../helpers';\n\ninterface Props {\n schemaName?: React.ReactNode;\n schema?: SchemaType;\n required?: boolean;\n isPatternProperty?: boolean;\n isProperty?: boolean;\n isCircular?: boolean;\n dependentRequired?: string[];\n expanded?: boolean;\n onlyTitle?: boolean;\n}\n\nconst SchemaContext = React.createContext({\n reverse: false,\n deepExpanded: false,\n});\n\nexport const Schema: React.FunctionComponent<Props> = ({\n schemaName,\n schema,\n required = false,\n isPatternProperty = false,\n isProperty = false,\n isCircular = false,\n dependentRequired,\n expanded: propExpanded = false,\n onlyTitle = false,\n}) => {\n const { reverse, deepExpanded } = useContext(SchemaContext);\n const [expanded, setExpanded] = useState(propExpanded);\n const [deepExpand, setDeepExpand] = useState(false);\n\n useEffect(() => {\n setDeepExpand(deepExpanded);\n }, [deepExpanded, setDeepExpand]);\n\n useEffect(() => {\n setExpanded(deepExpand);\n }, [deepExpand, setExpanded]);\n\n if (\n !schema ||\n (typeof schemaName === 'string' &&\n (schemaName?.startsWith('x-parser-') ||\n schemaName?.startsWith('x-schema-private-')))\n ) {\n return null;\n }\n\n const dependentSchemas = SchemaHelpers.getDependentSchemas(schema);\n\n const constraints = SchemaHelpers.humanizeConstraints(schema);\n const externalDocs = schema.externalDocs();\n\n const renderType = schema.ext(SchemaHelpers.extRenderType) !== false;\n const rawValue = schema.ext(SchemaHelpers.extRawValue) === true;\n const parameterLocation = schema.ext(SchemaHelpers.extParameterLocation);\n const isExpandable = SchemaHelpers.isExpandable(schema) || dependentSchemas;\n\n let schemaType = SchemaHelpers.toSchemaType(schema);\n isCircular =\n isCircular ||\n schema.isCircular() ||\n schema.ext('x-parser-circular') ||\n false;\n const uid = schema.uid();\n\n const schemaItems = schema.items();\n if (schemaItems && !Array.isArray(schemaItems)) {\n /**\n * fallback for older logic for circular references:\n *\n * checking uid for circular items\n * `x-parser-circular` extension is added to every schema which has circular `items` field,\n * so we must check that `items` is schema (not array of schemas) and infer UID of schema to display which schema is circular (by the name of schema)\n */\n isCircular =\n isCircular ||\n schemaItems.isCircular() ||\n schemaItems.ext('x-parser-circular') ||\n false;\n if (\n isCircular &&\n typeof (schemaItems as any).circularSchema === 'function'\n ) {\n schemaType = SchemaHelpers.toSchemaType(\n (schemaItems as any).circularSchema(),\n );\n }\n } else if (\n isCircular &&\n typeof (schema as any).circularSchema === 'function'\n ) {\n schemaType = SchemaHelpers.toSchemaType((schema as any).circularSchema());\n }\n\n const styledSchemaName = isProperty ? 'italic' : '';\n const renderedSchemaName =\n typeof schemaName === 'string' ? (\n <span className={`break-words text-sm ${styledSchemaName}`}>\n {schemaName}\n </span>\n ) : (\n schemaName\n );\n\n return (\n <SchemaContext.Provider\n value={{ reverse: !reverse, deepExpanded: deepExpand }}\n >\n <div>\n <div className=\"flex py-2\">\n <div className={`${onlyTitle ? '' : 'min-w-1/4'} mr-2`}>\n {isExpandable && !isCircular ? (\n <>\n <CollapseButton\n onClick={() => setExpanded(prev => !prev)}\n expanded={expanded}\n >\n {renderedSchemaName}\n </CollapseButton>\n <button\n type=\"button\"\n onClick={() => setDeepExpand(prev => !prev)}\n className=\"ml-1 text-sm text-gray-500\"\n >\n {deepExpand ? 'Collapse all' : 'Expand all'}\n </button>\n </>\n ) : (\n <span\n className={`break-words text-sm ${isProperty ? 'italic' : ''}`}\n >\n {schemaName}\n </span>\n )}\n {isPatternProperty && (\n <div className=\"text-gray-500 text-xs italic\">\n (pattern property)\n </div>\n )}\n {required && <div className=\"text-red-600 text-xs\">required</div>}\n {dependentRequired && (\n <>\n <div className=\"text-gray-500 text-xs\">\n required when defined:\n </div>\n <div className=\"text-red-600 text-xs\">\n {dependentRequired.join(', ')}\n </div>\n </>\n )}\n {schema.deprecated() && (\n <div className=\"text-red-600 text-xs\">deprecated</div>\n )}\n {schema.writeOnly() && (\n <div className=\"text-gray-500 text-xs\">write-only</div>\n )}\n {schema.readOnly() && (\n <div className=\"text-gray-500 text-xs\">read-only</div>\n )}\n </div>\n {rawValue ? (\n <div>\n <div className=\"text-sm\">{schema.const()}</div>\n </div>\n ) : (\n <div>\n <div>\n {renderType && (\n <div className=\"capitalize text-sm text-teal-500 font-bold inline-block mr-2\">\n {isCircular ? `${schemaType} [CIRCULAR]` : schemaType}\n </div>\n )}\n <div className=\"inline-block\">\n {schema.format() && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\">\n format: {schema.format()}\n </span>\n )}\n\n {/* related to string */}\n {schema.pattern() !== undefined && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded mr-2 p-1 text-xs\">\n must match: {schema.pattern()}\n </span>\n )}\n {schema.contentMediaType() !== undefined && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\">\n media type: {schema.contentMediaType()}\n </span>\n )}\n {schema.contentEncoding() !== undefined && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\">\n encoding: {schema.contentEncoding()}\n </span>\n )}\n\n {/* constraints */}\n {!!constraints.length &&\n constraints.map(c => (\n <span\n className=\"bg-purple-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\"\n key={c}\n >\n {c}\n </span>\n ))}\n\n {uid && !uid.startsWith('<anonymous-') && (\n <span className=\"border text-orange-600 rounded mr-2 p-1 text-xs\">\n uid: {uid}\n </span>\n )}\n </div>\n\n {schema.hasDescription() && (\n <div>\n <Markdown>{schema.description()}</Markdown>\n </div>\n )}\n\n {schema.default() !== undefined && (\n <div className=\"text-xs\">\n Default value:\n <span className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2\">\n {SchemaHelpers.prettifyValue(schema.default())}\n </span>\n </div>\n )}\n {schema.const() !== undefined && (\n <div className=\"text-xs\">\n Const:\n <span className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2\">\n {SchemaHelpers.prettifyValue(schema.const())}\n </span>\n </div>\n )}\n {schema.enum() && (\n <ul className=\"text-xs\">\n Allowed values:{' '}\n {schema.enum().map((e, idx) => (\n <li\n key={idx}\n className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2\"\n >\n <span>{SchemaHelpers.prettifyValue(e)}</span>\n </li>\n ))}\n </ul>\n )}\n {parameterLocation && (\n <div className=\"text-xs\">\n Parameter location:{' '}\n <span className=\"border text-orange-600 rounded mr-2 p-1 text-xs\">\n {parameterLocation}\n </span>\n </div>\n )}\n {externalDocs && (\n <span className=\"border border-solid border-orange-300 hover:bg-orange-300 hover:text-orange-600 text-orange-500 font-bold no-underline text-xs uppercase rounded px-2 py-0\">\n <Href\n href={externalDocs.url()}\n title={externalDocs.description() || ''}\n >\n Documentation\n </Href>\n </span>\n )}\n {schema.examples() && (\n <ul className=\"text-xs\">\n Examples values:{' '}\n {schema.examples().map((e, idx) => (\n <li\n key={idx}\n className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2 break-all\"\n >\n <span>{SchemaHelpers.prettifyValue(e)}</span>\n </li>\n ))}\n </ul>\n )}\n </div>\n </div>\n )}\n </div>\n\n {isCircular || !isExpandable ? null : (\n <div\n className={`rounded p-4 py-2 border bg-gray-100 ${\n reverse ? 'bg-gray-200' : ''\n } ${expanded ? 'block' : 'hidden'}`}\n >\n <SchemaProperties schema={schema} />\n <SchemaItems schema={schema} />\n\n {schema.oneOf() &&\n schema\n .oneOf()\n .map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={idx === 0 ? 'Adheres to:' : 'Or to:'}\n />\n ))}\n {schema.anyOf() &&\n schema\n .anyOf()\n .map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={idx === 0 ? 'Can adhere to:' : 'Or to:'}\n />\n ))}\n {schema.allOf() &&\n schema\n .allOf()\n .map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={idx === 0 ? 'Consists of:' : 'And with:'}\n />\n ))}\n {schema.not() && (\n <Schema schema={schema.not()} schemaName=\"Cannot adhere to:\" />\n )}\n\n {schema.propertyNames() && (\n <Schema\n schema={schema.propertyNames()}\n schemaName=\"Property names must adhere to:\"\n />\n )}\n {schema.contains() && (\n <Schema\n schema={schema.contains()}\n schemaName=\"Array must contain at least one of:\"\n />\n )}\n\n {schema.if() && (\n <Schema schema={schema.if()} schemaName=\"If schema adheres to:\" />\n )}\n {schema.then() && (\n <Schema\n schema={schema.then()}\n schemaName=\"Then must adhere to:\"\n />\n )}\n {schema.else() && (\n <Schema schema={schema.else()} schemaName=\"Otherwise:\" />\n )}\n\n {dependentSchemas && (\n <Schema\n schema={dependentSchemas}\n schemaName=\"Dependent schemas:\"\n />\n )}\n\n <Extensions item={schema} />\n\n <AdditionalProperties schema={schema} />\n <AdditionalItems schema={schema} />\n </div>\n )}\n </div>\n </SchemaContext.Provider>\n );\n};\n\ninterface SchemaPropertiesProps {\n schema: SchemaType;\n}\n\nconst SchemaProperties: React.FunctionComponent<SchemaPropertiesProps> = ({\n schema,\n}) => {\n const properties = schema.properties() || {};\n if (!Object.keys(properties)) {\n return null;\n }\n\n const required = schema.required() || [];\n const patternProperties = schema.patternProperties();\n const circularProps = schema.ext('x-parser-circular-props') || [];\n\n return (\n <>\n {Object.entries(properties).map(([propertyName, property]) => (\n <Schema\n schema={property}\n schemaName={propertyName}\n required={required.includes(propertyName)}\n isProperty={true}\n isCircular={circularProps.includes(propertyName)}\n dependentRequired={SchemaHelpers.getDependentRequired(\n propertyName,\n schema,\n )}\n key={propertyName}\n />\n ))}\n {Object.entries(patternProperties).map(([propertyName, property]) => (\n <Schema\n schema={property}\n schemaName={propertyName}\n isPatternProperty={true}\n isProperty={true}\n isCircular={circularProps.includes(propertyName)}\n key={propertyName}\n />\n ))}\n </>\n );\n};\n\ninterface AdditionalPropertiesProps {\n schema: SchemaType;\n}\n\nconst AdditionalProperties: React.FunctionComponent<AdditionalPropertiesProps> = ({\n schema,\n}) => {\n if (schema.ext(SchemaHelpers.extRenderAdditionalInfo) === false) {\n return null;\n }\n\n let type = schema.type();\n type = Array.isArray(type) ? type : [type];\n if (!type.includes('object')) {\n return null;\n }\n\n const additionalProperties = schema.additionalProperties();\n if (additionalProperties === true || additionalProperties === undefined) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional properties are allowed.\n </p>\n );\n }\n if (additionalProperties === false) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional properties are <strong>NOT</strong> allowed.\n </p>\n );\n }\n return (\n <Schema schemaName=\"Additional properties:\" schema={additionalProperties} />\n );\n};\n\ninterface SchemaItemsProps {\n schema: SchemaType;\n}\n\nconst SchemaItems: React.FunctionComponent<SchemaItemsProps> = ({ schema }) => {\n let type = schema.type();\n type = Array.isArray(type) ? type : [type];\n if (!type.includes('array')) {\n return null;\n }\n const items = schema.items();\n\n // object in items\n if (\n items &&\n !Array.isArray(items) &&\n Object.keys(items.properties() || {}).length\n ) {\n return <SchemaProperties schema={items} />;\n } else if (Array.isArray(items)) {\n return (\n <>\n {items.map((item, idx) => (\n <Schema schema={item} schemaName={`${idx + 1} item:`} key={idx} />\n ))}\n </>\n );\n }\n return <Schema schema={items} schemaName=\"Items:\" />;\n};\n\ninterface AdditionalItemsProps {\n schema: SchemaType;\n}\n\nconst AdditionalItems: React.FunctionComponent<AdditionalItemsProps> = ({\n schema,\n}) => {\n if (schema.ext(SchemaHelpers.extRenderAdditionalInfo) === false) {\n return null;\n }\n\n let type = schema.type();\n type = Array.isArray(type) ? type : [type];\n if (!type.includes('array')) {\n return null;\n }\n if (!Array.isArray(schema.items())) {\n return null;\n }\n\n const additionalItems = schema.additionalItems() as any;\n if (additionalItems === true || additionalItems === undefined) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional items are allowed.\n </p>\n );\n }\n if (additionalItems === false) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional items are <strong>NOT</strong> allowed.\n </p>\n );\n }\n return <Schema schemaName=\"Additional items:\" schema={additionalItems} />;\n};\n"]}
1
+ {"version":3,"file":"Schema.js","sourceRoot":"","sources":["../../../src/components/Schema.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG/D,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAc3C,IAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;IACxC,OAAO,EAAE,KAAK;IACd,YAAY,EAAE,KAAK;CACpB,CAAC,CAAC;AAEH,MAAM,CAAC,IAAM,MAAM,GAAmC,UAAC,EAUtD;QATC,UAAU,gBAAA,EACV,MAAM,YAAA,EACN,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,yBAAyB,EAAzB,iBAAiB,mBAAG,KAAK,KAAA,EACzB,kBAAkB,EAAlB,UAAU,mBAAG,KAAK,KAAA,EAClB,kBAAkB,EAAlB,UAAU,mBAAG,KAAK,KAAA,EAClB,iBAAiB,uBAAA,EACjB,gBAA8B,EAApB,YAAY,mBAAG,KAAK,KAAA,EAC9B,iBAAiB,EAAjB,SAAS,mBAAG,KAAK,KAAA;IAEX,IAAA,KAA4B,UAAU,CAAC,aAAa,CAAC,EAAnD,OAAO,aA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AAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE;QAClC,OAAO,IAAI,CAAC;KACb;IAED,IAAM,eAAe,GAAG,MAAM,CAAC,eAAe,EAAS,CAAC;IACxD,IAAI,eAAe,KAAK,IAAI,IAAI,eAAe,KAAK,SAAS,EAAE;QAC7D,OAAO,CACL,2BAAG,SAAS,EAAC,4BAA4B,oCAErC,CACL,CAAC;KACH;IACD,IAAI,eAAe,KAAK,KAAK,EAAE;QAC7B,OAAO,CACL,2BAAG,SAAS,EAAC,4BAA4B;;YAClB,0CAAoB;wBACvC,CACL,CAAC;KACH;IACD,OAAO,oBAAC,MAAM,IAAC,UAAU,EAAC,mBAAmB,EAAC,MAAM,EAAE,eAAe,GAAI,CAAC;AAC5E,CAAC,CAAC","sourcesContent":["import React, { useState, useEffect, useContext } from 'react';\nimport { Schema as SchemaType } from '@asyncapi/parser';\n\nimport { Href, CollapseButton, Markdown, Extensions } from './index';\nimport { SchemaHelpers } from '../helpers';\n\ninterface Props {\n schemaName?: React.ReactNode;\n schema?: SchemaType;\n required?: boolean;\n isPatternProperty?: boolean;\n isProperty?: boolean;\n isCircular?: boolean;\n dependentRequired?: string[];\n expanded?: boolean;\n onlyTitle?: boolean;\n}\n\nconst SchemaContext = React.createContext({\n reverse: false,\n deepExpanded: false,\n});\n\nexport const Schema: React.FunctionComponent<Props> = ({\n schemaName,\n schema,\n required = false,\n isPatternProperty = false,\n isProperty = false,\n isCircular = false,\n dependentRequired,\n expanded: propExpanded = false,\n onlyTitle = false,\n}) => {\n const { reverse, deepExpanded } = useContext(SchemaContext);\n const [expanded, setExpanded] = useState(propExpanded);\n const [deepExpand, setDeepExpand] = useState(false);\n\n useEffect(() => {\n setDeepExpand(deepExpanded);\n }, [deepExpanded, setDeepExpand]);\n\n useEffect(() => {\n setExpanded(deepExpand);\n }, [deepExpand, setExpanded]);\n\n if (\n !schema ||\n (typeof schemaName === 'string' &&\n (schemaName?.startsWith('x-parser-') ||\n schemaName?.startsWith('x-schema-private-')))\n ) {\n return null;\n }\n\n const dependentSchemas = SchemaHelpers.getDependentSchemas(schema);\n\n const constraints = SchemaHelpers.humanizeConstraints(schema);\n const externalDocs = schema.externalDocs();\n\n const renderType = schema.ext(SchemaHelpers.extRenderType) !== false;\n const rawValue = schema.ext(SchemaHelpers.extRawValue) === true;\n const parameterLocation = schema.ext(SchemaHelpers.extParameterLocation);\n const isExpandable = SchemaHelpers.isExpandable(schema) || dependentSchemas;\n\n let schemaType = SchemaHelpers.toSchemaType(schema);\n isCircular =\n isCircular ||\n schema.isCircular() ||\n schema.ext('x-parser-circular') ||\n false;\n const uid = schema.uid();\n\n const schemaItems = schema.items();\n if (schemaItems && !Array.isArray(schemaItems)) {\n /**\n * fallback for older logic for circular references:\n *\n * checking uid for circular items\n * `x-parser-circular` extension is added to every schema which has circular `items` field,\n * so we must check that `items` is schema (not array of schemas) and infer UID of schema to display which schema is circular (by the name of schema)\n */\n isCircular =\n isCircular ||\n schemaItems.isCircular() ||\n schemaItems.ext('x-parser-circular') ||\n false;\n if (\n isCircular &&\n typeof (schemaItems as any).circularSchema === 'function'\n ) {\n schemaType = SchemaHelpers.toSchemaType(\n (schemaItems as any).circularSchema(),\n );\n }\n } else if (\n isCircular &&\n typeof (schema as any).circularSchema === 'function'\n ) {\n schemaType = SchemaHelpers.toSchemaType((schema as any).circularSchema());\n }\n\n const styledSchemaName = isProperty ? 'italic' : '';\n const renderedSchemaName =\n typeof schemaName === 'string' ? (\n <span className={`break-words text-sm ${styledSchemaName}`}>\n {schemaName}\n </span>\n ) : (\n schemaName\n );\n\n return (\n <SchemaContext.Provider\n value={{ reverse: !reverse, deepExpanded: deepExpand }}\n >\n <div>\n <div className=\"flex py-2\">\n <div className={`${onlyTitle ? '' : 'min-w-1/4'} mr-2`}>\n {isExpandable && !isCircular ? (\n <>\n <CollapseButton\n onClick={() => setExpanded(prev => !prev)}\n expanded={expanded}\n >\n {renderedSchemaName}\n </CollapseButton>\n <button\n type=\"button\"\n onClick={() => setDeepExpand(prev => !prev)}\n className=\"ml-1 text-sm text-gray-500\"\n >\n {deepExpand ? 'Collapse all' : 'Expand all'}\n </button>\n </>\n ) : (\n <span\n className={`break-words text-sm ${isProperty ? 'italic' : ''}`}\n >\n {schemaName}\n </span>\n )}\n {isPatternProperty && (\n <div className=\"text-gray-500 text-xs italic\">\n (pattern property)\n </div>\n )}\n {required && <div className=\"text-red-600 text-xs\">required</div>}\n {dependentRequired && (\n <>\n <div className=\"text-gray-500 text-xs\">\n required when defined:\n </div>\n <div className=\"text-red-600 text-xs\">\n {dependentRequired.join(', ')}\n </div>\n </>\n )}\n {schema.deprecated() && (\n <div className=\"text-red-600 text-xs\">deprecated</div>\n )}\n {schema.writeOnly() && (\n <div className=\"text-gray-500 text-xs\">write-only</div>\n )}\n {schema.readOnly() && (\n <div className=\"text-gray-500 text-xs\">read-only</div>\n )}\n </div>\n {rawValue ? (\n <div>\n <div className=\"text-sm\">\n {SchemaHelpers.prettifyValue(schema.const(), false)}\n </div>\n </div>\n ) : (\n <div>\n <div>\n {renderType && (\n <div className=\"capitalize text-sm text-teal-500 font-bold inline-block mr-2\">\n {isCircular ? `${schemaType} [CIRCULAR]` : schemaType}\n </div>\n )}\n <div className=\"inline-block\">\n {schema.format() && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\">\n format: {schema.format()}\n </span>\n )}\n\n {/* related to string */}\n {schema.pattern() !== undefined && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded mr-2 p-1 text-xs\">\n must match: {schema.pattern()}\n </span>\n )}\n {schema.contentMediaType() !== undefined && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\">\n media type: {schema.contentMediaType()}\n </span>\n )}\n {schema.contentEncoding() !== undefined && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\">\n encoding: {schema.contentEncoding()}\n </span>\n )}\n\n {/* constraints */}\n {!!constraints.length &&\n constraints.map(c => (\n <span\n className=\"bg-purple-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\"\n key={c}\n >\n {c}\n </span>\n ))}\n\n {uid && !uid.startsWith('<anonymous-') && (\n <span className=\"border text-orange-600 rounded mr-2 p-1 text-xs\">\n uid: {uid}\n </span>\n )}\n </div>\n\n {schema.hasDescription() && (\n <div>\n <Markdown>{schema.description()}</Markdown>\n </div>\n )}\n\n {schema.default() !== undefined && (\n <div className=\"text-xs\">\n Default value:\n <span className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2\">\n {SchemaHelpers.prettifyValue(schema.default())}\n </span>\n </div>\n )}\n {schema.const() !== undefined && (\n <div className=\"text-xs\">\n Const:\n <span className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2\">\n {SchemaHelpers.prettifyValue(schema.const())}\n </span>\n </div>\n )}\n {schema.enum() && (\n <ul className=\"text-xs\">\n Allowed values:{' '}\n {schema.enum().map((e, idx) => (\n <li\n key={idx}\n className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2\"\n >\n <span>{SchemaHelpers.prettifyValue(e)}</span>\n </li>\n ))}\n </ul>\n )}\n {parameterLocation && (\n <div className=\"text-xs\">\n Parameter location:{' '}\n <span className=\"border text-orange-600 rounded mr-2 p-1 text-xs\">\n {parameterLocation}\n </span>\n </div>\n )}\n {externalDocs && (\n <span className=\"border border-solid border-orange-300 hover:bg-orange-300 hover:text-orange-600 text-orange-500 font-bold no-underline text-xs uppercase rounded px-2 py-0\">\n <Href\n href={externalDocs.url()}\n title={externalDocs.description() || ''}\n >\n Documentation\n </Href>\n </span>\n )}\n {schema.examples() && (\n <ul className=\"text-xs\">\n Examples values:{' '}\n {schema.examples().map((e, idx) => (\n <li\n key={idx}\n className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2 break-all\"\n >\n <span>{SchemaHelpers.prettifyValue(e)}</span>\n </li>\n ))}\n </ul>\n )}\n </div>\n </div>\n )}\n </div>\n\n {isCircular || !isExpandable ? null : (\n <div\n className={`rounded p-4 py-2 border bg-gray-100 ${\n reverse ? 'bg-gray-200' : ''\n } ${expanded ? 'block' : 'hidden'}`}\n >\n <SchemaProperties schema={schema} />\n <SchemaItems schema={schema} />\n\n {schema.oneOf() &&\n schema\n .oneOf()\n .map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={idx === 0 ? 'Adheres to:' : 'Or to:'}\n />\n ))}\n {schema.anyOf() &&\n schema\n .anyOf()\n .map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={idx === 0 ? 'Can adhere to:' : 'Or to:'}\n />\n ))}\n {schema.allOf() &&\n schema\n .allOf()\n .map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={idx === 0 ? 'Consists of:' : 'And with:'}\n />\n ))}\n {schema.not() && (\n <Schema schema={schema.not()} schemaName=\"Cannot adhere to:\" />\n )}\n\n {schema.propertyNames() && (\n <Schema\n schema={schema.propertyNames()}\n schemaName=\"Property names must adhere to:\"\n />\n )}\n {schema.contains() && (\n <Schema\n schema={schema.contains()}\n schemaName=\"Array must contain at least one of:\"\n />\n )}\n\n {schema.if() && (\n <Schema schema={schema.if()} schemaName=\"If schema adheres to:\" />\n )}\n {schema.then() && (\n <Schema\n schema={schema.then()}\n schemaName=\"Then must adhere to:\"\n />\n )}\n {schema.else() && (\n <Schema schema={schema.else()} schemaName=\"Otherwise:\" />\n )}\n\n {dependentSchemas && (\n <Schema\n schema={dependentSchemas}\n schemaName=\"Dependent schemas:\"\n />\n )}\n\n <Extensions item={schema} />\n\n <AdditionalProperties schema={schema} />\n <AdditionalItems schema={schema} />\n </div>\n )}\n </div>\n </SchemaContext.Provider>\n );\n};\n\ninterface SchemaPropertiesProps {\n schema: SchemaType;\n}\n\nconst SchemaProperties: React.FunctionComponent<SchemaPropertiesProps> = ({\n schema,\n}) => {\n const properties = schema.properties() || {};\n if (!Object.keys(properties)) {\n return null;\n }\n\n const required = schema.required() || [];\n const patternProperties = schema.patternProperties();\n const circularProps = schema.ext('x-parser-circular-props') || [];\n\n return (\n <>\n {Object.entries(properties).map(([propertyName, property]) => (\n <Schema\n schema={property}\n schemaName={propertyName}\n required={required.includes(propertyName)}\n isProperty={true}\n isCircular={circularProps.includes(propertyName)}\n dependentRequired={SchemaHelpers.getDependentRequired(\n propertyName,\n schema,\n )}\n key={propertyName}\n />\n ))}\n {Object.entries(patternProperties).map(([propertyName, property]) => (\n <Schema\n schema={property}\n schemaName={propertyName}\n isPatternProperty={true}\n isProperty={true}\n isCircular={circularProps.includes(propertyName)}\n key={propertyName}\n />\n ))}\n </>\n );\n};\n\ninterface AdditionalPropertiesProps {\n schema: SchemaType;\n}\n\nconst AdditionalProperties: React.FunctionComponent<AdditionalPropertiesProps> = ({\n schema,\n}) => {\n if (schema.ext(SchemaHelpers.extRenderAdditionalInfo) === false) {\n return null;\n }\n\n let type = schema.type();\n type = Array.isArray(type) ? type : [type];\n if (!type.includes('object')) {\n return null;\n }\n\n const additionalProperties = schema.additionalProperties();\n if (additionalProperties === true || additionalProperties === undefined) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional properties are allowed.\n </p>\n );\n }\n if (additionalProperties === false) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional properties are <strong>NOT</strong> allowed.\n </p>\n );\n }\n return (\n <Schema schemaName=\"Additional properties:\" schema={additionalProperties} />\n );\n};\n\ninterface SchemaItemsProps {\n schema: SchemaType;\n}\n\nconst SchemaItems: React.FunctionComponent<SchemaItemsProps> = ({ schema }) => {\n let type = schema.type();\n type = Array.isArray(type) ? type : [type];\n if (!type.includes('array')) {\n return null;\n }\n const items = schema.items();\n\n // object in items\n if (\n items &&\n !Array.isArray(items) &&\n Object.keys(items.properties() || {}).length\n ) {\n return <SchemaProperties schema={items} />;\n } else if (Array.isArray(items)) {\n return (\n <>\n {items.map((item, idx) => (\n <Schema schema={item} schemaName={`${idx + 1} item:`} key={idx} />\n ))}\n </>\n );\n }\n return <Schema schema={items} schemaName=\"Items:\" />;\n};\n\ninterface AdditionalItemsProps {\n schema: SchemaType;\n}\n\nconst AdditionalItems: React.FunctionComponent<AdditionalItemsProps> = ({\n schema,\n}) => {\n if (schema.ext(SchemaHelpers.extRenderAdditionalInfo) === false) {\n return null;\n }\n\n let type = schema.type();\n type = Array.isArray(type) ? type : [type];\n if (!type.includes('array')) {\n return null;\n }\n if (!Array.isArray(schema.items())) {\n return null;\n }\n\n const additionalItems = schema.additionalItems() as any;\n if (additionalItems === true || additionalItems === undefined) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional items are allowed.\n </p>\n );\n }\n if (additionalItems === false) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional items are <strong>NOT</strong> allowed.\n </p>\n );\n }\n return <Schema schemaName=\"Additional items:\" schema={additionalItems} />;\n};\n"]}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Security } from './Security';
3
- import { Markdown, Schema, Bindings } from '../../components';
3
+ import { Markdown, Schema, Bindings, Tags, Extensions } from '../../components';
4
4
  import { useConfig } from '../../contexts';
5
5
  import { CommonHelpers, SchemaHelpers } from '../../helpers';
6
6
  export var Server = function (_a) {
@@ -28,7 +28,10 @@ export var Server = function (_a) {
28
28
  React.createElement("div", { id: "".concat(CommonHelpers.getIdentifier("server-".concat(serverName, "-security"), config)) },
29
29
  React.createElement(Security, { protocol: server.protocol(), security: security })),
30
30
  server.hasBindings() && (React.createElement("div", { className: "mt-2" },
31
- React.createElement(Bindings, { name: "Server specific information", bindings: server.bindings() }))))),
31
+ React.createElement(Bindings, { name: "Server specific information", bindings: server.bindings() }))),
32
+ React.createElement(Extensions, { name: "Server Extensions", item: server }),
33
+ typeof server.hasTags === 'function' && server.hasTags() && (React.createElement("div", { className: "mt-2" },
34
+ React.createElement(Tags, { tags: server.tags() }))))),
32
35
  React.createElement("div", { className: "panel-item--right" })));
33
36
  };
34
37
  //# sourceMappingURL=Server.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AAM;oBACnB,oBAAC,QAAQ,QAAE,MAAM,CAAC,WAAW,EAAE,CAAY,CACvC,CACP;gBAEA,YAAY,IAAI,CACf,6BACE,SAAS,EAAC,MAAM,EAChB,EAAE,EAAE,UAAG,aAAa,CAAC,aAAa,CAChC,iBAAU,UAAU,mBAAgB,EACpC,MAAM,CACP,CAAE;oBAEH,oBAAC,MAAM,IACL,UAAU,EAAC,eAAe,EAC1B,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,IAAI,GACd,CACE,CACP;gBAGC,6BACE,EAAE,EAAE,UAAG,aAAa,CAAC,aAAa,CAChC,iBAAU,UAAU,cAAW,EAC/B,MAAM,CACP,CAAE;oBAEH,oBAAC,QAAQ,IAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,QAAQ,GAAI,CACzD;gBAGP,MAAM,CAAC,WAAW,EAAE,IAAI,CACvB,6BAAK,SAAS,EAAC,MAAM;oBACnB,oBAAC,QAAQ,IACP,IAAI,EAAC,6BAA6B,EAClC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,GAC3B,CACE,CACP,CACG,CACF;QAEN,6BAAK,SAAS,EAAC,mBAAmB,GAAG,CACjC,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Server as ServerType } from '@asyncapi/parser';\n\nimport { Security } from './Security';\nimport { Markdown, Schema, Bindings } from '../../components';\n\nimport { useConfig } from '../../contexts';\nimport { CommonHelpers, SchemaHelpers } from '../../helpers';\n\ninterface Props {\n serverName: string;\n server: ServerType;\n}\n\nexport const Server: React.FunctionComponent<Props> = ({\n serverName,\n server,\n}) => {\n const config = useConfig();\n\n if (!server) {\n return null;\n }\n\n const urlVariables = SchemaHelpers.serverVariablesToSchema(\n server.variables(),\n );\n const protocolVersion = server.protocolVersion();\n const security = server.security();\n\n return (\n <div className=\"panel-item\">\n <div className=\"panel-item--center px-8\">\n <div className=\"shadow rounded bg-gray-200 p-4 border bg-gray-100\">\n <div>\n <span className=\"font-mono text-base\">{server.url()}</span>\n <span className=\"bg-teal-500 font-bold no-underline text-white uppercase rounded mx-2 px-2 py-1 text-sm\">\n {protocolVersion\n ? `${server.protocol()} ${protocolVersion}`\n : server.protocol()}\n </span>\n <span className=\"bg-blue-500 font-bold no-underline text-white uppercase rounded px-2 py-1 text-sm\">\n {serverName}\n </span>\n </div>\n\n {server.hasDescription() && (\n <div className=\"mt-2\">\n <Markdown>{server.description()}</Markdown>\n </div>\n )}\n\n {urlVariables && (\n <div\n className=\"mt-2\"\n id={`${CommonHelpers.getIdentifier(\n `server-${serverName}-url-variables`,\n config,\n )}`}\n >\n <Schema\n schemaName=\"URL Variables\"\n schema={urlVariables}\n expanded={true}\n />\n </div>\n )}\n\n {\n <div\n id={`${CommonHelpers.getIdentifier(\n `server-${serverName}-security`,\n config,\n )}`}\n >\n <Security protocol={server.protocol()} security={security} />\n </div>\n }\n\n {server.hasBindings() && (\n <div className=\"mt-2\">\n <Bindings\n name=\"Server specific information\"\n bindings={server.bindings()}\n />\n </div>\n )}\n </div>\n </div>\n\n <div className=\"panel-item--right\" />\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"Server.js","sourceRoot":"","sources":["../../../../src/containers/Servers/Server.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEhF,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAO7D,MAAM,CAAC,IAAM,MAAM,GAAmC,UAAC,EAGtD;QAFC,UAAU,gBAAA,EACV,MAAM,YAAA;IAEN,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B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AAQ,GAAI,CACzD;gBAGP,MAAM,CAAC,WAAW,EAAE,IAAI,CACvB,6BAAK,SAAS,EAAC,MAAM;oBACnB,oBAAC,QAAQ,IACP,IAAI,EAAC,6BAA6B,EAClC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,GAC3B,CACE,CACP;gBAED,oBAAC,UAAU,IAAC,IAAI,EAAC,mBAAmB,EAAC,IAAI,EAAE,MAAM,GAAI;gBAEpD,OAAO,MAAM,CAAC,OAAO,KAAK,UAAU,IAAI,MAAM,CAAC,OAAO,EAAE,IAAI,CAC3D,6BAAK,SAAS,EAAC,MAAM;oBACnB,oBAAC,IAAI,IAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,GAAI,CACzB,CACP,CACG,CACF;QAEN,6BAAK,SAAS,EAAC,mBAAmB,GAAG,CACjC,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Server as ServerType } from '@asyncapi/parser';\n\nimport { Security } from './Security';\nimport { Markdown, Schema, Bindings, Tags, Extensions } from '../../components';\n\nimport { useConfig } from '../../contexts';\nimport { CommonHelpers, SchemaHelpers } from '../../helpers';\n\ninterface Props {\n serverName: string;\n server: ServerType;\n}\n\nexport const Server: React.FunctionComponent<Props> = ({\n serverName,\n server,\n}) => {\n const config = useConfig();\n\n if (!server) {\n return null;\n }\n\n const urlVariables = SchemaHelpers.serverVariablesToSchema(\n server.variables(),\n );\n const protocolVersion = server.protocolVersion();\n const security = server.security();\n\n return (\n <div className=\"panel-item\">\n <div className=\"panel-item--center px-8\">\n <div className=\"shadow rounded bg-gray-200 p-4 border bg-gray-100\">\n <div>\n <span className=\"font-mono text-base\">{server.url()}</span>\n <span className=\"bg-teal-500 font-bold no-underline text-white uppercase rounded mx-2 px-2 py-1 text-sm\">\n {protocolVersion\n ? `${server.protocol()} ${protocolVersion}`\n : server.protocol()}\n </span>\n <span className=\"bg-blue-500 font-bold no-underline text-white uppercase rounded px-2 py-1 text-sm\">\n {serverName}\n </span>\n </div>\n\n {server.hasDescription() && (\n <div className=\"mt-2\">\n <Markdown>{server.description()}</Markdown>\n </div>\n )}\n\n {urlVariables && (\n <div\n className=\"mt-2\"\n id={`${CommonHelpers.getIdentifier(\n `server-${serverName}-url-variables`,\n config,\n )}`}\n >\n <Schema\n schemaName=\"URL Variables\"\n schema={urlVariables}\n expanded={true}\n />\n </div>\n )}\n\n {\n <div\n id={`${CommonHelpers.getIdentifier(\n `server-${serverName}-security`,\n config,\n )}`}\n >\n <Security protocol={server.protocol()} security={security} />\n </div>\n }\n\n {server.hasBindings() && (\n <div className=\"mt-2\">\n <Bindings\n name=\"Server specific information\"\n bindings={server.bindings()}\n />\n </div>\n )}\n\n <Extensions name=\"Server Extensions\" item={server} />\n\n {typeof server.hasTags === 'function' && server.hasTags() && (\n <div className=\"mt-2\">\n <Tags tags={server.tags()} />\n </div>\n )}\n </div>\n </div>\n\n <div className=\"panel-item--right\" />\n </div>\n );\n};\n"]}