@asyncapi/react-component 1.0.0-next.3 → 1.0.0-next.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -3
- package/browser/index.js +8 -6
- package/browser/standalone/index.js +45 -0
- package/browser/standalone/without-parser.js +41 -0
- package/browser/without-parser.js +6 -6
- package/lib/cjs/components/Bindings.js +12 -4
- package/lib/cjs/components/Bindings.js.map +1 -1
- package/lib/cjs/components/CollapseButton.js +4 -3
- package/lib/cjs/components/CollapseButton.js.map +1 -1
- package/lib/cjs/components/Extensions.js +4 -3
- package/lib/cjs/components/Extensions.js.map +1 -1
- package/lib/cjs/components/Href.js +2 -1
- package/lib/cjs/components/Href.js.map +1 -1
- package/lib/cjs/components/JSONSnippet.js +17 -0
- package/lib/cjs/components/JSONSnippet.js.map +1 -0
- package/lib/cjs/components/Markdown.js +4 -4
- package/lib/cjs/components/Markdown.js.map +1 -1
- package/lib/cjs/components/Schema.js +48 -20
- package/lib/cjs/components/Schema.js.map +1 -1
- package/lib/cjs/components/Tag.js +3 -2
- package/lib/cjs/components/Tag.js.map +1 -1
- package/lib/cjs/components/Tags.js +2 -1
- package/lib/cjs/components/Tags.js.map +1 -1
- package/lib/cjs/components/index.js +1 -1
- package/lib/cjs/components/index.js.map +1 -1
- package/lib/cjs/config/config.js.map +1 -1
- package/lib/cjs/config/default.js +1 -0
- package/lib/cjs/config/default.js.map +1 -1
- package/lib/cjs/config/index.js.map +1 -1
- package/lib/cjs/constants.js +3 -48
- package/lib/cjs/constants.js.map +1 -1
- package/lib/cjs/containers/AsyncApi/AsyncApi.js +3 -1
- package/lib/cjs/containers/AsyncApi/AsyncApi.js.map +1 -1
- package/lib/cjs/containers/AsyncApi/Layout.js +28 -20
- package/lib/cjs/containers/AsyncApi/Layout.js.map +1 -1
- package/lib/cjs/containers/AsyncApi/Standalone.js +2 -0
- package/lib/cjs/containers/AsyncApi/Standalone.js.map +1 -1
- package/lib/cjs/containers/Error/Error.js +5 -4
- package/lib/cjs/containers/Error/Error.js.map +1 -1
- package/lib/cjs/containers/Info/Info.js +5 -4
- package/lib/cjs/containers/Info/Info.js.map +1 -1
- package/lib/cjs/containers/Messages/Message.js +15 -7
- package/lib/cjs/containers/Messages/Message.js.map +1 -1
- package/lib/cjs/containers/Messages/MessageExample.js +13 -10
- package/lib/cjs/containers/Messages/MessageExample.js.map +1 -1
- package/lib/cjs/containers/Messages/Messages.js +11 -7
- package/lib/cjs/containers/Messages/Messages.js.map +1 -1
- package/lib/cjs/containers/Operations/Operation.js +60 -33
- package/lib/cjs/containers/Operations/Operation.js.map +1 -1
- package/lib/cjs/containers/Operations/Operations.js +9 -6
- package/lib/cjs/containers/Operations/Operations.js.map +1 -1
- package/lib/cjs/containers/Schemas/Schema.js +21 -0
- package/lib/cjs/containers/Schemas/Schema.js.map +1 -0
- package/lib/cjs/containers/Schemas/Schemas.js +28 -0
- package/lib/cjs/containers/Schemas/Schemas.js.map +1 -0
- package/lib/cjs/containers/Servers/Server.js +9 -5
- package/lib/cjs/containers/Servers/Server.js.map +1 -1
- package/lib/cjs/containers/Servers/ServerSecurity.js +71 -45
- package/lib/cjs/containers/Servers/ServerSecurity.js.map +1 -1
- package/lib/cjs/containers/Servers/Servers.js +7 -4
- package/lib/cjs/containers/Servers/Servers.js.map +1 -1
- package/lib/cjs/containers/Sidebar/Sidebar.js +50 -34
- package/lib/cjs/containers/Sidebar/Sidebar.js.map +1 -1
- package/lib/cjs/contexts/index.js +1 -0
- package/lib/cjs/contexts/index.js.map +1 -1
- package/lib/cjs/contexts/useConfig.js +10 -0
- package/lib/cjs/contexts/useConfig.js.map +1 -0
- package/lib/cjs/contexts/useSpec.js +2 -2
- package/lib/cjs/contexts/useSpec.js.map +1 -1
- package/lib/cjs/helpers/common.js +17 -0
- package/lib/cjs/helpers/common.js.map +1 -0
- package/lib/cjs/helpers/index.js +2 -3
- package/lib/cjs/helpers/index.js.map +1 -1
- package/lib/cjs/helpers/marked.js +34 -0
- package/lib/cjs/helpers/marked.js.map +1 -0
- package/lib/cjs/helpers/message.js +33 -5
- package/lib/cjs/helpers/message.js.map +1 -1
- package/lib/cjs/helpers/parser.js +4 -4
- package/lib/cjs/helpers/parser.js.map +1 -1
- package/lib/cjs/helpers/schema.js +136 -110
- package/lib/cjs/helpers/schema.js.map +1 -1
- package/lib/cjs/helpers/server.js +49 -0
- package/lib/cjs/helpers/server.js.map +1 -1
- package/lib/cjs/helpers/specification.js +3 -0
- package/lib/cjs/helpers/specification.js.map +1 -1
- package/lib/cjs/index.js +3 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/types.js +4 -51
- package/lib/cjs/types.js.map +1 -1
- package/lib/cjs/without-parser.js +3 -0
- package/lib/cjs/without-parser.js.map +1 -1
- package/lib/esm/components/Bindings.js +10 -3
- package/lib/esm/components/Bindings.js.map +1 -1
- package/lib/esm/components/CollapseButton.js +2 -2
- package/lib/esm/components/CollapseButton.js.map +1 -1
- package/lib/esm/components/Extensions.js +2 -2
- package/lib/esm/components/Extensions.js.map +1 -1
- package/lib/esm/components/Href.js.map +1 -1
- package/lib/esm/components/JSONSnippet.js +10 -0
- package/lib/esm/components/JSONSnippet.js.map +1 -0
- package/lib/esm/components/Markdown.js +2 -3
- package/lib/esm/components/Markdown.js.map +1 -1
- package/lib/esm/components/Schema.js +45 -18
- package/lib/esm/components/Schema.js.map +1 -1
- package/lib/esm/components/Tag.js +1 -1
- package/lib/esm/components/Tag.js.map +1 -1
- package/lib/esm/components/Tags.js.map +1 -1
- package/lib/esm/components/index.js +1 -1
- package/lib/esm/components/index.js.map +1 -1
- package/lib/esm/config/config.js.map +1 -1
- package/lib/esm/config/default.js +1 -0
- package/lib/esm/config/default.js.map +1 -1
- package/lib/esm/config/index.js.map +1 -1
- package/lib/esm/constants.js +1 -47
- package/lib/esm/constants.js.map +1 -1
- package/lib/esm/containers/AsyncApi/AsyncApi.js +2 -0
- package/lib/esm/containers/AsyncApi/AsyncApi.js.map +1 -1
- package/lib/esm/containers/AsyncApi/Layout.js +28 -20
- package/lib/esm/containers/AsyncApi/Layout.js.map +1 -1
- package/lib/esm/containers/AsyncApi/Standalone.js +2 -0
- package/lib/esm/containers/AsyncApi/Standalone.js.map +1 -1
- package/lib/esm/containers/Error/Error.js +3 -3
- package/lib/esm/containers/Error/Error.js.map +1 -1
- package/lib/esm/containers/Info/Info.js +2 -2
- package/lib/esm/containers/Info/Info.js.map +1 -1
- package/lib/esm/containers/Messages/Message.js +13 -6
- package/lib/esm/containers/Messages/Message.js.map +1 -1
- package/lib/esm/containers/Messages/MessageExample.js +9 -8
- package/lib/esm/containers/Messages/MessageExample.js.map +1 -1
- package/lib/esm/containers/Messages/Messages.js +10 -7
- package/lib/esm/containers/Messages/Messages.js.map +1 -1
- package/lib/esm/containers/Operations/Operation.js +58 -33
- package/lib/esm/containers/Operations/Operation.js.map +1 -1
- package/lib/esm/containers/Operations/Operations.js +7 -5
- package/lib/esm/containers/Operations/Operations.js.map +1 -1
- package/lib/esm/containers/Schemas/Schema.js +14 -0
- package/lib/esm/containers/Schemas/Schema.js.map +1 -0
- package/lib/esm/containers/Schemas/Schemas.js +21 -0
- package/lib/esm/containers/Schemas/Schemas.js.map +1 -0
- package/lib/esm/containers/Servers/Server.js +8 -5
- package/lib/esm/containers/Servers/Server.js.map +1 -1
- package/lib/esm/containers/Servers/ServerSecurity.js +68 -43
- package/lib/esm/containers/Servers/ServerSecurity.js.map +1 -1
- package/lib/esm/containers/Servers/Servers.js +5 -3
- package/lib/esm/containers/Servers/Servers.js.map +1 -1
- package/lib/esm/containers/Sidebar/Sidebar.js +34 -22
- package/lib/esm/containers/Sidebar/Sidebar.js.map +1 -1
- package/lib/esm/contexts/index.js +1 -0
- package/lib/esm/contexts/index.js.map +1 -1
- package/lib/esm/contexts/useConfig.js +6 -0
- package/lib/esm/contexts/useConfig.js.map +1 -0
- package/lib/esm/contexts/useSpec.js +2 -2
- package/lib/esm/contexts/useSpec.js.map +1 -1
- package/lib/esm/helpers/common.js +14 -0
- package/lib/esm/helpers/common.js.map +1 -0
- package/lib/esm/helpers/index.js +2 -3
- package/lib/esm/helpers/index.js.map +1 -1
- package/lib/esm/helpers/marked.js +27 -0
- package/lib/esm/helpers/marked.js.map +1 -0
- package/lib/esm/helpers/message.js +32 -4
- package/lib/esm/helpers/message.js.map +1 -1
- package/lib/esm/helpers/parser.js.map +1 -1
- package/lib/esm/helpers/schema.js +135 -109
- package/lib/esm/helpers/schema.js.map +1 -1
- package/lib/esm/helpers/server.js +49 -0
- package/lib/esm/helpers/server.js.map +1 -1
- package/lib/esm/helpers/specification.js +5 -2
- package/lib/esm/helpers/specification.js.map +1 -1
- package/lib/esm/index.js +2 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/types.js +2 -46
- package/lib/esm/types.js.map +1 -1
- package/lib/esm/without-parser.js +2 -0
- package/lib/esm/without-parser.js.map +1 -1
- package/lib/types/components/Bindings.d.ts.map +1 -1
- package/lib/types/components/Extensions.d.ts.map +1 -1
- package/lib/types/components/JSONSnippet.d.ts +7 -0
- package/lib/types/components/JSONSnippet.d.ts.map +1 -0
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Schema.d.ts +3 -2
- package/lib/types/components/Schema.d.ts.map +1 -1
- package/lib/types/components/index.d.ts +1 -1
- package/lib/types/components/index.d.ts.map +1 -1
- package/lib/types/config/config.d.ts +1 -0
- package/lib/types/config/config.d.ts.map +1 -1
- package/lib/types/config/default.d.ts.map +1 -1
- package/lib/types/constants.d.ts +1 -26
- package/lib/types/constants.d.ts.map +1 -1
- package/lib/types/containers/AsyncApi/Layout.d.ts.map +1 -1
- package/lib/types/containers/Messages/Message.d.ts +1 -0
- package/lib/types/containers/Messages/Message.d.ts.map +1 -1
- package/lib/types/containers/Messages/MessageExample.d.ts +2 -1
- package/lib/types/containers/Messages/MessageExample.d.ts.map +1 -1
- package/lib/types/containers/Messages/Messages.d.ts.map +1 -1
- package/lib/types/containers/Operations/Operation.d.ts +1 -0
- package/lib/types/containers/Operations/Operation.d.ts.map +1 -1
- package/lib/types/containers/Operations/Operations.d.ts.map +1 -1
- package/lib/types/containers/Schemas/Schema.d.ts +9 -0
- package/lib/types/containers/Schemas/Schema.d.ts.map +1 -0
- package/lib/types/containers/Schemas/Schemas.d.ts +3 -0
- package/lib/types/containers/Schemas/Schemas.d.ts.map +1 -0
- package/lib/types/containers/Servers/Server.d.ts.map +1 -1
- package/lib/types/containers/Servers/ServerSecurity.d.ts +1 -0
- package/lib/types/containers/Servers/ServerSecurity.d.ts.map +1 -1
- package/lib/types/containers/Servers/Servers.d.ts.map +1 -1
- package/lib/types/containers/Sidebar/Sidebar.d.ts.map +1 -1
- package/lib/types/contexts/index.d.ts +1 -0
- package/lib/types/contexts/index.d.ts.map +1 -1
- package/lib/types/contexts/useConfig.d.ts +5 -0
- package/lib/types/contexts/useConfig.d.ts.map +1 -0
- package/lib/types/contexts/useSpec.d.ts +1 -3
- package/lib/types/contexts/useSpec.d.ts.map +1 -1
- package/lib/types/helpers/common.d.ts +5 -0
- package/lib/types/helpers/common.d.ts.map +1 -0
- package/lib/types/helpers/index.d.ts +2 -3
- package/lib/types/helpers/index.d.ts.map +1 -1
- package/lib/types/helpers/marked.d.ts +4 -0
- package/lib/types/helpers/marked.d.ts.map +1 -0
- package/lib/types/helpers/message.d.ts +3 -2
- package/lib/types/helpers/message.d.ts.map +1 -1
- package/lib/types/helpers/schema.d.ts +8 -3
- package/lib/types/helpers/schema.d.ts.map +1 -1
- package/lib/types/helpers/server.d.ts +6 -1
- package/lib/types/helpers/server.d.ts.map +1 -1
- package/lib/types/helpers/specification.d.ts.map +1 -1
- package/lib/types/index.d.ts +2 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/types.d.ts +10 -303
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/without-parser.d.ts +2 -0
- package/lib/types/without-parser.d.ts.map +1 -1
- package/package.json +31 -13
- package/styles/default.css +879 -648
- package/styles/default.min.css +4 -2
- package/lib/cjs/components/Code.js +0 -15
- package/lib/cjs/components/Code.js.map +0 -1
- package/lib/cjs/helpers/bemClasses.js +0 -49
- package/lib/cjs/helpers/bemClasses.js.map +0 -1
- package/lib/cjs/helpers/formatJsonHighlight.js +0 -61
- package/lib/cjs/helpers/formatJsonHighlight.js.map +0 -1
- package/lib/cjs/helpers/toKebabCase.js +0 -15
- package/lib/cjs/helpers/toKebabCase.js.map +0 -1
- package/lib/esm/components/Code.js +0 -9
- package/lib/esm/components/Code.js.map +0 -1
- package/lib/esm/helpers/bemClasses.js +0 -46
- package/lib/esm/helpers/bemClasses.js.map +0 -1
- package/lib/esm/helpers/formatJsonHighlight.js +0 -57
- package/lib/esm/helpers/formatJsonHighlight.js.map +0 -1
- package/lib/esm/helpers/toKebabCase.js +0 -11
- package/lib/esm/helpers/toKebabCase.js.map +0 -1
- package/lib/types/components/Code.d.ts +0 -7
- package/lib/types/components/Code.d.ts.map +0 -1
- package/lib/types/helpers/bemClasses.d.ts +0 -14
- package/lib/types/helpers/bemClasses.d.ts.map +0 -1
- package/lib/types/helpers/formatJsonHighlight.d.ts +0 -2
- package/lib/types/helpers/formatJsonHighlight.d.ts.map +0 -1
- package/lib/types/helpers/toKebabCase.d.ts +0 -2
- package/lib/types/helpers/toKebabCase.d.ts.map +0 -1
package/lib/cjs/types.js
CHANGED
|
@@ -1,60 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
BindingsType["http"] = "http";
|
|
7
|
-
BindingsType["ws"] = "ws";
|
|
8
|
-
BindingsType["kafka"] = "kafka";
|
|
9
|
-
BindingsType["amqp"] = "amqp";
|
|
10
|
-
BindingsType["amqp1"] = "amqp1";
|
|
11
|
-
BindingsType["mqtt"] = "mqtt";
|
|
12
|
-
BindingsType["mqtt5"] = "mqtt5";
|
|
13
|
-
BindingsType["nats"] = "nats";
|
|
14
|
-
BindingsType["jms"] = "jms";
|
|
15
|
-
BindingsType["sns"] = "sns";
|
|
16
|
-
BindingsType["sqs"] = "sqs";
|
|
17
|
-
BindingsType["stomp"] = "stomp";
|
|
18
|
-
BindingsType["redis"] = "redis";
|
|
19
|
-
})(BindingsType = exports.BindingsType || (exports.BindingsType = {}));
|
|
20
|
-
function isRawMessage(message) {
|
|
21
|
-
return !message.oneOf;
|
|
3
|
+
exports.PayloadType = exports.isFetchingSchemaInterface = void 0;
|
|
4
|
+
function isFetchingSchemaInterface(schema) {
|
|
5
|
+
return schema.url !== undefined;
|
|
22
6
|
}
|
|
23
|
-
exports.
|
|
7
|
+
exports.isFetchingSchemaInterface = isFetchingSchemaInterface;
|
|
24
8
|
var PayloadType;
|
|
25
9
|
(function (PayloadType) {
|
|
26
10
|
PayloadType["PUBLISH"] = "publish";
|
|
27
11
|
PayloadType["SUBSCRIBE"] = "subscribe";
|
|
28
12
|
})(PayloadType = exports.PayloadType || (exports.PayloadType = {}));
|
|
29
|
-
function isOneOfPayload(payload) {
|
|
30
|
-
return !!payload && payload.oneOf !== undefined;
|
|
31
|
-
}
|
|
32
|
-
exports.isOneOfPayload = isOneOfPayload;
|
|
33
|
-
function isAnyOfPayload(payload) {
|
|
34
|
-
return !!payload && payload.anyOf !== undefined;
|
|
35
|
-
}
|
|
36
|
-
exports.isAnyOfPayload = isAnyOfPayload;
|
|
37
|
-
var SecuritySchemeType;
|
|
38
|
-
(function (SecuritySchemeType) {
|
|
39
|
-
SecuritySchemeType["userPassword"] = "User / Password";
|
|
40
|
-
SecuritySchemeType["apiKey"] = "API key";
|
|
41
|
-
SecuritySchemeType["X509"] = "X509";
|
|
42
|
-
SecuritySchemeType["symmetricEncryption"] = "Symmetric Encryption";
|
|
43
|
-
SecuritySchemeType["asymmetricEncryption"] = "Asymmetric Encryption";
|
|
44
|
-
SecuritySchemeType["httpApiKey"] = "HTTP API key";
|
|
45
|
-
SecuritySchemeType["http"] = "HTTP";
|
|
46
|
-
SecuritySchemeType["oauth2"] = "OAuth2";
|
|
47
|
-
SecuritySchemeType["openIdConnect"] = "Open ID";
|
|
48
|
-
})(SecuritySchemeType = exports.SecuritySchemeType || (exports.SecuritySchemeType = {}));
|
|
49
|
-
var OAuthFlowsType;
|
|
50
|
-
(function (OAuthFlowsType) {
|
|
51
|
-
OAuthFlowsType["implicit"] = "Implicit";
|
|
52
|
-
OAuthFlowsType["password"] = "Password";
|
|
53
|
-
OAuthFlowsType["clientCredentials"] = "Client Credentials";
|
|
54
|
-
OAuthFlowsType["authorizationCode"] = "Authorization Code";
|
|
55
|
-
})(OAuthFlowsType = exports.OAuthFlowsType || (exports.OAuthFlowsType = {}));
|
|
56
|
-
function isFetchingSchemaInterface(schema) {
|
|
57
|
-
return schema.url !== undefined;
|
|
58
|
-
}
|
|
59
|
-
exports.isFetchingSchemaInterface = isFetchingSchemaInterface;
|
|
60
13
|
//# sourceMappingURL=types.js.map
|
package/lib/cjs/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAeA,SAAgB,yBAAyB,CACvC,MAAmB;IAEnB,OAAQ,MAAkC,CAAC,GAAG,KAAK,SAAS,CAAC;AAC/D,CAAC;AAJD,8DAIC;AAYD,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;AACzB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB","sourcesContent":["import { AsyncAPIDocument } from '@asyncapi/parser';\n\nexport type PropsSchema =\n | string\n | FetchingSchemaInterface\n | AsyncAPIDocument\n | object;\n\nexport type NullableAsyncApi = AsyncAPIDocument | null;\n\nexport interface AsyncApiState {\n validatedSchema: NullableAsyncApi;\n error?: ErrorObject;\n}\n\nexport function isFetchingSchemaInterface(\n schema: PropsSchema,\n): schema is FetchingSchemaInterface {\n return (schema as FetchingSchemaInterface).url !== undefined;\n}\n\nexport interface FetchingSchemaInterface {\n url: string;\n requestOptions?: RequestInit;\n}\n\nexport interface ParserReturn {\n asyncapi?: AsyncAPIDocument;\n error?: ErrorObject;\n}\n\nexport enum PayloadType {\n PUBLISH = 'publish',\n SUBSCRIBE = 'subscribe',\n}\n\nexport interface MessageExample {\n name?: string;\n summary?: string;\n example: any;\n}\n\nexport interface ValidationError {\n title: string;\n location: {\n jsonPointer: string;\n startLine: number;\n startColumn: number;\n startOffset: number;\n endLine: number;\n endColumn: number;\n endOffset: number;\n };\n}\n\nexport interface ErrorObject {\n type: string;\n title: string;\n detail?: string;\n parsedJSON?: any;\n validationErrors?: ValidationError[];\n location?: {\n startLine: number;\n startColumn: number;\n startOffset: number;\n };\n refs?: Array<{\n title: string;\n jsonPointer: string;\n startLine: number;\n startColumn: number;\n startOffset: number;\n endLine: number;\n endColumn: number;\n endOffset: number;\n }>;\n}\n"]}
|
|
@@ -3,6 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.hljs = void 0;
|
|
6
7
|
var Standalone_1 = __importDefault(require("./containers/AsyncApi/Standalone"));
|
|
8
|
+
var helpers_1 = require("./helpers");
|
|
9
|
+
Object.defineProperty(exports, "hljs", { enumerable: true, get: function () { return helpers_1.hljs; } });
|
|
7
10
|
exports.default = Standalone_1.default;
|
|
8
11
|
//# sourceMappingURL=without-parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"without-parser.js","sourceRoot":"","sources":["../../src/without-parser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"without-parser.js","sourceRoot":"","sources":["../../src/without-parser.ts"],"names":[],"mappings":";;;;;;AAAA,gFAAiE;AAEjE,qCAAiC;AAExB,qFAFA,cAAI,OAEA;AACb,kBAAe,oBAAiB,CAAC","sourcesContent":["import AsyncApiComponent from './containers/AsyncApi/Standalone';\n\nimport { hljs } from './helpers';\n\nexport { hljs };\nexport default AsyncApiComponent;\n"]}
|
|
@@ -2,11 +2,18 @@ import React from 'react';
|
|
|
2
2
|
import { Schema } from './Schema';
|
|
3
3
|
import { SchemaHelpers } from '../helpers';
|
|
4
4
|
export var Bindings = function (_a) {
|
|
5
|
-
var _b = _a.name, name = _b === void 0 ? '
|
|
5
|
+
var _b = _a.name, name = _b === void 0 ? 'Binding specific information' : _b, bindings = _a.bindings;
|
|
6
6
|
if (!bindings || !Object.keys(bindings).length) {
|
|
7
7
|
return null;
|
|
8
8
|
}
|
|
9
|
-
var
|
|
10
|
-
|
|
9
|
+
var renderedBindings = Object.entries(bindings).map(function (_a) {
|
|
10
|
+
var bindingName = _a[0], binding = _a[1];
|
|
11
|
+
var schema = SchemaHelpers.jsonToSchema(binding);
|
|
12
|
+
var schemaName = (React.createElement("div", { className: "inline-block text-sm" },
|
|
13
|
+
React.createElement("span", null, name),
|
|
14
|
+
React.createElement("span", { className: "bg-teal-500 font-bold no-underline text-white uppercase rounded mx-2 px-2 py-1 text-xs" }, bindingName)));
|
|
15
|
+
return (schema && (React.createElement(Schema, { schemaName: schemaName, schema: schema, key: bindingName, onlyTitle: true })));
|
|
16
|
+
});
|
|
17
|
+
return React.createElement(React.Fragment, null, renderedBindings);
|
|
11
18
|
};
|
|
12
19
|
//# sourceMappingURL=Bindings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bindings.js","sourceRoot":"","sources":["../../../src/components/Bindings.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAO3C,MAAM,CAAC,IAAM,QAAQ,GAAmC,UAAC,EAGxD;QAFC,
|
|
1
|
+
{"version":3,"file":"Bindings.js","sourceRoot":"","sources":["../../../src/components/Bindings.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAO3C,MAAM,CAAC,IAAM,QAAQ,GAAmC,UAAC,EAGxD;QAFC,YAAqC,EAArC,IAAI,mBAAG,8BAA8B,KAAA,EACrC,QAAQ,cAAA;IAER,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE;QAC9C,OAAO,IAAI,CAAC;KACb;IAED,IAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,CACnD,UAAC,EAAsB;YAArB,WAAW,QAAA,EAAE,OAAO,QAAA;QACpB,IAAM,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACnD,IAAM,UAAU,GAAG,CACjB,6BAAK,SAAS,EAAC,sBAAsB;YACnC,kCAAO,IAAI,CAAQ;YACnB,8BAAM,SAAS,EAAC,wFAAwF,IACrG,WAAW,CACP,CACH,CACP,CAAC;QACF,OAAO,CACL,MAAM,IAAI,CACR,oBAAC,MAAM,IACL,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,WAAW,EAChB,SAAS,EAAE,IAAI,GACf,CACH,CACF,CAAC;IACJ,CAAC,CACF,CAAC;IACF,OAAO,0CAAG,gBAAgB,CAAI,CAAC;AACjC,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Schema } from './Schema';\n\nimport { SchemaHelpers } from '../helpers';\n\ninterface Props {\n name?: string;\n bindings: any;\n}\n\nexport const Bindings: React.FunctionComponent<Props> = ({\n name = 'Binding specific information',\n bindings,\n}) => {\n if (!bindings || !Object.keys(bindings).length) {\n return null;\n }\n\n const renderedBindings = Object.entries(bindings).map(\n ([bindingName, binding]) => {\n const schema = SchemaHelpers.jsonToSchema(binding);\n const schemaName = (\n <div className=\"inline-block text-sm\">\n <span>{name}</span>\n <span className=\"bg-teal-500 font-bold no-underline text-white uppercase rounded mx-2 px-2 py-1 text-xs\">\n {bindingName}\n </span>\n </div>\n );\n return (\n schema && (\n <Schema\n schemaName={schemaName}\n schema={schema}\n key={bindingName}\n onlyTitle={true}\n />\n )\n );\n },\n );\n return <>{renderedBindings}</>;\n};\n"]}
|
|
@@ -23,9 +23,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
23
23
|
import React from 'react';
|
|
24
24
|
export var CollapseButton = function (_a) {
|
|
25
25
|
var chevronProps = _a.chevronProps, children = _a.children, rest = __rest(_a, ["chevronProps", "children"]);
|
|
26
|
-
return (React.createElement("button", __assign({}, rest, { className: "focus:outline-none "
|
|
26
|
+
return (React.createElement("button", __assign({}, rest, { className: "focus:outline-none ".concat(rest.className) }),
|
|
27
27
|
children,
|
|
28
|
-
React.createElement("svg", __assign({ version: "1.1", viewBox: "0 0 24 24", x: "0", xmlns: "http://www.w3.org/2000/svg", y: "0" }, chevronProps, { className: "inline-block align-baseline cursor-pointer -mb-1 w-5 transform transition-transform duration-150 ease-linear "
|
|
28
|
+
React.createElement("svg", __assign({ version: "1.1", viewBox: "0 0 24 24", x: "0", xmlns: "http://www.w3.org/2000/svg", y: "0" }, chevronProps, { className: "inline-block align-baseline cursor-pointer -mb-1 w-5 transform transition-transform duration-150 ease-linear ".concat((chevronProps === null || chevronProps === void 0 ? void 0 : chevronProps.className) ||
|
|
29
29
|
'') }),
|
|
30
30
|
React.createElement("polygon", { points: "17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 " }))));
|
|
31
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapseButton.js","sourceRoot":"","sources":["../../../src/components/CollapseButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAA8C,MAAM,OAAO,CAAC;AAMnE,MAAM,CAAC,IAAM,cAAc,GAAmC,UAAC,EAI9D;IAHC,IAAA,YAAY,kBAAA,EACZ,QAAQ,cAAA,EACL,IAAI,cAHsD,4BAI9D,CADQ;IACH,OAAA,CACJ,2CAAY,IAAI,IAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"CollapseButton.js","sourceRoot":"","sources":["../../../src/components/CollapseButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAA8C,MAAM,OAAO,CAAC;AAMnE,MAAM,CAAC,IAAM,cAAc,GAAmC,UAAC,EAI9D;IAHC,IAAA,YAAY,kBAAA,EACZ,QAAQ,cAAA,EACL,IAAI,cAHsD,4BAI9D,CADQ;IACH,OAAA,CACJ,2CAAY,IAAI,IAAE,SAAS,EAAE,6BAAsB,IAAI,CAAC,SAAS,CAAE;QAChE,QAAQ;QACT,sCACE,OAAO,EAAC,KAAK,EACb,OAAO,EAAC,WAAW,EACnB,CAAC,EAAC,GAAG,EACL,KAAK,EAAC,4BAA4B,EAClC,CAAC,EAAC,GAAG,IACD,YAAY,IAChB,SAAS,EAAE,uHAAgH,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,SAAS;gBAChJ,EAAE,CAAE;YAEN,iCAAS,MAAM,EAAC,oDAAoD,GAAG,CACnE,CACC,CACV,CAAA;CAAA,CAAC","sourcesContent":["import React, { ButtonHTMLAttributes, SVGAttributes } from 'react';\n\ninterface Props extends ButtonHTMLAttributes<HTMLButtonElement> {\n chevronProps?: SVGAttributes<SVGElement>;\n}\n\nexport const CollapseButton: React.FunctionComponent<Props> = ({\n chevronProps,\n children,\n ...rest\n}) => (\n <button {...rest} className={`focus:outline-none ${rest.className}`}>\n {children}\n <svg\n version=\"1.1\"\n viewBox=\"0 0 24 24\"\n x=\"0\"\n xmlns=\"http://www.w3.org/2000/svg\"\n y=\"0\"\n {...chevronProps}\n className={`inline-block align-baseline cursor-pointer -mb-1 w-5 transform transition-transform duration-150 ease-linear ${chevronProps?.className ||\n ''}`}\n >\n <polygon points=\"17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 \" />\n </svg>\n </button>\n);\n"]}
|
|
@@ -8,7 +8,7 @@ export var Extensions = function (_a) {
|
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
10
|
var schema = SchemaHelpers.jsonToSchema(extensions);
|
|
11
|
-
return (React.createElement("div", { className: "mt-2" },
|
|
12
|
-
React.createElement(Schema, { schemaName: name, schema: schema })));
|
|
11
|
+
return (schema && (React.createElement("div", { className: "mt-2" },
|
|
12
|
+
React.createElement(Schema, { schemaName: name, schema: schema, onlyTitle: true }))));
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=Extensions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Extensions.js","sourceRoot":"","sources":["../../../src/components/Extensions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAO3C,MAAM,CAAC,IAAM,UAAU,GAAmC,UAAC,EAG1D;QAFC,YAAmB,EAAnB,IAAI,mBAAG,YAAY,KAAA,EACnB,IAAI,UAAA;IAEJ,IAAM,UAAU,GAAG,aAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC3D,IAAI,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE;QAClD,OAAO,IAAI,CAAC;KACb;IAED,IAAM,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACtD,OAAO,CACL,6BAAK,SAAS,EAAC,MAAM;QACnB,oBAAC,MAAM,IAAC,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAI,
|
|
1
|
+
{"version":3,"file":"Extensions.js","sourceRoot":"","sources":["../../../src/components/Extensions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAO3C,MAAM,CAAC,IAAM,UAAU,GAAmC,UAAC,EAG1D;QAFC,YAAmB,EAAnB,IAAI,mBAAG,YAAY,KAAA,EACnB,IAAI,UAAA;IAEJ,IAAM,UAAU,GAAG,aAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC3D,IAAI,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE;QAClD,OAAO,IAAI,CAAC;KACb;IAED,IAAM,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACtD,OAAO,CACL,MAAM,IAAI,CACR,6BAAK,SAAS,EAAC,MAAM;QACnB,oBAAC,MAAM,IAAC,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,GAAI,CACzD,CACP,CACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Schema } from './Schema';\n\nimport { SchemaHelpers } from '../helpers';\n\ninterface Props {\n name?: string;\n item: any;\n}\n\nexport const Extensions: React.FunctionComponent<Props> = ({\n name = 'Extensions',\n item,\n}) => {\n const extensions = SchemaHelpers.getCustomExtensions(item);\n if (!extensions || !Object.keys(extensions).length) {\n return null;\n }\n\n const schema = SchemaHelpers.jsonToSchema(extensions);\n return (\n schema && (\n <div className=\"mt-2\">\n <Schema schemaName={name} schema={schema} onlyTitle={true} />\n </div>\n )\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Href.js","sourceRoot":"","sources":["../../../src/components/Href.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,CAAC,IAAM,IAAI,GAAmC,UAAC,EAKpD;QAJC,IAAI,UAAA,EACJ,KAAK,WAAA,EACL,SAAS,eAAA,EACT,QAAQ,cAAA;IACJ,OAAA,CACJ,2BACE,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,8BAA8B,IAEjC,QAAQ,CACP,CACL;AAVK,CAUL,CAAC"}
|
|
1
|
+
{"version":3,"file":"Href.js","sourceRoot":"","sources":["../../../src/components/Href.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,CAAC,IAAM,IAAI,GAAmC,UAAC,EAKpD;QAJC,IAAI,UAAA,EACJ,KAAK,WAAA,EACL,SAAS,eAAA,EACT,QAAQ,cAAA;IACJ,OAAA,CACJ,2BACE,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,8BAA8B,IAEjC,QAAQ,CACP,CACL;AAVK,CAUL,CAAC","sourcesContent":["import React from 'react';\n\ninterface Props {\n href: string;\n title?: string;\n className?: string;\n}\n\nexport const Href: React.FunctionComponent<Props> = ({\n href,\n title,\n className,\n children,\n}) => (\n <a\n href={href}\n title={title}\n className={className}\n target=\"_blank\"\n rel=\"nofollow noopener noreferrer\"\n >\n {children}\n </a>\n);\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Markdown } from './index';
|
|
3
|
+
export var JSONSnippet = function (_a) {
|
|
4
|
+
var snippet = _a.snippet;
|
|
5
|
+
if (typeof snippet === 'object') {
|
|
6
|
+
snippet = '```json\n' + JSON.stringify(snippet, undefined, 2) + '\n```';
|
|
7
|
+
}
|
|
8
|
+
return React.createElement(Markdown, null, snippet);
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=JSONSnippet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JSONSnippet.js","sourceRoot":"","sources":["../../../src/components/JSONSnippet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAMnC,MAAM,CAAC,IAAM,WAAW,GAAmC,UAAC,EAAW;QAAT,OAAO,aAAA;IACnE,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAE/B,OAAO,GAAG,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC;KACzE;IAED,OAAO,oBAAC,QAAQ,QAAE,OAAO,CAAY,CAAC;AACxC,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Markdown } from './index';\n\ninterface Props {\n snippet: string | object;\n}\n\nexport const JSONSnippet: React.FunctionComponent<Props> = ({ snippet }) => {\n if (typeof snippet === 'object') {\n // change code to markdown's json code block\n snippet = '```json\\n' + JSON.stringify(snippet, undefined, 2) + '\\n```';\n }\n\n return <Markdown>{snippet}</Markdown>;\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { sanitize } from 'isomorphic-dompurify';
|
|
3
|
-
import
|
|
3
|
+
import { renderMarkdown } from '../helpers';
|
|
4
4
|
export var Markdown = function (_a) {
|
|
5
5
|
var children = _a.children;
|
|
6
6
|
if (!children) {
|
|
@@ -9,7 +9,6 @@ export var Markdown = function (_a) {
|
|
|
9
9
|
if (typeof children !== 'string') {
|
|
10
10
|
return React.createElement(React.Fragment, null, children);
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
return (React.createElement("div", { className: "prose max-w-max text-sm", dangerouslySetInnerHTML: { __html: sanitize(html) } }));
|
|
12
|
+
return (React.createElement("div", { className: "prose max-w-none text-sm", dangerouslySetInnerHTML: { __html: sanitize(renderMarkdown(children)) } }));
|
|
14
13
|
};
|
|
15
14
|
//# sourceMappingURL=Markdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Markdown.js","sourceRoot":"","sources":["../../../src/components/Markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"Markdown.js","sourceRoot":"","sources":["../../../src/components/Markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,IAAM,QAAQ,GAA4B,UAAC,EAAY;QAAV,QAAQ,cAAA;IAC1D,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,IAAI,CAAC;KACb;IACD,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;QAChC,OAAO,0CAAG,QAAQ,CAAI,CAAC;KACxB;IAED,OAAO,CACL,6BACE,SAAS,EAAC,0BAA0B,EACpC,uBAAuB,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,EAAE,GACvE,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { sanitize } from 'isomorphic-dompurify';\n\nimport { renderMarkdown } from '../helpers';\n\nexport const Markdown: React.FunctionComponent = ({ children }) => {\n if (!children) {\n return null;\n }\n if (typeof children !== 'string') {\n return <>{children}</>;\n }\n\n return (\n <div\n className=\"prose max-w-none text-sm\"\n dangerouslySetInnerHTML={{ __html: sanitize(renderMarkdown(children)) }}\n />\n );\n};\n"]}
|
|
@@ -3,28 +3,55 @@ import { Href, CollapseButton, Markdown, Extensions } from './index';
|
|
|
3
3
|
import { SchemaHelpers } from '../helpers';
|
|
4
4
|
var SchemaContext = React.createContext({ reverse: false });
|
|
5
5
|
export var Schema = function (_a) {
|
|
6
|
-
var schemaName = _a.schemaName, schema = _a.schema, _b = _a.required, required = _b === void 0 ? false : _b, _c = _a.
|
|
6
|
+
var schemaName = _a.schemaName, schema = _a.schema, _b = _a.required, required = _b === void 0 ? false : _b, _c = _a.isPatternProperty, isPatternProperty = _c === void 0 ? false : _c, _d = _a.isProperty, isProperty = _d === void 0 ? false : _d, _e = _a.isCircular, isCircular = _e === void 0 ? false : _e, dependentRequired = _a.dependentRequired, _f = _a.expanded, expanded = _f === void 0 ? false : _f, _g = _a.onlyTitle, onlyTitle = _g === void 0 ? false : _g;
|
|
7
7
|
var reverse = useContext(SchemaContext).reverse;
|
|
8
|
-
var
|
|
9
|
-
if (!schema ||
|
|
8
|
+
var _h = useState(expanded), expand = _h[0], setExpand = _h[1];
|
|
9
|
+
if (!schema ||
|
|
10
|
+
(typeof schemaName === 'string' &&
|
|
11
|
+
((schemaName === null || schemaName === void 0 ? void 0 : schemaName.startsWith('x-parser-')) ||
|
|
12
|
+
(schemaName === null || schemaName === void 0 ? void 0 : schemaName.startsWith('x-schema-private-'))))) {
|
|
10
13
|
return null;
|
|
11
14
|
}
|
|
12
|
-
var uid = schema.uid();
|
|
13
15
|
var dependentSchemas = SchemaHelpers.getDependentSchemas(schema);
|
|
14
16
|
var constraints = SchemaHelpers.humanizeConstraints(schema);
|
|
15
|
-
var isExpandable = SchemaHelpers.isExpandable(schema) || dependentSchemas;
|
|
16
17
|
var externalDocs = schema.externalDocs();
|
|
17
18
|
var renderType = schema.ext(SchemaHelpers.extRenderType) !== false;
|
|
18
19
|
var rawValue = schema.ext(SchemaHelpers.extRawValue) === true;
|
|
19
20
|
var parameterLocation = schema.ext(SchemaHelpers.extParameterLocation);
|
|
21
|
+
var isExpandable = SchemaHelpers.isExpandable(schema) || dependentSchemas;
|
|
22
|
+
var schemaType = SchemaHelpers.toSchemaType(schema);
|
|
23
|
+
isCircular =
|
|
24
|
+
isCircular ||
|
|
25
|
+
schema.isCircular() ||
|
|
26
|
+
schema.ext('x-parser-circular') ||
|
|
27
|
+
false;
|
|
28
|
+
var uid = schema.uid();
|
|
29
|
+
var schemaItems = schema.items();
|
|
30
|
+
if (schemaItems && !Array.isArray(schemaItems)) {
|
|
31
|
+
isCircular =
|
|
32
|
+
isCircular ||
|
|
33
|
+
schemaItems.isCircular() ||
|
|
34
|
+
schemaItems.ext('x-parser-circular') ||
|
|
35
|
+
false;
|
|
36
|
+
uid = schemaItems.uid();
|
|
37
|
+
if (isCircular &&
|
|
38
|
+
typeof schemaItems.circularSchema === 'function') {
|
|
39
|
+
schemaType = SchemaHelpers.toSchemaType(schemaItems.circularSchema());
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else if (isCircular &&
|
|
43
|
+
typeof schema.circularSchema === 'function') {
|
|
44
|
+
schemaType = SchemaHelpers.toSchemaType(schema.circularSchema());
|
|
45
|
+
}
|
|
46
|
+
var styledSchemaName = isProperty ? 'italic' : '';
|
|
47
|
+
var renderedSchemaName = typeof schemaName === 'string' ? (React.createElement("span", { className: "break-words text-sm ".concat(styledSchemaName) }, schemaName)) : (schemaName);
|
|
20
48
|
return (React.createElement(SchemaContext.Provider, { value: { reverse: !reverse } },
|
|
21
49
|
React.createElement("div", null,
|
|
22
50
|
React.createElement("div", { className: "flex py-2" },
|
|
23
|
-
React.createElement("div", { className: "
|
|
51
|
+
React.createElement("div", { className: "".concat(onlyTitle ? '' : 'min-w-1/4', " mr-2") },
|
|
24
52
|
isExpandable && !isCircular ? (React.createElement(CollapseButton, { onClick: function () { return setExpand(function (prev) { return !prev; }); }, chevronProps: {
|
|
25
53
|
className: expand ? '-rotate-180' : '-rotate-90',
|
|
26
|
-
} },
|
|
27
|
-
React.createElement("span", { className: "break-words text-sm " + (isProperty ? 'italic' : '') }, schemaName))) : (React.createElement("span", { className: "break-words text-sm " + (isProperty ? 'italic' : '') }, schemaName)),
|
|
54
|
+
} }, renderedSchemaName)) : (React.createElement("span", { className: "break-words text-sm ".concat(isProperty ? 'italic' : '') }, schemaName)),
|
|
28
55
|
isPatternProperty && (React.createElement("div", { className: "text-gray-500 text-xs italic" }, "(pattern property)")),
|
|
29
56
|
required && React.createElement("div", { className: "text-red-600 text-xs" }, "required"),
|
|
30
57
|
dependentRequired && (React.createElement(React.Fragment, null,
|
|
@@ -36,9 +63,7 @@ export var Schema = function (_a) {
|
|
|
36
63
|
rawValue ? (React.createElement("div", null,
|
|
37
64
|
React.createElement("div", { className: "text-sm" }, schema.const()))) : (React.createElement("div", null,
|
|
38
65
|
React.createElement("div", null,
|
|
39
|
-
renderType && (React.createElement("div", { className: "capitalize text-sm text-teal-500 font-bold inline-block mr-2" }, isCircular
|
|
40
|
-
? '[CIRCULAR]'
|
|
41
|
-
: SchemaHelpers.toSchemaType(schema))),
|
|
66
|
+
renderType && (React.createElement("div", { className: "capitalize text-sm text-teal-500 font-bold inline-block mr-2" }, isCircular ? "".concat(schemaType, " [CIRCULAR]") : schemaType)),
|
|
42
67
|
React.createElement("div", { className: "inline-block" },
|
|
43
68
|
schema.format() && (React.createElement("span", { className: "bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs" },
|
|
44
69
|
"format: ",
|
|
@@ -79,9 +104,9 @@ export var Schema = function (_a) {
|
|
|
79
104
|
schema.examples() && (React.createElement("ul", { className: "text-xs" },
|
|
80
105
|
"Examples values:",
|
|
81
106
|
' ',
|
|
82
|
-
schema.examples().map(function (e, idx) { return (React.createElement("li", { key: idx, className: "border inline-block text-orange-600 rounded ml-1 py-0 px-2" },
|
|
107
|
+
schema.examples().map(function (e, idx) { return (React.createElement("li", { key: idx, className: "border inline-block text-orange-600 rounded ml-1 py-0 px-2 break-all" },
|
|
83
108
|
React.createElement("span", null, SchemaHelpers.prettifyValue(e)))); }))))))),
|
|
84
|
-
isCircular || !isExpandable ? null : (React.createElement("div", { className: "rounded p-4 py-2
|
|
109
|
+
isCircular || !isExpandable ? null : (React.createElement("div", { className: "rounded p-4 py-2 border bg-gray-100 ".concat(reverse ? 'bg-gray-200' : '', " ").concat(expand ? 'block' : 'hidden') },
|
|
85
110
|
React.createElement(SchemaProperties, { schema: schema }),
|
|
86
111
|
React.createElement(SchemaItems, { schema: schema }),
|
|
87
112
|
schema.oneOf() &&
|
|
@@ -115,15 +140,15 @@ var SchemaProperties = function (_a) {
|
|
|
115
140
|
}
|
|
116
141
|
var required = schema.required() || [];
|
|
117
142
|
var patternProperties = schema.patternProperties();
|
|
118
|
-
var circularProps = schema.
|
|
143
|
+
var circularProps = schema.ext('x-parser-circular-props') || [];
|
|
119
144
|
return (React.createElement(React.Fragment, null,
|
|
120
145
|
Object.entries(properties).map(function (_a) {
|
|
121
146
|
var propertyName = _a[0], property = _a[1];
|
|
122
|
-
return (React.createElement(Schema, { schema: property, schemaName: propertyName, required: required.includes(propertyName), isCircular: circularProps.includes(propertyName),
|
|
147
|
+
return (React.createElement(Schema, { schema: property, schemaName: propertyName, required: required.includes(propertyName), isProperty: true, isCircular: circularProps.includes(propertyName), dependentRequired: SchemaHelpers.getDependentRequired(propertyName, schema), key: propertyName }));
|
|
123
148
|
}),
|
|
124
149
|
Object.entries(patternProperties).map(function (_a) {
|
|
125
150
|
var propertyName = _a[0], property = _a[1];
|
|
126
|
-
return (React.createElement(Schema, { schema: property, schemaName: propertyName,
|
|
151
|
+
return (React.createElement(Schema, { schema: property, schemaName: propertyName, isPatternProperty: true, isProperty: true, isCircular: circularProps.includes(propertyName), key: propertyName }));
|
|
127
152
|
})));
|
|
128
153
|
};
|
|
129
154
|
var AdditionalProperties = function (_a) {
|
|
@@ -156,11 +181,13 @@ var SchemaItems = function (_a) {
|
|
|
156
181
|
return null;
|
|
157
182
|
}
|
|
158
183
|
var items = schema.items();
|
|
159
|
-
if (items &&
|
|
184
|
+
if (items &&
|
|
185
|
+
!Array.isArray(items) &&
|
|
186
|
+
Object.keys(items.properties() || {}).length) {
|
|
160
187
|
return React.createElement(SchemaProperties, { schema: items });
|
|
161
188
|
}
|
|
162
189
|
else if (Array.isArray(items)) {
|
|
163
|
-
return (React.createElement(React.Fragment, null, items.map(function (item, idx) { return (React.createElement(Schema, { schema: item, schemaName: idx + 1
|
|
190
|
+
return (React.createElement(React.Fragment, null, items.map(function (item, idx) { return (React.createElement(Schema, { schema: item, schemaName: "".concat(idx + 1, " item:"), key: idx })); })));
|
|
164
191
|
}
|
|
165
192
|
return React.createElement(Schema, { schema: items, schemaName: "Items:" });
|
|
166
193
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.js","sourceRoot":"","sources":["../../../src/components/Schema.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAa3C,IAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;AAE9D,MAAM,CAAC,IAAM,MAAM,GAAmC,UAAC,EAStD;QARC,UAAU,gBAAA,EACV,MAAM,YAAA,EACN,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,kBAAkB,EAAlB,UAAU,mBAAG,KAAK,KAAA,EAClB,yBAAyB,EAAzB,iBAAiB,mBAAG,KAAK,KAAA,EACzB,kBAAkB,EAAlB,UAAU,mBAAG,KAAK,KAAA,EAClB,iBAAiB,uBAAA,EACjB,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA;IAER,IAAA,OAAO,G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,GAAG,CAAC,aAAa,CAAC,uBAAuB,CAAC,KAAK,KAAK,EAAE;QAC/D,OAAO,IAAI,CAAC;KACb;IAED,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;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,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, 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({ reverse: false });\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 = false,\n onlyTitle = false,\n}) => {\n const { reverse } = useContext(SchemaContext);\n const [expand, setExpand] = useState(expanded);\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 let 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 uid = schemaItems.uid();\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 value={{ reverse: !reverse }}>\n <div>\n <div className=\"flex py-2\">\n <div className={`${onlyTitle ? '' : 'min-w-1/4'} mr-2`}>\n {isExpandable && !isCircular ? (\n <CollapseButton\n onClick={() => setExpand(prev => !prev)}\n chevronProps={{\n className: expand ? '-rotate-180' : '-rotate-90',\n }}\n >\n {renderedSchemaName}\n </CollapseButton>\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 lowercase 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 } ${expand ? '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"]}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Href } from './Href';
|
|
3
3
|
export var Tag = function (_a) {
|
|
4
4
|
var tag = _a.tag;
|
|
5
|
-
var name = "#"
|
|
5
|
+
var name = "#".concat(tag.name());
|
|
6
6
|
var description = tag.description() || '';
|
|
7
7
|
var externalDocs = tag.externalDocs();
|
|
8
8
|
var element = (React.createElement("div", { title: description, className: "border border-solid border-blue-300 hover:bg-blue-300 hover:text-blue-600 text-blue-500 font-bold no-underline text-xs rounded px-3 py-1" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../../src/components/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAM9B,MAAM,CAAC,IAAM,GAAG,GAAmC,UAAC,EAAO;QAAL,GAAG,SAAA;IACvD,IAAM,IAAI,GAAG,
|
|
1
|
+
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../../src/components/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAM9B,MAAM,CAAC,IAAM,GAAG,GAAmC,UAAC,EAAO;QAAL,GAAG,SAAA;IACvD,IAAM,IAAI,GAAG,WAAI,GAAG,CAAC,IAAI,EAAE,CAAE,CAAC;IAC9B,IAAM,WAAW,GAAG,GAAG,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC;IAC5C,IAAM,YAAY,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC;IAExC,IAAM,OAAO,GAAG,CACd,6BACE,KAAK,EAAE,WAAW,EAClB,SAAS,EAAC,0IAA0I;QAEpJ,8BAAM,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,IAAG,IAAI,CAAQ,CAC3D,CACP,CAAC;IAEF,IAAI,YAAY,EAAE;QAChB,OAAO,CACL,oBAAC,IAAI,IAAC,IAAI,EAAE,YAAY,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,WAAW,IAC/C,OAAO,CACH,CACR,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Tag as TagType } from '@asyncapi/parser';\n\nimport { Href } from './Href';\n\ninterface Props {\n tag: TagType;\n}\n\nexport const Tag: React.FunctionComponent<Props> = ({ tag }) => {\n const name = `#${tag.name()}`;\n const description = tag.description() || '';\n const externalDocs = tag.externalDocs();\n\n const element = (\n <div\n title={description}\n className=\"border border-solid border-blue-300 hover:bg-blue-300 hover:text-blue-600 text-blue-500 font-bold no-underline text-xs rounded px-3 py-1\"\n >\n <span className={externalDocs ? 'underline' : ''}>{name}</span>\n </div>\n );\n\n if (externalDocs) {\n return (\n <Href href={externalDocs.url()} title={description}>\n {element}\n </Href>\n );\n }\n return element;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tags.js","sourceRoot":"","sources":["../../../src/components/Tags.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAM5B,MAAM,CAAC,IAAM,IAAI,GAAmC,UAAC,EAAQ;QAAN,IAAI,UAAA;IACzD,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;QACzB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,4BAAI,SAAS,EAAC,+BAA+B,IAC1C,IAAI,CAAC,GAAG,CAAC,UAAA,GAAG,IAAI,OAAA,CACf,4BAAI,SAAS,EAAC,wBAAwB,EAAC,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE;QACpD,oBAAC,GAAG,IAAC,GAAG,EAAE,GAAG,GAAI,CACd,CACN,EAJgB,CAIhB,CAAC,CACC,CACN,CAAC;AACJ,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"Tags.js","sourceRoot":"","sources":["../../../src/components/Tags.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAM5B,MAAM,CAAC,IAAM,IAAI,GAAmC,UAAC,EAAQ;QAAN,IAAI,UAAA;IACzD,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;QACzB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,4BAAI,SAAS,EAAC,+BAA+B,IAC1C,IAAI,CAAC,GAAG,CAAC,UAAA,GAAG,IAAI,OAAA,CACf,4BAAI,SAAS,EAAC,wBAAwB,EAAC,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE;QACpD,oBAAC,GAAG,IAAC,GAAG,EAAE,GAAG,GAAI,CACd,CACN,EAJgB,CAIhB,CAAC,CACC,CACN,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Tag as TagType } from '@asyncapi/parser';\n\nimport { Tag } from './Tag';\n\ninterface Props {\n tags?: TagType[];\n}\n\nexport const Tags: React.FunctionComponent<Props> = ({ tags }) => {\n if (!tags || !tags.length) {\n return null;\n }\n\n return (\n <ul className=\"flex flex-wrap leading-normal\">\n {tags.map(tag => (\n <li className=\"inline-block mt-2 mr-2\" key={tag.name()}>\n <Tag tag={tag} />\n </li>\n ))}\n </ul>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC","sourcesContent":["export * from './Bindings';\nexport * from './CollapseButton';\nexport * from './JSONSnippet';\nexport * from './Extensions';\nexport * from './Href';\nexport * from './Markdown';\nexport * from './Schema';\nexport * from './Tag';\nexport * from './Tags';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":""}
|
|
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 sidebar?: SideBarConfig;\n parserOptions?: any;\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 SideBarConfig {\n showOperations?: 'byDefault' | 'bySpecTags' | 'byOperationsTags';\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/config/default.ts"],"names":[],"mappings":"AAEA,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,MAAM,EAAE,IAAI;KACb;IACD,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;KACnC;CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/config/default.ts"],"names":[],"mappings":"AAEA,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,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;KACnC;CACF,CAAC","sourcesContent":["import { ConfigInterface } from './config';\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 sidebar: {\n showOperations: 'byOperationsTags',\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC","sourcesContent":["export * from './config';\nexport * from './default';\n"]}
|
package/lib/esm/constants.js
CHANGED
|
@@ -31,6 +31,7 @@ export var GENERATED_TEXT = 'Generated';
|
|
|
31
31
|
export var SERVERS_TEXT = 'Servers';
|
|
32
32
|
export var OPERATIONS_TEXT = 'Operations';
|
|
33
33
|
export var MESSAGES_TEXT = 'Messages';
|
|
34
|
+
export var SCHEMAS_TEXT = 'Schemas';
|
|
34
35
|
export var CHANNELS_TEXT = 'Channels';
|
|
35
36
|
export var PARAMETERS_TEXT = 'Parameters';
|
|
36
37
|
export var HEADERS_TEXT = 'Headers';
|
|
@@ -48,51 +49,4 @@ export var EXPAND_ERROR_BUTTON_TEXT = 'Expand';
|
|
|
48
49
|
export var COLLAPSE_ERROR_BUTTON_TEXT = 'Collapse';
|
|
49
50
|
export var SECURITY_TEXT = 'Security';
|
|
50
51
|
export var URL_VARIABLES_TEXT = 'URL Variables';
|
|
51
|
-
export var FLOWS_TEXTS = {
|
|
52
|
-
FLOW: 'Flow',
|
|
53
|
-
AUTHORIZATION_URL: 'Authorization URL',
|
|
54
|
-
TOKEN_URL: 'Token URL',
|
|
55
|
-
REFRESH_URL: 'Refresh URL',
|
|
56
|
-
SCOPES: 'Scopes',
|
|
57
|
-
};
|
|
58
|
-
export var SECURITY_COLUMNS_NAMES = [
|
|
59
|
-
'Type',
|
|
60
|
-
'Stage',
|
|
61
|
-
'In',
|
|
62
|
-
'Name',
|
|
63
|
-
'Scheme',
|
|
64
|
-
'Format',
|
|
65
|
-
'Description',
|
|
66
|
-
];
|
|
67
|
-
export var SERVER_COLUMN_NAMES = [
|
|
68
|
-
'URL',
|
|
69
|
-
'Default',
|
|
70
|
-
'Possible values',
|
|
71
|
-
'Description',
|
|
72
|
-
];
|
|
73
|
-
export var SERVER_SECURITY_COLUMN_NAMES = [
|
|
74
|
-
'Type',
|
|
75
|
-
'Bearer format',
|
|
76
|
-
'In',
|
|
77
|
-
'Scheme',
|
|
78
|
-
'Header',
|
|
79
|
-
'Description',
|
|
80
|
-
];
|
|
81
|
-
export var CONTAINER_LABELS;
|
|
82
|
-
(function (CONTAINER_LABELS) {
|
|
83
|
-
CONTAINER_LABELS["INFO"] = "info";
|
|
84
|
-
CONTAINER_LABELS["CHANNELS"] = "channels";
|
|
85
|
-
CONTAINER_LABELS["SERVERS"] = "servers";
|
|
86
|
-
CONTAINER_LABELS["MESSAGES"] = "messages";
|
|
87
|
-
CONTAINER_LABELS["SCHEMAS"] = "schemas";
|
|
88
|
-
})(CONTAINER_LABELS || (CONTAINER_LABELS = {}));
|
|
89
|
-
export var CONTAINER_LABELS_VALUES = Object.values(CONTAINER_LABELS);
|
|
90
|
-
export var ITEM_LABELS;
|
|
91
|
-
(function (ITEM_LABELS) {
|
|
92
|
-
ITEM_LABELS["CHANNEL"] = "channel";
|
|
93
|
-
ITEM_LABELS["SERVER"] = "server";
|
|
94
|
-
ITEM_LABELS["MESSAGE"] = "message";
|
|
95
|
-
ITEM_LABELS["SCHEMA"] = "schema";
|
|
96
|
-
})(ITEM_LABELS || (ITEM_LABELS = {}));
|
|
97
|
-
export var ITEM_LABELS_VALUES = Object.values(ITEM_LABELS);
|
|
98
52
|
//# sourceMappingURL=constants.js.map
|
package/lib/esm/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,UAAU,GAAG,UAAU,CAAC;AACrC,MAAM,CAAC,IAAM,kBAAkB,GAC7B,8CAA8C,CAAC;AACjD,MAAM,CAAC,IAAM,iBAAiB,GAAG,cAAc,CAAC;AAChD,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E =\n 'https://www.iana.org/assignments/media-types';\nexport const COLLAPSE_ALL_TEXT = 'Collapse All';\nexport const EXPAND_ALL_TEXT = 'Expand All';\n\nexport const VALIDATION_ERRORS_TYPE =\n 'https://github.com/asyncapi/parser-js/validation-errors';\nexport const SERVERS = 'Servers';\n\nexport const ONE_OF_PAYLOADS_TEXT = 'One of those payloads:';\nexport const ANY_OF_PAYLOADS_TEXT = 'Any of those payloads:';\nexport const GENERATED_BADGE_TEXT = 'generated';\nexport const ONE_OF_FOLLOWING_MESSAGES_PUBLISH_TEXT =\n 'You can send one of the following messages:';\nexport const ONE_OF_FOLLOWING_MESSAGES_PUBLISH_SINGLE_TEXT =\n 'You can send the following message:';\nexport const ONE_OF_FOLLOWING_MESSAGES_SUBSCRIBE_TEXT =\n 'You can subscribe to one of the following messages:';\nexport const ONE_OF_FOLLOWING_MESSAGES_SUBSCRIBE_SINGLE_TEXT =\n 'You can subscribe to the following message:';\n\nexport const CONTACT_TEXT = 'Contact';\nexport const NAM_TEXTE = 'Name';\nexport const URL_TEXT = 'Url';\nexport const EMAIL_TEXT = 'Email';\nexport const LICENSE_TEXT = 'License';\nexport const TERMS_OF_SERVICE_TEXT = 'Terms of service';\nexport const URL_SUPPORT_TEXT = 'Support';\nexport const EMAIL_SUPPORT_TEXT = 'Email support';\nexport const EXTERAL_DOCUMENTATION_TEXT = 'External Docs';\nexport const LOCATION_TEXT = 'Location';\nexport const TYPE_TEXT = 'Type';\nexport const SPECIFICATION_TEXT = 'Specification';\n\nexport const DEPRECATED_TEXT = 'Deprecated';\nexport const PUBLISH_TEXT = 'Publish';\nexport const SUBSCRIBE_TEXT = 'Subscribe';\nexport const REQUIRED_TEXT = 'Required';\nexport const GENERATED_TEXT = 'Generated';\n\nexport const SERVERS_TEXT = 'Servers';\nexport const OPERATIONS_TEXT = 'Operations';\nexport const MESSAGES_TEXT = 'Messages';\nexport const SCHEMAS_TEXT = 'Schemas';\n\nexport const CHANNELS_TEXT = 'Channels';\nexport const PARAMETERS_TEXT = 'Parameters';\nexport const HEADERS_TEXT = 'Headers';\nexport const MESSAGE_HEADERS_TEXT = 'Message Headers';\nexport const HEADERS_EXAMPLE_TEXT = 'Example of headers';\nexport const TAGS_TEXT = 'Tags';\nexport const PAYLOAD_TEXT = 'Payload';\nexport const MESSAGE_PAYLOAD_TEXT = 'Message Payload';\nexport const PAYLOAD_EXAMPLE_TEXT = 'Example of payload';\nexport const SCHEMA_EXAMPLE_TEXT = 'Example';\n\nexport const NONE_TEXT = 'None';\nexport const ANY_TEXT = 'Any';\nexport const ERROR_TEXT = 'Error';\nexport const EXPAND_ERROR_BUTTON_TEXT = 'Expand';\nexport const COLLAPSE_ERROR_BUTTON_TEXT = 'Collapse';\n\nexport const SECURITY_TEXT = 'Security';\n\nexport const URL_VARIABLES_TEXT = 'URL Variables';\n"]}
|