@asyncapi/react-component 2.0.4 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -68,7 +68,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
68
68
  PERFORMANCE OF THIS SOFTWARE.
69
69
  ***************************************************************************** */
70
70
 
71
- /*! @license DOMPurify 2.4.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.7/LICENSE */
71
+ /*! @license DOMPurify 3.1.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.5/LICENSE */
72
72
 
73
73
  /*! https://mths.be/punycode v1.4.0 by @mathias */
74
74
 
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"","sourcesContent":["export interface ConfigInterface {\n schemaID?: string;\n show?: ShowConfig;\n expand?: ExpandConfig;\n sidebar?: SideBarConfig;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parserOptions?: any;\n publishLabel?: string;\n subscribeLabel?: string;\n sendLabel?: string;\n receiveLabel?: string;\n requestLabel?: string;\n replyLabel?: string;\n}\n\nexport interface ShowConfig {\n sidebar?: boolean;\n info?: boolean;\n servers?: boolean;\n operations?: boolean;\n messages?: boolean;\n schemas?: boolean;\n errors?: boolean;\n}\n\nexport interface ExpandConfig {\n messageExamples?: boolean;\n}\n\nexport interface SideBarConfig {\n showServers?: 'byDefault' | 'bySpecTags' | 'byServersTags';\n showOperations?: 'byDefault' | 'bySpecTags' | 'byOperationsTags';\n}\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"","sourcesContent":["export interface ConfigInterface {\n schemaID?: string;\n show?: ShowConfig;\n expand?: ExpandConfig;\n sidebar?: SideBarConfig;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parserOptions?: any;\n publishLabel?: string;\n subscribeLabel?: string;\n sendLabel?: string;\n receiveLabel?: string;\n requestLabel?: string;\n replyLabel?: string;\n}\n\nexport interface ShowConfig {\n sidebar?: boolean;\n info?: boolean;\n servers?: boolean;\n operations?: boolean;\n messages?: boolean;\n messageExamples?: boolean;\n schemas?: boolean;\n errors?: boolean;\n}\n\nexport interface ExpandConfig {\n messageExamples?: boolean;\n}\n\nexport interface SideBarConfig {\n showServers?: 'byDefault' | 'bySpecTags' | 'byServersTags';\n showOperations?: 'byDefault' | 'bySpecTags' | 'byOperationsTags';\n}\n"]}
@@ -10,6 +10,7 @@ exports.defaultConfig = {
10
10
  servers: true,
11
11
  operations: true,
12
12
  messages: true,
13
+ messageExamples: false,
13
14
  schemas: true,
14
15
  errors: true,
15
16
  },
@@ -1 +1 @@
1
- {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/config/default.ts"],"names":[],"mappings":";;;AACA,0CAOsB;AAET,QAAA,aAAa,GAAoB;IAC5C,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;QACJ,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;KACb;IACD,MAAM,EAAE;QACN,eAAe,EAAE,KAAK;KACvB;IACD,OAAO,EAAE;QACP,WAAW,EAAE,WAAW;QACxB,cAAc,EAAE,WAAW;KAC5B;IACD,YAAY,EAAE,sCAA0B;IACxC,cAAc,EAAE,wCAA4B;IAC5C,SAAS,EAAE,mCAAuB;IAClC,YAAY,EAAE,2CAA+B;IAC7C,YAAY,EAAE,sCAA0B;IACxC,UAAU,EAAE,sCAA0B;CACvC,CAAC","sourcesContent":["import { ConfigInterface } from './config';\nimport {\n PUBLISH_LABEL_DEFAULT_TEXT,\n RECEIVE_TEXT_LABEL_DEFAULT_TEXT,\n REPLIER_LABEL_DEFAULT_TEXT,\n REQUEST_LABEL_DEFAULT_TEXT,\n SEND_LABEL_DEFAULT_TEXT,\n SUBSCRIBE_LABEL_DEFAULT_TEXT,\n} from '../constants';\n\nexport const defaultConfig: ConfigInterface = {\n schemaID: '',\n show: {\n sidebar: false,\n info: true,\n servers: true,\n operations: true,\n messages: true,\n schemas: true,\n errors: true,\n },\n expand: {\n messageExamples: false,\n },\n sidebar: {\n showServers: 'byDefault',\n showOperations: 'byDefault',\n },\n publishLabel: PUBLISH_LABEL_DEFAULT_TEXT,\n subscribeLabel: SUBSCRIBE_LABEL_DEFAULT_TEXT,\n sendLabel: SEND_LABEL_DEFAULT_TEXT,\n receiveLabel: RECEIVE_TEXT_LABEL_DEFAULT_TEXT,\n requestLabel: REQUEST_LABEL_DEFAULT_TEXT,\n replyLabel: REPLIER_LABEL_DEFAULT_TEXT,\n};\n"]}
1
+ {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/config/default.ts"],"names":[],"mappings":";;;AACA,0CAOsB;AAET,QAAA,aAAa,GAAoB;IAC5C,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;QACJ,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,eAAe,EAAE,KAAK;QACtB,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;KACb;IACD,MAAM,EAAE;QACN,eAAe,EAAE,KAAK;KACvB;IACD,OAAO,EAAE;QACP,WAAW,EAAE,WAAW;QACxB,cAAc,EAAE,WAAW;KAC5B;IACD,YAAY,EAAE,sCAA0B;IACxC,cAAc,EAAE,wCAA4B;IAC5C,SAAS,EAAE,mCAAuB;IAClC,YAAY,EAAE,2CAA+B;IAC7C,YAAY,EAAE,sCAA0B;IACxC,UAAU,EAAE,sCAA0B;CACvC,CAAC","sourcesContent":["import { ConfigInterface } from './config';\nimport {\n PUBLISH_LABEL_DEFAULT_TEXT,\n RECEIVE_TEXT_LABEL_DEFAULT_TEXT,\n REPLIER_LABEL_DEFAULT_TEXT,\n REQUEST_LABEL_DEFAULT_TEXT,\n SEND_LABEL_DEFAULT_TEXT,\n SUBSCRIBE_LABEL_DEFAULT_TEXT,\n} from '../constants';\n\nexport const defaultConfig: ConfigInterface = {\n schemaID: '',\n show: {\n sidebar: false,\n info: true,\n servers: true,\n operations: true,\n messages: true,\n messageExamples: false,\n schemas: true,\n errors: true,\n },\n expand: {\n messageExamples: false,\n },\n sidebar: {\n showServers: 'byDefault',\n showOperations: 'byDefault',\n },\n publishLabel: PUBLISH_LABEL_DEFAULT_TEXT,\n subscribeLabel: SUBSCRIBE_LABEL_DEFAULT_TEXT,\n sendLabel: SEND_LABEL_DEFAULT_TEXT,\n receiveLabel: RECEIVE_TEXT_LABEL_DEFAULT_TEXT,\n requestLabel: REQUEST_LABEL_DEFAULT_TEXT,\n replyLabel: REPLIER_LABEL_DEFAULT_TEXT,\n};\n"]}
@@ -18,8 +18,11 @@ var Messages = function () {
18
18
  }
19
19
  return (react_1.default.createElement("section", { id: "".concat(helpers_1.CommonHelpers.getIdentifier('messages', config)), className: "mt-16" },
20
20
  react_1.default.createElement("h2", { className: "2xl:w-7/12 text-3xl font-light mb-4 px-8" }, constants_1.MESSAGES_TEXT),
21
- react_1.default.createElement("ul", null, messages.map(function (message, idx) { return (react_1.default.createElement("li", { className: "mb-4", key: message.id(), id: helpers_1.CommonHelpers.getIdentifier("message-".concat(message.id()), config) },
22
- react_1.default.createElement(Message_1.Message, { messageName: message.id(), message: message, index: idx + 1, key: message.id() }))); }))));
21
+ react_1.default.createElement("ul", null, messages.map(function (message, idx) {
22
+ var _a, _b;
23
+ return (react_1.default.createElement("li", { className: "mb-4", key: message.id(), id: helpers_1.CommonHelpers.getIdentifier("message-".concat(message.id()), config) },
24
+ react_1.default.createElement(Message_1.Message, { messageName: message.id(), message: message, index: idx + 1, key: message.id(), showExamples: (_b = (_a = config === null || config === void 0 ? void 0 : config.show) === null || _a === void 0 ? void 0 : _a.messageExamples) !== null && _b !== void 0 ? _b : false })));
25
+ }))));
23
26
  };
24
27
  exports.Messages = Messages;
25
28
  //# sourceMappingURL=Messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Messages.js","sourceRoot":"","sources":["../../../../src/containers/Messages/Messages.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAE1B,qCAAoC;AAEpC,2CAAoD;AACpD,yCAA8C;AAC9C,6CAAgD;AAEzC,IAAM,QAAQ,GAA4B;IAC/C,IAAM,QAAQ,GAAG,IAAA,kBAAO,GAAE,CAAC;IAC3B,IAAM,MAAM,GAAG,IAAA,oBAAS,GAAE,CAAC;IAC3B,IAAM,QAAQ,GACZ,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC;IAE7E,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QACtC,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,2CACE,EAAE,EAAE,UAAG,uBAAa,CAAC,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,CAAE,EACxD,SAAS,EAAC,OAAO;QAEjB,sCAAI,SAAS,EAAC,0CAA0C,IACrD,yBAAa,CACX;QACL,0CACG,QAAQ,CAAC,GAAG,CAAC,UAAC,OAAO,EAAE,GAAG,IAAK,OAAA,CAC9B,sCACE,SAAS,EAAC,MAAM,EAChB,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,EACjB,EAAE,EAAE,uBAAa,CAAC,aAAa,CAAC,kBAAW,OAAO,CAAC,EAAE,EAAE,CAAE,EAAE,MAAM,CAAC;YAElE,8BAAC,iBAAO,IACN,WAAW,EAAE,OAAO,CAAC,EAAE,EAAE,EACzB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,GAAG,GAAG,CAAC,EACd,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,GACjB,CACC,CACN,EAb+B,CAa/B,CAAC,CACC,CACG,CACX,CAAC;AACJ,CAAC,CAAC;AApCW,QAAA,QAAQ,YAoCnB","sourcesContent":["import React from 'react';\n\nimport { Message } from './Message';\n\nimport { useConfig, useSpec } from '../../contexts';\nimport { CommonHelpers } from '../../helpers';\nimport { MESSAGES_TEXT } from '../../constants';\n\nexport const Messages: React.FunctionComponent = () => {\n const asyncapi = useSpec();\n const config = useConfig();\n const messages =\n !asyncapi.components().isEmpty() && asyncapi.components().messages().all();\n\n if (!messages || messages.length === 0) {\n return null;\n }\n\n return (\n <section\n id={`${CommonHelpers.getIdentifier('messages', config)}`}\n className=\"mt-16\"\n >\n <h2 className=\"2xl:w-7/12 text-3xl font-light mb-4 px-8\">\n {MESSAGES_TEXT}\n </h2>\n <ul>\n {messages.map((message, idx) => (\n <li\n className=\"mb-4\"\n key={message.id()}\n id={CommonHelpers.getIdentifier(`message-${message.id()}`, config)}\n >\n <Message\n messageName={message.id()}\n message={message}\n index={idx + 1}\n key={message.id()}\n />\n </li>\n ))}\n </ul>\n </section>\n );\n};\n"]}
1
+ {"version":3,"file":"Messages.js","sourceRoot":"","sources":["../../../../src/containers/Messages/Messages.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAE1B,qCAAoC;AAEpC,2CAAoD;AACpD,yCAA8C;AAC9C,6CAAgD;AAEzC,IAAM,QAAQ,GAA4B;IAC/C,IAAM,QAAQ,GAAG,IAAA,kBAAO,GAAE,CAAC;IAC3B,IAAM,MAAM,GAAG,IAAA,oBAAS,GAAE,CAAC;IAC3B,IAAM,QAAQ,GACZ,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC;IAE7E,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QACtC,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,2CACE,EAAE,EAAE,UAAG,uBAAa,CAAC,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,CAAE,EACxD,SAAS,EAAC,OAAO;QAEjB,sCAAI,SAAS,EAAC,0CAA0C,IACrD,yBAAa,CACX;QACL,0CACG,QAAQ,CAAC,GAAG,CAAC,UAAC,OAAO,EAAE,GAAG;;YAAK,OAAA,CAC9B,sCACE,SAAS,EAAC,MAAM,EAChB,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,EACjB,EAAE,EAAE,uBAAa,CAAC,aAAa,CAAC,kBAAW,OAAO,CAAC,EAAE,EAAE,CAAE,EAAE,MAAM,CAAC;gBAElE,8BAAC,iBAAO,IACN,WAAW,EAAE,OAAO,CAAC,EAAE,EAAE,EACzB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,GAAG,GAAG,CAAC,EACd,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,EACjB,YAAY,EAAE,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,0CAAE,eAAe,mCAAI,KAAK,GACpD,CACC,CACN,CAAA;SAAA,CAAC,CACC,CACG,CACX,CAAC;AACJ,CAAC,CAAC;AArCW,QAAA,QAAQ,YAqCnB","sourcesContent":["import React from 'react';\n\nimport { Message } from './Message';\n\nimport { useConfig, useSpec } from '../../contexts';\nimport { CommonHelpers } from '../../helpers';\nimport { MESSAGES_TEXT } from '../../constants';\n\nexport const Messages: React.FunctionComponent = () => {\n const asyncapi = useSpec();\n const config = useConfig();\n const messages =\n !asyncapi.components().isEmpty() && asyncapi.components().messages().all();\n\n if (!messages || messages.length === 0) {\n return null;\n }\n\n return (\n <section\n id={`${CommonHelpers.getIdentifier('messages', config)}`}\n className=\"mt-16\"\n >\n <h2 className=\"2xl:w-7/12 text-3xl font-light mb-4 px-8\">\n {MESSAGES_TEXT}\n </h2>\n <ul>\n {messages.map((message, idx) => (\n <li\n className=\"mb-4\"\n key={message.id()}\n id={CommonHelpers.getIdentifier(`message-${message.id()}`, config)}\n >\n <Message\n messageName={message.id()}\n message={message}\n index={idx + 1}\n key={message.id()}\n showExamples={config?.show?.messageExamples ?? false}\n />\n </li>\n ))}\n </ul>\n </section>\n );\n};\n"]}
@@ -101,7 +101,7 @@ var SecurityItem = function (_a) {
101
101
  unwrappedFlows.clientCredentials = flows.clientCredentials();
102
102
  }
103
103
  if (flows === null || flows === void 0 ? void 0 : flows.hasPassword()) {
104
- unwrappedFlows.password = flows.implicit();
104
+ unwrappedFlows.password = flows.password();
105
105
  }
106
106
  var renderedFlows = Object.entries(unwrappedFlows).map(function (_a) {
107
107
  var flowName = _a[0], flow = _a[1];
@@ -1 +1 @@
1
- {"version":3,"file":"Security.js","sourceRoot":"","sources":["../../../../src/containers/Servers/Security.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAO1B,+CAAkD;AAClD,yCAA8C;AAQvC,IAAM,QAAQ,GAAmC,UAAC,EAIxD;QAHC,gBAAa,EAAb,QAAQ,mBAAG,EAAE,KAAA,EACb,gBAAa,EAAb,QAAQ,mBAAG,EAAE,KAAA,EACb,cAAmB,EAAnB,MAAM,mBAAG,UAAU,KAAA;IAEnB,IAAI,kBAAkB,CAAC;IACvB,IAAI,CAAC,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAA,EAAE;QACrB,IAAI,QAAQ,KAAK,OAAO,IAAI,QAAQ,KAAK,cAAc,EAAE;YACvD,kBAAkB,GAAG,CACnB,8BAAC,YAAY,IAAC,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,GAAI,CAC3D,CAAC;SACH;KACF;SAAM;QACL,IAAM,UAAU,GAAsB,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;aAC1D,GAAG,CAAC,UAAC,YAAY,IAAK,OAAA,YAAY,CA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C,CACF,CAAC;IAEF,OAAO,CACL;QACG,cAAc,IAAI,OAAO,IAAI,CAC5B;YACE;gBACG,uBAAa,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;gBACjD,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CACrB,sCAAI,SAAS,EAAC,mBAAmB,IAC9B,OAAO,CAAC,GAAG,CAAC,UAAC,MAAM,EAAE,GAAG,IAAK,OAAA,CAC5B,sCACE,SAAS,EAAC,qGAAqG,EAC/G,GAAG,EAAE,GAAG,IAEP,MAAM,CACJ,CACN,EAP6B,CAO7B,CAAC,CACC,CACN,CACI,CACH,CACP;QAEA,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,cAAc,EAAE,KAAI,CACnC;YACE,8BAAC,qBAAQ,QAAE,cAAc,CAAC,WAAW,EAAE,CAAY,CAC/C,CACP;QAEA,aAAa,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,CAC5C,sCAAI,SAAS,EAAC,MAAM;YAClB,0CAAK,aAAa,CAAM,CACrB,CACN;QAEA,qBAAqB,IAAI,2CAAM,qBAAqB,CAAO,CACxD,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport {\n OAuthFlowInterface,\n SecurityRequirementsInterface,\n SecuritySchemeInterface,\n} from '@asyncapi/parser';\n\nimport { Href, Markdown } from '../../components';\nimport { ServerHelpers } from '../../helpers';\n\ninterface Props {\n security: SecurityRequirementsInterface[];\n protocol?: string;\n header?: string;\n}\n\nexport const Security: React.FunctionComponent<Props> = ({\n security = [],\n protocol = '',\n header = 'Security',\n}) => {\n let renderedSecurities;\n if (!security?.length) {\n if (protocol === 'kafka' || protocol === 'kafka-secure') {\n renderedSecurities = (\n <SecurityItem protocol={protocol} securitySchema={null} />\n );\n }\n } else {\n const securities: React.ReactNode[] = Object.values(security)\n .map((requirements) => requirements.all())\n .flat()\n .map((requirement) => {\n const def = requirement.scheme();\n const requiredScopes = requirement.scopes();\n\n if (!def) {\n return null;\n }\n return (\n <SecurityItem\n protocol={protocol}\n securitySchema={def}\n requiredScopes={requiredScopes}\n key={def.type()}\n />\n );\n })\n .filter(Boolean);\n\n renderedSecurities = (\n <ul>\n {securities.map((s, idx) => (\n <li className=\"mt-2\" key={idx}>\n {s}\n </li>\n ))}\n </ul>\n );\n }\n\n if (!renderedSecurities) {\n return null;\n }\n\n return (\n <div className=\"text-sm mt-4\">\n <h5 className=\"text-gray-800\">{header}:</h5>\n {renderedSecurities}\n </div>\n );\n};\n\nfunction collectSecuritySchemas(\n securitySchema: SecuritySchemeInterface | null,\n requiredScopes: string[] = [],\n): React.ReactNode[] {\n const schemas: React.ReactNode[] = [];\n if (securitySchema) {\n if (securitySchema.name()) {\n schemas.push(<span>Name: {securitySchema.name()}</span>);\n }\n if (securitySchema.in()) {\n schemas.push(<span>In: {securitySchema.in()}</span>);\n }\n if (securitySchema.scheme()) {\n schemas.push(<span>Scheme: {securitySchema.scheme()}</span>);\n }\n if (securitySchema.bearerFormat()) {\n schemas.push(<span>Bearer format: {securitySchema.bearerFormat()}</span>);\n }\n if (securitySchema.openIdConnectUrl()) {\n schemas.push(\n <Href href={securitySchema.openIdConnectUrl()!} className=\"underline\">\n Connect URL\n </Href>,\n );\n }\n if (requiredScopes.length) {\n schemas.push(<span>Required scopes: {requiredScopes.join(', ')}</span>);\n }\n }\n return schemas;\n}\n\ninterface SecurityItemProps {\n securitySchema: SecuritySchemeInterface | null;\n protocol: string;\n requiredScopes?: string[];\n}\n\nconst SecurityItem: React.FunctionComponent<SecurityItemProps> = ({\n securitySchema,\n protocol,\n requiredScopes,\n}) => {\n const schemas: React.ReactNode[] = collectSecuritySchemas(\n securitySchema,\n requiredScopes,\n );\n\n let renderedKafkaSecurity;\n if (['kafka', 'kafka-secure'].includes(protocol)) {\n const { securityProtocol, saslMechanism } = ServerHelpers.getKafkaSecurity(\n protocol,\n securitySchema,\n );\n\n renderedKafkaSecurity = (\n <div className=\"px-4 py-2 ml-2 mb-2 border border-gray-400 bg-gray-100 rounded\">\n {securityProtocol && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n security.protocol:\n </span>\n <span className=\"inline-block font-bold no-underline bg-indigo-400 text-white text-xs rounded py-0 px-1 ml-1\">\n {securityProtocol}\n </span>\n </div>\n )}\n {saslMechanism && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n sasl.mechanism:\n </span>\n <span className=\"inline-block font-bold no-underline bg-indigo-400 text-white text-xs rounded py-0 px-1 ml-1\">\n {saslMechanism}\n </span>\n </div>\n )}\n </div>\n );\n }\n\n const flows = securitySchema?.flows();\n const unwrappedFlows: Record<string, OAuthFlowInterface> = {};\n if (flows?.hasImplicit()) {\n unwrappedFlows.implicit = flows.implicit()!;\n }\n if (flows?.hasAuthorizationCode()) {\n unwrappedFlows.authorizationCode = flows.authorizationCode()!;\n }\n if (flows?.hasClientCredentials()) {\n unwrappedFlows.clientCredentials = flows.clientCredentials()!;\n }\n if (flows?.hasPassword()) {\n unwrappedFlows.password = flows.implicit()!;\n }\n const renderedFlows = Object.entries(unwrappedFlows).map(\n ([flowName, flow]) => {\n const authorizationUrl = flow.authorizationUrl();\n const tokenUrl = flow.tokenUrl();\n const refreshUrl = flow.refreshUrl();\n const scopes = flow.scopes();\n\n return (\n <div\n className=\"px-4 py-2 ml-2 mb-2 border border-gray-400 bg-gray-100 rounded\"\n key={flowName}\n >\n <div>\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Flow:\n </span>\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n {ServerHelpers.flowName(flowName)}\n </span>\n </div>\n\n {authorizationUrl && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Auth URL:\n </span>\n <Href href={authorizationUrl} className=\"underline\">\n {authorizationUrl}\n </Href>\n </div>\n )}\n {tokenUrl && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Token URL:\n </span>\n <Href href={tokenUrl} className=\"underline\">\n {tokenUrl}\n </Href>\n </div>\n )}\n {refreshUrl && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Refresh URL:\n </span>\n <Href href={refreshUrl} className=\"underline\">\n {refreshUrl}\n </Href>\n </div>\n )}\n {scopes && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Scopes:\n </span>\n <ul className=\"inline-block\">\n {scopes &&\n Object.entries(scopes).map(([scopeName, scopeDesc]) => (\n <li\n className=\"inline-block font-bold no-underline bg-indigo-400 text-white text-xs rounded py-0 px-1 ml-1\"\n title={scopeDesc}\n key={scopeName}\n >\n {scopeName}\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n },\n );\n\n return (\n <div>\n {securitySchema && schemas && (\n <div>\n <span>\n {ServerHelpers.securityType(securitySchema.type())}\n {schemas.length > 0 && (\n <ul className=\"inline-block ml-2\">\n {schemas.map((schema, idx) => (\n <li\n className=\"inline-block font-bold no-underline bg-blue-400 text-white text-xs uppercase rounded px-2 py-0 ml-1\"\n key={idx}\n >\n {schema}\n </li>\n ))}\n </ul>\n )}\n </span>\n </div>\n )}\n\n {securitySchema?.hasDescription() && (\n <div>\n <Markdown>{securitySchema.description()}</Markdown>\n </div>\n )}\n\n {renderedFlows && renderedFlows.length > 0 && (\n <ul className=\"my-2\">\n <li>{renderedFlows}</li>\n </ul>\n )}\n\n {renderedKafkaSecurity && <div>{renderedKafkaSecurity}</div>}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"Security.js","sourceRoot":"","sources":["../../../../src/containers/Servers/Security.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAO1B,+CAAkD;AAClD,yCAA8C;AAQvC,IAAM,QAAQ,G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;QAEA,qBAAqB,IAAI,2CAAM,qBAAqB,CAAO,CACxD,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport {\n OAuthFlowInterface,\n SecurityRequirementsInterface,\n SecuritySchemeInterface,\n} from '@asyncapi/parser';\n\nimport { Href, Markdown } from '../../components';\nimport { ServerHelpers } from '../../helpers';\n\ninterface Props {\n security: SecurityRequirementsInterface[];\n protocol?: string;\n header?: string;\n}\n\nexport const Security: React.FunctionComponent<Props> = ({\n security = [],\n protocol = '',\n header = 'Security',\n}) => {\n let renderedSecurities;\n if (!security?.length) {\n if (protocol === 'kafka' || protocol === 'kafka-secure') {\n renderedSecurities = (\n <SecurityItem protocol={protocol} securitySchema={null} />\n );\n }\n } else {\n const securities: React.ReactNode[] = Object.values(security)\n .map((requirements) => requirements.all())\n .flat()\n .map((requirement) => {\n const def = requirement.scheme();\n const requiredScopes = requirement.scopes();\n\n if (!def) {\n return null;\n }\n return (\n <SecurityItem\n protocol={protocol}\n securitySchema={def}\n requiredScopes={requiredScopes}\n key={def.type()}\n />\n );\n })\n .filter(Boolean);\n\n renderedSecurities = (\n <ul>\n {securities.map((s, idx) => (\n <li className=\"mt-2\" key={idx}>\n {s}\n </li>\n ))}\n </ul>\n );\n }\n\n if (!renderedSecurities) {\n return null;\n }\n\n return (\n <div className=\"text-sm mt-4\">\n <h5 className=\"text-gray-800\">{header}:</h5>\n {renderedSecurities}\n </div>\n );\n};\n\nfunction collectSecuritySchemas(\n securitySchema: SecuritySchemeInterface | null,\n requiredScopes: string[] = [],\n): React.ReactNode[] {\n const schemas: React.ReactNode[] = [];\n if (securitySchema) {\n if (securitySchema.name()) {\n schemas.push(<span>Name: {securitySchema.name()}</span>);\n }\n if (securitySchema.in()) {\n schemas.push(<span>In: {securitySchema.in()}</span>);\n }\n if (securitySchema.scheme()) {\n schemas.push(<span>Scheme: {securitySchema.scheme()}</span>);\n }\n if (securitySchema.bearerFormat()) {\n schemas.push(<span>Bearer format: {securitySchema.bearerFormat()}</span>);\n }\n if (securitySchema.openIdConnectUrl()) {\n schemas.push(\n <Href href={securitySchema.openIdConnectUrl()!} className=\"underline\">\n Connect URL\n </Href>,\n );\n }\n if (requiredScopes.length) {\n schemas.push(<span>Required scopes: {requiredScopes.join(', ')}</span>);\n }\n }\n return schemas;\n}\n\ninterface SecurityItemProps {\n securitySchema: SecuritySchemeInterface | null;\n protocol: string;\n requiredScopes?: string[];\n}\n\nconst SecurityItem: React.FunctionComponent<SecurityItemProps> = ({\n securitySchema,\n protocol,\n requiredScopes,\n}) => {\n const schemas: React.ReactNode[] = collectSecuritySchemas(\n securitySchema,\n requiredScopes,\n );\n\n let renderedKafkaSecurity;\n if (['kafka', 'kafka-secure'].includes(protocol)) {\n const { securityProtocol, saslMechanism } = ServerHelpers.getKafkaSecurity(\n protocol,\n securitySchema,\n );\n\n renderedKafkaSecurity = (\n <div className=\"px-4 py-2 ml-2 mb-2 border border-gray-400 bg-gray-100 rounded\">\n {securityProtocol && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n security.protocol:\n </span>\n <span className=\"inline-block font-bold no-underline bg-indigo-400 text-white text-xs rounded py-0 px-1 ml-1\">\n {securityProtocol}\n </span>\n </div>\n )}\n {saslMechanism && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n sasl.mechanism:\n </span>\n <span className=\"inline-block font-bold no-underline bg-indigo-400 text-white text-xs rounded py-0 px-1 ml-1\">\n {saslMechanism}\n </span>\n </div>\n )}\n </div>\n );\n }\n\n const flows = securitySchema?.flows();\n const unwrappedFlows: Record<string, OAuthFlowInterface> = {};\n if (flows?.hasImplicit()) {\n unwrappedFlows.implicit = flows.implicit()!;\n }\n if (flows?.hasAuthorizationCode()) {\n unwrappedFlows.authorizationCode = flows.authorizationCode()!;\n }\n if (flows?.hasClientCredentials()) {\n unwrappedFlows.clientCredentials = flows.clientCredentials()!;\n }\n if (flows?.hasPassword()) {\n unwrappedFlows.password = flows.password()!;\n }\n const renderedFlows = Object.entries(unwrappedFlows).map(\n ([flowName, flow]) => {\n const authorizationUrl = flow.authorizationUrl();\n const tokenUrl = flow.tokenUrl();\n const refreshUrl = flow.refreshUrl();\n const scopes = flow.scopes();\n\n return (\n <div\n className=\"px-4 py-2 ml-2 mb-2 border border-gray-400 bg-gray-100 rounded\"\n key={flowName}\n >\n <div>\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Flow:\n </span>\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n {ServerHelpers.flowName(flowName)}\n </span>\n </div>\n\n {authorizationUrl && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Auth URL:\n </span>\n <Href href={authorizationUrl} className=\"underline\">\n {authorizationUrl}\n </Href>\n </div>\n )}\n {tokenUrl && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Token URL:\n </span>\n <Href href={tokenUrl} className=\"underline\">\n {tokenUrl}\n </Href>\n </div>\n )}\n {refreshUrl && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Refresh URL:\n </span>\n <Href href={refreshUrl} className=\"underline\">\n {refreshUrl}\n </Href>\n </div>\n )}\n {scopes && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Scopes:\n </span>\n <ul className=\"inline-block\">\n {scopes &&\n Object.entries(scopes).map(([scopeName, scopeDesc]) => (\n <li\n className=\"inline-block font-bold no-underline bg-indigo-400 text-white text-xs rounded py-0 px-1 ml-1\"\n title={scopeDesc}\n key={scopeName}\n >\n {scopeName}\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n },\n );\n\n return (\n <div>\n {securitySchema && schemas && (\n <div>\n <span>\n {ServerHelpers.securityType(securitySchema.type())}\n {schemas.length > 0 && (\n <ul className=\"inline-block ml-2\">\n {schemas.map((schema, idx) => (\n <li\n className=\"inline-block font-bold no-underline bg-blue-400 text-white text-xs uppercase rounded px-2 py-0 ml-1\"\n key={idx}\n >\n {schema}\n </li>\n ))}\n </ul>\n )}\n </span>\n </div>\n )}\n\n {securitySchema?.hasDescription() && (\n <div>\n <Markdown>{securitySchema.description()}</Markdown>\n </div>\n )}\n\n {renderedFlows && renderedFlows.length > 0 && (\n <ul className=\"my-2\">\n <li>{renderedFlows}</li>\n </ul>\n )}\n\n {renderedKafkaSecurity && <div>{renderedKafkaSecurity}</div>}\n </div>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"","sourcesContent":["export interface ConfigInterface {\n schemaID?: string;\n show?: ShowConfig;\n expand?: ExpandConfig;\n sidebar?: SideBarConfig;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parserOptions?: any;\n publishLabel?: string;\n subscribeLabel?: string;\n sendLabel?: string;\n receiveLabel?: string;\n requestLabel?: string;\n replyLabel?: string;\n}\n\nexport interface ShowConfig {\n sidebar?: boolean;\n info?: boolean;\n servers?: boolean;\n operations?: boolean;\n messages?: boolean;\n schemas?: boolean;\n errors?: boolean;\n}\n\nexport interface ExpandConfig {\n messageExamples?: boolean;\n}\n\nexport interface SideBarConfig {\n showServers?: 'byDefault' | 'bySpecTags' | 'byServersTags';\n showOperations?: 'byDefault' | 'bySpecTags' | 'byOperationsTags';\n}\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"","sourcesContent":["export interface ConfigInterface {\n schemaID?: string;\n show?: ShowConfig;\n expand?: ExpandConfig;\n sidebar?: SideBarConfig;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parserOptions?: any;\n publishLabel?: string;\n subscribeLabel?: string;\n sendLabel?: string;\n receiveLabel?: string;\n requestLabel?: string;\n replyLabel?: string;\n}\n\nexport interface ShowConfig {\n sidebar?: boolean;\n info?: boolean;\n servers?: boolean;\n operations?: boolean;\n messages?: boolean;\n messageExamples?: boolean;\n schemas?: boolean;\n errors?: boolean;\n}\n\nexport interface ExpandConfig {\n messageExamples?: boolean;\n}\n\nexport interface SideBarConfig {\n showServers?: 'byDefault' | 'bySpecTags' | 'byServersTags';\n showOperations?: 'byDefault' | 'bySpecTags' | 'byOperationsTags';\n}\n"]}
@@ -7,6 +7,7 @@ export var defaultConfig = {
7
7
  servers: true,
8
8
  operations: true,
9
9
  messages: true,
10
+ messageExamples: false,
10
11
  schemas: true,
11
12
  errors: true,
12
13
  },
@@ -1 +1 @@
1
- {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/config/default.ts"],"names":[],"mappings":"AACA,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAC/B,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,IAAM,aAAa,GAAoB;IAC5C,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;QACJ,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;KACb;IACD,MAAM,EAAE;QACN,eAAe,EAAE,KAAK;KACvB;IACD,OAAO,EAAE;QACP,WAAW,EAAE,WAAW;QACxB,cAAc,EAAE,WAAW;KAC5B;IACD,YAAY,EAAE,0BAA0B;IACxC,cAAc,EAAE,4BAA4B;IAC5C,SAAS,EAAE,uBAAuB;IAClC,YAAY,EAAE,+BAA+B;IAC7C,YAAY,EAAE,0BAA0B;IACxC,UAAU,EAAE,0BAA0B;CACvC,CAAC","sourcesContent":["import { ConfigInterface } from './config';\nimport {\n PUBLISH_LABEL_DEFAULT_TEXT,\n RECEIVE_TEXT_LABEL_DEFAULT_TEXT,\n REPLIER_LABEL_DEFAULT_TEXT,\n REQUEST_LABEL_DEFAULT_TEXT,\n SEND_LABEL_DEFAULT_TEXT,\n SUBSCRIBE_LABEL_DEFAULT_TEXT,\n} from '../constants';\n\nexport const defaultConfig: ConfigInterface = {\n schemaID: '',\n show: {\n sidebar: false,\n info: true,\n servers: true,\n operations: true,\n messages: true,\n schemas: true,\n errors: true,\n },\n expand: {\n messageExamples: false,\n },\n sidebar: {\n showServers: 'byDefault',\n showOperations: 'byDefault',\n },\n publishLabel: PUBLISH_LABEL_DEFAULT_TEXT,\n subscribeLabel: SUBSCRIBE_LABEL_DEFAULT_TEXT,\n sendLabel: SEND_LABEL_DEFAULT_TEXT,\n receiveLabel: RECEIVE_TEXT_LABEL_DEFAULT_TEXT,\n requestLabel: REQUEST_LABEL_DEFAULT_TEXT,\n replyLabel: REPLIER_LABEL_DEFAULT_TEXT,\n};\n"]}
1
+ {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/config/default.ts"],"names":[],"mappings":"AACA,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAC/B,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,IAAM,aAAa,GAAoB;IAC5C,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;QACJ,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,eAAe,EAAE,KAAK;QACtB,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;KACb;IACD,MAAM,EAAE;QACN,eAAe,EAAE,KAAK;KACvB;IACD,OAAO,EAAE;QACP,WAAW,EAAE,WAAW;QACxB,cAAc,EAAE,WAAW;KAC5B;IACD,YAAY,EAAE,0BAA0B;IACxC,cAAc,EAAE,4BAA4B;IAC5C,SAAS,EAAE,uBAAuB;IAClC,YAAY,EAAE,+BAA+B;IAC7C,YAAY,EAAE,0BAA0B;IACxC,UAAU,EAAE,0BAA0B;CACvC,CAAC","sourcesContent":["import { ConfigInterface } from './config';\nimport {\n PUBLISH_LABEL_DEFAULT_TEXT,\n RECEIVE_TEXT_LABEL_DEFAULT_TEXT,\n REPLIER_LABEL_DEFAULT_TEXT,\n REQUEST_LABEL_DEFAULT_TEXT,\n SEND_LABEL_DEFAULT_TEXT,\n SUBSCRIBE_LABEL_DEFAULT_TEXT,\n} from '../constants';\n\nexport const defaultConfig: ConfigInterface = {\n schemaID: '',\n show: {\n sidebar: false,\n info: true,\n servers: true,\n operations: true,\n messages: true,\n messageExamples: false,\n schemas: true,\n errors: true,\n },\n expand: {\n messageExamples: false,\n },\n sidebar: {\n showServers: 'byDefault',\n showOperations: 'byDefault',\n },\n publishLabel: PUBLISH_LABEL_DEFAULT_TEXT,\n subscribeLabel: SUBSCRIBE_LABEL_DEFAULT_TEXT,\n sendLabel: SEND_LABEL_DEFAULT_TEXT,\n receiveLabel: RECEIVE_TEXT_LABEL_DEFAULT_TEXT,\n requestLabel: REQUEST_LABEL_DEFAULT_TEXT,\n replyLabel: REPLIER_LABEL_DEFAULT_TEXT,\n};\n"]}
@@ -12,7 +12,10 @@ export var Messages = function () {
12
12
  }
13
13
  return (React.createElement("section", { id: "".concat(CommonHelpers.getIdentifier('messages', config)), className: "mt-16" },
14
14
  React.createElement("h2", { className: "2xl:w-7/12 text-3xl font-light mb-4 px-8" }, MESSAGES_TEXT),
15
- React.createElement("ul", null, messages.map(function (message, idx) { return (React.createElement("li", { className: "mb-4", key: message.id(), id: CommonHelpers.getIdentifier("message-".concat(message.id()), config) },
16
- React.createElement(Message, { messageName: message.id(), message: message, index: idx + 1, key: message.id() }))); }))));
15
+ React.createElement("ul", null, messages.map(function (message, idx) {
16
+ var _a, _b;
17
+ return (React.createElement("li", { className: "mb-4", key: message.id(), id: CommonHelpers.getIdentifier("message-".concat(message.id()), config) },
18
+ React.createElement(Message, { messageName: message.id(), message: message, index: idx + 1, key: message.id(), showExamples: (_b = (_a = config === null || config === void 0 ? void 0 : config.show) === null || _a === void 0 ? void 0 : _a.messageExamples) !== null && _b !== void 0 ? _b : false })));
19
+ }))));
17
20
  };
18
21
  //# sourceMappingURL=Messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Messages.js","sourceRoot":"","sources":["../../../../src/containers/Messages/Messages.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,CAAC,IAAM,QAAQ,GAA4B;IAC/C,IAAM,QAAQ,GAAG,OAAO,EAAE,CAAC;IAC3B,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,IAAM,QAAQ,GACZ,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC;IAE7E,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QACtC,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,iCACE,EAAE,EAAE,UAAG,aAAa,CAAC,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,CAAE,EACxD,SAAS,EAAC,OAAO;QAEjB,4BAAI,SAAS,EAAC,0CAA0C,IACrD,aAAa,CACX;QACL,gCACG,QAAQ,CAAC,GAAG,CAAC,UAAC,OAAO,EAAE,GAAG,IAAK,OAAA,CAC9B,4BACE,SAAS,EAAC,MAAM,EAChB,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,EACjB,EAAE,EAAE,aAAa,CAAC,aAAa,CAAC,kBAAW,OAAO,CAAC,EAAE,EAAE,CAAE,EAAE,MAAM,CAAC;YAElE,oBAAC,OAAO,IACN,WAAW,EAAE,OAAO,CAAC,EAAE,EAAE,EACzB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,GAAG,GAAG,CAAC,EACd,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,GACjB,CACC,CACN,EAb+B,CAa/B,CAAC,CACC,CACG,CACX,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Message } from './Message';\n\nimport { useConfig, useSpec } from '../../contexts';\nimport { CommonHelpers } from '../../helpers';\nimport { MESSAGES_TEXT } from '../../constants';\n\nexport const Messages: React.FunctionComponent = () => {\n const asyncapi = useSpec();\n const config = useConfig();\n const messages =\n !asyncapi.components().isEmpty() && asyncapi.components().messages().all();\n\n if (!messages || messages.length === 0) {\n return null;\n }\n\n return (\n <section\n id={`${CommonHelpers.getIdentifier('messages', config)}`}\n className=\"mt-16\"\n >\n <h2 className=\"2xl:w-7/12 text-3xl font-light mb-4 px-8\">\n {MESSAGES_TEXT}\n </h2>\n <ul>\n {messages.map((message, idx) => (\n <li\n className=\"mb-4\"\n key={message.id()}\n id={CommonHelpers.getIdentifier(`message-${message.id()}`, config)}\n >\n <Message\n messageName={message.id()}\n message={message}\n index={idx + 1}\n key={message.id()}\n />\n </li>\n ))}\n </ul>\n </section>\n );\n};\n"]}
1
+ {"version":3,"file":"Messages.js","sourceRoot":"","sources":["../../../../src/containers/Messages/Messages.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,CAAC,IAAM,QAAQ,GAA4B;IAC/C,IAAM,QAAQ,GAAG,OAAO,EAAE,CAAC;IAC3B,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,IAAM,QAAQ,GACZ,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC;IAE7E,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QACtC,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,iCACE,EAAE,EAAE,UAAG,aAAa,CAAC,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,CAAE,EACxD,SAAS,EAAC,OAAO;QAEjB,4BAAI,SAAS,EAAC,0CAA0C,IACrD,aAAa,CACX;QACL,gCACG,QAAQ,CAAC,GAAG,CAAC,UAAC,OAAO,EAAE,GAAG;;YAAK,OAAA,CAC9B,4BACE,SAAS,EAAC,MAAM,EAChB,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,EACjB,EAAE,EAAE,aAAa,CAAC,aAAa,CAAC,kBAAW,OAAO,CAAC,EAAE,EAAE,CAAE,EAAE,MAAM,CAAC;gBAElE,oBAAC,OAAO,IACN,WAAW,EAAE,OAAO,CAAC,EAAE,EAAE,EACzB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,GAAG,GAAG,CAAC,EACd,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,EACjB,YAAY,EAAE,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,0CAAE,eAAe,mCAAI,KAAK,GACpD,CACC,CACN,CAAA;SAAA,CAAC,CACC,CACG,CACX,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Message } from './Message';\n\nimport { useConfig, useSpec } from '../../contexts';\nimport { CommonHelpers } from '../../helpers';\nimport { MESSAGES_TEXT } from '../../constants';\n\nexport const Messages: React.FunctionComponent = () => {\n const asyncapi = useSpec();\n const config = useConfig();\n const messages =\n !asyncapi.components().isEmpty() && asyncapi.components().messages().all();\n\n if (!messages || messages.length === 0) {\n return null;\n }\n\n return (\n <section\n id={`${CommonHelpers.getIdentifier('messages', config)}`}\n className=\"mt-16\"\n >\n <h2 className=\"2xl:w-7/12 text-3xl font-light mb-4 px-8\">\n {MESSAGES_TEXT}\n </h2>\n <ul>\n {messages.map((message, idx) => (\n <li\n className=\"mb-4\"\n key={message.id()}\n id={CommonHelpers.getIdentifier(`message-${message.id()}`, config)}\n >\n <Message\n messageName={message.id()}\n message={message}\n index={idx + 1}\n key={message.id()}\n showExamples={config?.show?.messageExamples ?? false}\n />\n </li>\n ))}\n </ul>\n </section>\n );\n};\n"]}
@@ -94,7 +94,7 @@ var SecurityItem = function (_a) {
94
94
  unwrappedFlows.clientCredentials = flows.clientCredentials();
95
95
  }
96
96
  if (flows === null || flows === void 0 ? void 0 : flows.hasPassword()) {
97
- unwrappedFlows.password = flows.implicit();
97
+ unwrappedFlows.password = flows.password();
98
98
  }
99
99
  var renderedFlows = Object.entries(unwrappedFlows).map(function (_a) {
100
100
  var flowName = _a[0], flow = _a[1];
@@ -1 +1 @@
1
- {"version":3,"file":"Security.js","sourceRoot":"","sources":["../../../../src/containers/Servers/Security.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAQ9C,MAAM,CAAC,IAAM,QAAQ,GAAmC,UAAC,EAIxD;QAHC,gBAAa,EAAb,QAAQ,mBAAG,EAAE,KAAA,EACb,gBAAa,EAAb,QAAQ,mBAAG,EAAE,KAAA,EACb,cAAmB,EAAnB,MAAM,mBAAG,UAAU,KAA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MAAM;gBACnB,8BAAM,SAAS,EAAC,qDAAqD,cAE9D;gBACP,4BAAI,SAAS,EAAC,cAAc,IACzB,MAAM;oBACL,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,UAAC,EAAsB;4BAArB,SAAS,QAAA,EAAE,SAAS,QAAA;wBAAM,OAAA,CACrD,4BACE,SAAS,EAAC,6FAA6F,EACvG,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,SAAS,IAEb,SAAS,CACP,CACN;oBARsD,CAQtD,CAAC,CACD,CACD,CACP,CACG,CACP,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,OAAO,CACL;QACG,cAAc,IAAI,OAAO,IAAI,CAC5B;YACE;gBACG,aAAa,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;gBACjD,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CACrB,4BAAI,SAAS,EAAC,mBAAmB,IAC9B,OAAO,CAAC,GAAG,CAAC,UAAC,MAAM,EAAE,GAAG,IAAK,OAAA,CAC5B,4BACE,SAAS,EAAC,qGAAqG,EAC/G,GAAG,EAAE,GAAG,IAEP,MAAM,CACJ,CACN,EAP6B,CAO7B,CAAC,CACC,CACN,CACI,CACH,CACP;QAEA,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,cAAc,EAAE,KAAI,CACnC;YACE,oBAAC,QAAQ,QAAE,cAAc,CAAC,WAAW,EAAE,CAAY,CAC/C,CACP;QAEA,aAAa,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,CAC5C,4BAAI,SAAS,EAAC,MAAM;YAClB,gCAAK,aAAa,CAAM,CACrB,CACN;QAEA,qBAAqB,IAAI,iCAAM,qBAAqB,CAAO,CACxD,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport {\n OAuthFlowInterface,\n SecurityRequirementsInterface,\n SecuritySchemeInterface,\n} from '@asyncapi/parser';\n\nimport { Href, Markdown } from '../../components';\nimport { ServerHelpers } from '../../helpers';\n\ninterface Props {\n security: SecurityRequirementsInterface[];\n protocol?: string;\n header?: string;\n}\n\nexport const Security: React.FunctionComponent<Props> = ({\n security = [],\n protocol = '',\n header = 'Security',\n}) => {\n let renderedSecurities;\n if (!security?.length) {\n if (protocol === 'kafka' || protocol === 'kafka-secure') {\n renderedSecurities = (\n <SecurityItem protocol={protocol} securitySchema={null} />\n );\n }\n } else {\n const securities: React.ReactNode[] = Object.values(security)\n .map((requirements) => requirements.all())\n .flat()\n .map((requirement) => {\n const def = requirement.scheme();\n const requiredScopes = requirement.scopes();\n\n if (!def) {\n return null;\n }\n return (\n <SecurityItem\n protocol={protocol}\n securitySchema={def}\n requiredScopes={requiredScopes}\n key={def.type()}\n />\n );\n })\n .filter(Boolean);\n\n renderedSecurities = (\n <ul>\n {securities.map((s, idx) => (\n <li className=\"mt-2\" key={idx}>\n {s}\n </li>\n ))}\n </ul>\n );\n }\n\n if (!renderedSecurities) {\n return null;\n }\n\n return (\n <div className=\"text-sm mt-4\">\n <h5 className=\"text-gray-800\">{header}:</h5>\n {renderedSecurities}\n </div>\n );\n};\n\nfunction collectSecuritySchemas(\n securitySchema: SecuritySchemeInterface | null,\n requiredScopes: string[] = [],\n): React.ReactNode[] {\n const schemas: React.ReactNode[] = [];\n if (securitySchema) {\n if (securitySchema.name()) {\n schemas.push(<span>Name: {securitySchema.name()}</span>);\n }\n if (securitySchema.in()) {\n schemas.push(<span>In: {securitySchema.in()}</span>);\n }\n if (securitySchema.scheme()) {\n schemas.push(<span>Scheme: {securitySchema.scheme()}</span>);\n }\n if (securitySchema.bearerFormat()) {\n schemas.push(<span>Bearer format: {securitySchema.bearerFormat()}</span>);\n }\n if (securitySchema.openIdConnectUrl()) {\n schemas.push(\n <Href href={securitySchema.openIdConnectUrl()!} className=\"underline\">\n Connect URL\n </Href>,\n );\n }\n if (requiredScopes.length) {\n schemas.push(<span>Required scopes: {requiredScopes.join(', ')}</span>);\n }\n }\n return schemas;\n}\n\ninterface SecurityItemProps {\n securitySchema: SecuritySchemeInterface | null;\n protocol: string;\n requiredScopes?: string[];\n}\n\nconst SecurityItem: React.FunctionComponent<SecurityItemProps> = ({\n securitySchema,\n protocol,\n requiredScopes,\n}) => {\n const schemas: React.ReactNode[] = collectSecuritySchemas(\n securitySchema,\n requiredScopes,\n );\n\n let renderedKafkaSecurity;\n if (['kafka', 'kafka-secure'].includes(protocol)) {\n const { securityProtocol, saslMechanism } = ServerHelpers.getKafkaSecurity(\n protocol,\n securitySchema,\n );\n\n renderedKafkaSecurity = (\n <div className=\"px-4 py-2 ml-2 mb-2 border border-gray-400 bg-gray-100 rounded\">\n {securityProtocol && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n security.protocol:\n </span>\n <span className=\"inline-block font-bold no-underline bg-indigo-400 text-white text-xs rounded py-0 px-1 ml-1\">\n {securityProtocol}\n </span>\n </div>\n )}\n {saslMechanism && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n sasl.mechanism:\n </span>\n <span className=\"inline-block font-bold no-underline bg-indigo-400 text-white text-xs rounded py-0 px-1 ml-1\">\n {saslMechanism}\n </span>\n </div>\n )}\n </div>\n );\n }\n\n const flows = securitySchema?.flows();\n const unwrappedFlows: Record<string, OAuthFlowInterface> = {};\n if (flows?.hasImplicit()) {\n unwrappedFlows.implicit = flows.implicit()!;\n }\n if (flows?.hasAuthorizationCode()) {\n unwrappedFlows.authorizationCode = flows.authorizationCode()!;\n }\n if (flows?.hasClientCredentials()) {\n unwrappedFlows.clientCredentials = flows.clientCredentials()!;\n }\n if (flows?.hasPassword()) {\n unwrappedFlows.password = flows.implicit()!;\n }\n const renderedFlows = Object.entries(unwrappedFlows).map(\n ([flowName, flow]) => {\n const authorizationUrl = flow.authorizationUrl();\n const tokenUrl = flow.tokenUrl();\n const refreshUrl = flow.refreshUrl();\n const scopes = flow.scopes();\n\n return (\n <div\n className=\"px-4 py-2 ml-2 mb-2 border border-gray-400 bg-gray-100 rounded\"\n key={flowName}\n >\n <div>\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Flow:\n </span>\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n {ServerHelpers.flowName(flowName)}\n </span>\n </div>\n\n {authorizationUrl && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Auth URL:\n </span>\n <Href href={authorizationUrl} className=\"underline\">\n {authorizationUrl}\n </Href>\n </div>\n )}\n {tokenUrl && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Token URL:\n </span>\n <Href href={tokenUrl} className=\"underline\">\n {tokenUrl}\n </Href>\n </div>\n )}\n {refreshUrl && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Refresh URL:\n </span>\n <Href href={refreshUrl} className=\"underline\">\n {refreshUrl}\n </Href>\n </div>\n )}\n {scopes && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Scopes:\n </span>\n <ul className=\"inline-block\">\n {scopes &&\n Object.entries(scopes).map(([scopeName, scopeDesc]) => (\n <li\n className=\"inline-block font-bold no-underline bg-indigo-400 text-white text-xs rounded py-0 px-1 ml-1\"\n title={scopeDesc}\n key={scopeName}\n >\n {scopeName}\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n },\n );\n\n return (\n <div>\n {securitySchema && schemas && (\n <div>\n <span>\n {ServerHelpers.securityType(securitySchema.type())}\n {schemas.length > 0 && (\n <ul className=\"inline-block ml-2\">\n {schemas.map((schema, idx) => (\n <li\n className=\"inline-block font-bold no-underline bg-blue-400 text-white text-xs uppercase rounded px-2 py-0 ml-1\"\n key={idx}\n >\n {schema}\n </li>\n ))}\n </ul>\n )}\n </span>\n </div>\n )}\n\n {securitySchema?.hasDescription() && (\n <div>\n <Markdown>{securitySchema.description()}</Markdown>\n </div>\n )}\n\n {renderedFlows && renderedFlows.length > 0 && (\n <ul className=\"my-2\">\n <li>{renderedFlows}</li>\n </ul>\n )}\n\n {renderedKafkaSecurity && <div>{renderedKafkaSecurity}</div>}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"Security.js","sourceRoot":"","sources":["../../../../src/containers/Servers/Security.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAQ9C,MAAM,CAAC,IAAM,QAAQ,GAAmC,UAAC,EAIxD;QAHC,gBAAa,EAAb,QAAQ,mBAAG,EAAE,KAAA,EACb,gBAAa,EAAb,QAAQ,mBAAG,EAAE,KAAA,EACb,cAAmB,EAAnB,MAAM,mBAAG,UAAU,KAAA;IAEnB,IAAI,kBAAkB,CAAC;IACvB,IAAI,CAAC,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAA,EAAE;QACrB,IAAI,QAAQ,KAAK,OAAO,IAAI,QAAQ,KAAK,cAAc,EAAE;YACvD,kBAAkB,GAAG,CACnB,oBAAC,YAAY,IAAC,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,GAAI,CAC3D,CAAC;SACH;KACF;SAAM;QACL,IAAM,UAAU,GAAsB,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;aAC1D,GAAG,CAAC,UAAC,YAAY,IAAK,OAAA,YAAY,CAAC,GAAG,EAAE,EAAlB,CAAkB,CAAC;aACzC,IAAI,EAAE;aACN,GAAG,CAAC,UAAC,WAAW;YACf,IAAM,GAAG,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;YACjC,IAAM,cAAc,GAAG,WAAW,CAAC,MAAM,E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OAAO,CAAC,GAAG,CAAC,UAAC,MAAM,EAAE,GAAG,IAAK,OAAA,CAC5B,4BACE,SAAS,EAAC,qGAAqG,EAC/G,GAAG,EAAE,GAAG,IAEP,MAAM,CACJ,CACN,EAP6B,CAO7B,CAAC,CACC,CACN,CACI,CACH,CACP;QAEA,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,cAAc,EAAE,KAAI,CACnC;YACE,oBAAC,QAAQ,QAAE,cAAc,CAAC,WAAW,EAAE,CAAY,CAC/C,CACP;QAEA,aAAa,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,CAC5C,4BAAI,SAAS,EAAC,MAAM;YAClB,gCAAK,aAAa,CAAM,CACrB,CACN;QAEA,qBAAqB,IAAI,iCAAM,qBAAqB,CAAO,CACxD,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport {\n OAuthFlowInterface,\n SecurityRequirementsInterface,\n SecuritySchemeInterface,\n} from '@asyncapi/parser';\n\nimport { Href, Markdown } from '../../components';\nimport { ServerHelpers } from '../../helpers';\n\ninterface Props {\n security: SecurityRequirementsInterface[];\n protocol?: string;\n header?: string;\n}\n\nexport const Security: React.FunctionComponent<Props> = ({\n security = [],\n protocol = '',\n header = 'Security',\n}) => {\n let renderedSecurities;\n if (!security?.length) {\n if (protocol === 'kafka' || protocol === 'kafka-secure') {\n renderedSecurities = (\n <SecurityItem protocol={protocol} securitySchema={null} />\n );\n }\n } else {\n const securities: React.ReactNode[] = Object.values(security)\n .map((requirements) => requirements.all())\n .flat()\n .map((requirement) => {\n const def = requirement.scheme();\n const requiredScopes = requirement.scopes();\n\n if (!def) {\n return null;\n }\n return (\n <SecurityItem\n protocol={protocol}\n securitySchema={def}\n requiredScopes={requiredScopes}\n key={def.type()}\n />\n );\n })\n .filter(Boolean);\n\n renderedSecurities = (\n <ul>\n {securities.map((s, idx) => (\n <li className=\"mt-2\" key={idx}>\n {s}\n </li>\n ))}\n </ul>\n );\n }\n\n if (!renderedSecurities) {\n return null;\n }\n\n return (\n <div className=\"text-sm mt-4\">\n <h5 className=\"text-gray-800\">{header}:</h5>\n {renderedSecurities}\n </div>\n );\n};\n\nfunction collectSecuritySchemas(\n securitySchema: SecuritySchemeInterface | null,\n requiredScopes: string[] = [],\n): React.ReactNode[] {\n const schemas: React.ReactNode[] = [];\n if (securitySchema) {\n if (securitySchema.name()) {\n schemas.push(<span>Name: {securitySchema.name()}</span>);\n }\n if (securitySchema.in()) {\n schemas.push(<span>In: {securitySchema.in()}</span>);\n }\n if (securitySchema.scheme()) {\n schemas.push(<span>Scheme: {securitySchema.scheme()}</span>);\n }\n if (securitySchema.bearerFormat()) {\n schemas.push(<span>Bearer format: {securitySchema.bearerFormat()}</span>);\n }\n if (securitySchema.openIdConnectUrl()) {\n schemas.push(\n <Href href={securitySchema.openIdConnectUrl()!} className=\"underline\">\n Connect URL\n </Href>,\n );\n }\n if (requiredScopes.length) {\n schemas.push(<span>Required scopes: {requiredScopes.join(', ')}</span>);\n }\n }\n return schemas;\n}\n\ninterface SecurityItemProps {\n securitySchema: SecuritySchemeInterface | null;\n protocol: string;\n requiredScopes?: string[];\n}\n\nconst SecurityItem: React.FunctionComponent<SecurityItemProps> = ({\n securitySchema,\n protocol,\n requiredScopes,\n}) => {\n const schemas: React.ReactNode[] = collectSecuritySchemas(\n securitySchema,\n requiredScopes,\n );\n\n let renderedKafkaSecurity;\n if (['kafka', 'kafka-secure'].includes(protocol)) {\n const { securityProtocol, saslMechanism } = ServerHelpers.getKafkaSecurity(\n protocol,\n securitySchema,\n );\n\n renderedKafkaSecurity = (\n <div className=\"px-4 py-2 ml-2 mb-2 border border-gray-400 bg-gray-100 rounded\">\n {securityProtocol && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n security.protocol:\n </span>\n <span className=\"inline-block font-bold no-underline bg-indigo-400 text-white text-xs rounded py-0 px-1 ml-1\">\n {securityProtocol}\n </span>\n </div>\n )}\n {saslMechanism && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n sasl.mechanism:\n </span>\n <span className=\"inline-block font-bold no-underline bg-indigo-400 text-white text-xs rounded py-0 px-1 ml-1\">\n {saslMechanism}\n </span>\n </div>\n )}\n </div>\n );\n }\n\n const flows = securitySchema?.flows();\n const unwrappedFlows: Record<string, OAuthFlowInterface> = {};\n if (flows?.hasImplicit()) {\n unwrappedFlows.implicit = flows.implicit()!;\n }\n if (flows?.hasAuthorizationCode()) {\n unwrappedFlows.authorizationCode = flows.authorizationCode()!;\n }\n if (flows?.hasClientCredentials()) {\n unwrappedFlows.clientCredentials = flows.clientCredentials()!;\n }\n if (flows?.hasPassword()) {\n unwrappedFlows.password = flows.password()!;\n }\n const renderedFlows = Object.entries(unwrappedFlows).map(\n ([flowName, flow]) => {\n const authorizationUrl = flow.authorizationUrl();\n const tokenUrl = flow.tokenUrl();\n const refreshUrl = flow.refreshUrl();\n const scopes = flow.scopes();\n\n return (\n <div\n className=\"px-4 py-2 ml-2 mb-2 border border-gray-400 bg-gray-100 rounded\"\n key={flowName}\n >\n <div>\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Flow:\n </span>\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n {ServerHelpers.flowName(flowName)}\n </span>\n </div>\n\n {authorizationUrl && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Auth URL:\n </span>\n <Href href={authorizationUrl} className=\"underline\">\n {authorizationUrl}\n </Href>\n </div>\n )}\n {tokenUrl && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Token URL:\n </span>\n <Href href={tokenUrl} className=\"underline\">\n {tokenUrl}\n </Href>\n </div>\n )}\n {refreshUrl && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Refresh URL:\n </span>\n <Href href={refreshUrl} className=\"underline\">\n {refreshUrl}\n </Href>\n </div>\n )}\n {scopes && (\n <div className=\"mt-1\">\n <span className=\"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase\">\n Scopes:\n </span>\n <ul className=\"inline-block\">\n {scopes &&\n Object.entries(scopes).map(([scopeName, scopeDesc]) => (\n <li\n className=\"inline-block font-bold no-underline bg-indigo-400 text-white text-xs rounded py-0 px-1 ml-1\"\n title={scopeDesc}\n key={scopeName}\n >\n {scopeName}\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n },\n );\n\n return (\n <div>\n {securitySchema && schemas && (\n <div>\n <span>\n {ServerHelpers.securityType(securitySchema.type())}\n {schemas.length > 0 && (\n <ul className=\"inline-block ml-2\">\n {schemas.map((schema, idx) => (\n <li\n className=\"inline-block font-bold no-underline bg-blue-400 text-white text-xs uppercase rounded px-2 py-0 ml-1\"\n key={idx}\n >\n {schema}\n </li>\n ))}\n </ul>\n )}\n </span>\n </div>\n )}\n\n {securitySchema?.hasDescription() && (\n <div>\n <Markdown>{securitySchema.description()}</Markdown>\n </div>\n )}\n\n {renderedFlows && renderedFlows.length > 0 && (\n <ul className=\"my-2\">\n <li>{renderedFlows}</li>\n </ul>\n )}\n\n {renderedKafkaSecurity && <div>{renderedKafkaSecurity}</div>}\n </div>\n );\n};\n"]}
@@ -17,6 +17,7 @@ export interface ShowConfig {
17
17
  servers?: boolean;
18
18
  operations?: boolean;
19
19
  messages?: boolean;
20
+ messageExamples?: boolean;
20
21
  schemas?: boolean;
21
22
  errors?: boolean;
22
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,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,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,WAAW,GAAG,YAAY,GAAG,eAAe,CAAC;IAC3D,cAAc,CAAC,EAAE,WAAW,GAAG,YAAY,GAAG,kBAAkB,CAAC;CAClE"}
@@ -1 +1 @@
1
- {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/config/default.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAU3C,eAAO,MAAM,aAAa,EAAE,eAwB3B,CAAC"}
1
+ {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/config/default.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAU3C,eAAO,MAAM,aAAa,EAAE,eAyB3B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Messages.d.ts","sourceRoot":"","sources":["../../../../src/containers/Messages/Messages.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,iBAoC5B,CAAC"}
1
+ {"version":3,"file":"Messages.d.ts","sourceRoot":"","sources":["../../../../src/containers/Messages/Messages.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,iBAqC5B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asyncapi/react-component",
3
- "version": "2.0.4",
3
+ "version": "2.1.1",
4
4
  "private": false,
5
5
  "description": "A React component for AsyncAPI specification.",
6
6
  "repository": {
@@ -73,7 +73,7 @@
73
73
  "@asyncapi/parser": "^3.1.0",
74
74
  "@asyncapi/protobuf-schema-parser": "^3.2.14",
75
75
  "highlight.js": "^10.7.2",
76
- "isomorphic-dompurify": "^0.13.0",
76
+ "isomorphic-dompurify": "^2.12.0",
77
77
  "marked": "^4.0.14",
78
78
  "openapi-sampler": "^1.2.1",
79
79
  "use-resize-observer": "^9.1.0"