rapidoc 9.1.8 → 9.3.2
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/.github/FUNDING.yml +13 -0
- package/CONTRIBUTING.md +1 -1
- package/LICENSE.txt +3 -1
- package/README.md +24 -6
- package/dist/index.html +1 -1
- package/dist/index.html.gz +0 -0
- package/dist/rapidoc-min.js +3776 -2
- package/dist/rapidoc-min.js.LICENSE.txt +12 -33
- package/dist/rapidoc-min.js.LICENSE.txt.gz +0 -0
- package/dist/rapidoc-min.js.gz +0 -0
- package/dist/rapidoc-min.js.map +1 -0
- package/dist/rapidoc-min.js.map.gz +0 -0
- package/dist/rapidoc.js +4561 -3303
- package/dist/report.html +2 -2
- package/index.html +6 -4
- package/package.json +15 -15
- package/src/components/api-request.js +104 -78
- package/src/components/api-response.js +11 -8
- package/src/components/dialog-box.js +1 -1
- package/src/components/json-tree.js +15 -4
- package/src/components/schema-table.js +40 -18
- package/src/components/schema-tree.js +44 -15
- package/src/components/tag-input.js +1 -1
- package/src/json-schema-viewer.js +2 -2
- package/src/rapidoc-mini.js +27 -2
- package/src/rapidoc.js +41 -3
- package/src/styles/border-styles.js +1 -1
- package/src/styles/custom-styles.js +1 -1
- package/src/styles/dialog-box-styles.js +1 -1
- package/src/styles/endpoint-styles.js +10 -10
- package/src/styles/flex-styles.js +1 -1
- package/src/styles/font-styles.js +1 -1
- package/src/styles/info-styles.js +1 -1
- package/src/styles/input-styles.js +1 -1
- package/src/styles/nav-styles.js +4 -2
- package/src/styles/prism-styles.js +1 -1
- package/src/styles/schema-styles.js +4 -2
- package/src/styles/tab-styles.js +2 -1
- package/src/styles/table-styles.js +1 -1
- package/src/templates/advance-search-template.js +1 -1
- package/src/templates/callback-template.js +11 -4
- package/src/templates/code-samples-template.js +2 -2
- package/src/templates/components-template.js +4 -2
- package/src/templates/endpoint-template.js +23 -16
- package/src/templates/expanded-endpoint-template.js +77 -71
- package/src/templates/focused-endpoint-template.js +2 -2
- package/src/templates/header-template.js +2 -2
- package/src/templates/json-schema-viewer-template.js +3 -3
- package/src/templates/logo-template.js +1 -1
- package/src/templates/main-body-template.js +2 -2
- package/src/templates/navbar-template.js +22 -9
- package/src/templates/overview-template.js +3 -3
- package/src/templates/security-scheme-template.js +54 -44
- package/src/templates/server-template.js +4 -4
- package/src/utils/schema-utils.js +74 -27
- package/src/utils/spec-parser.js +1 -1
- package/src/utils/theme.js +12 -5
- package/webpack.config.js +1 -1
- package/.vscode/settings.json +0 -12
package/src/styles/tab-styles.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html } from 'lit
|
|
1
|
+
import { html } from 'lit';
|
|
2
2
|
|
|
3
3
|
/* eslint-disable indent */
|
|
4
4
|
export default function callbackTemplate(callbacks) {
|
|
@@ -29,6 +29,7 @@ export default function callbackTemplate(callbacks) {
|
|
|
29
29
|
.parameters = "${method[1]?.parameters || ''}"
|
|
30
30
|
.request_body = "${method[1]?.requestBody || ''}"
|
|
31
31
|
fill-request-fields-with-example = "${this.fillRequestFieldsWithExample}"
|
|
32
|
+
use-summary-to-list-example = "${this.useSummaryToListExamples}"
|
|
32
33
|
allow-try = "false"
|
|
33
34
|
render-style="${this.renderStyle}"
|
|
34
35
|
schema-style = "${this.schemaStyle}"
|
|
@@ -36,9 +37,12 @@ export default function callbackTemplate(callbacks) {
|
|
|
36
37
|
schema-expand-level = "${this.schemaExpandLevel}"
|
|
37
38
|
schema-description-expanded = "${this.schemaDescriptionExpanded}"
|
|
38
39
|
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}",
|
|
39
|
-
schema-hide-read-only = "
|
|
40
|
+
schema-hide-read-only = "false"
|
|
41
|
+
schema-hide-write-only = "${this.schemaHideWriteOnly}"
|
|
40
42
|
fetch-credentials = "${this.fetchCredentials}"
|
|
41
|
-
exportparts="btn btn-fill btn-outline btn-try
|
|
43
|
+
exportparts = "btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, btn-clear:btn-clear, btn-clear-resp:btn-clear-resp,
|
|
44
|
+
file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param,
|
|
45
|
+
anchor:anchor, anchor-param-example:anchor-param-example, schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
|
|
42
46
|
> </api-request>
|
|
43
47
|
|
|
44
48
|
<api-response
|
|
@@ -52,7 +56,10 @@ export default function callbackTemplate(callbacks) {
|
|
|
52
56
|
schema-expand-level = "${this.schemaExpandLevel}"
|
|
53
57
|
schema-description-expanded = "${this.schemaDescriptionExpanded}"
|
|
54
58
|
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
|
|
55
|
-
|
|
59
|
+
schema-hide-read-only = "${this.schemaHideReadOnly}"
|
|
60
|
+
schema-hide-write-only = "false"
|
|
61
|
+
exportparts = "btn:btn, btn-response-status:btn-response-status, btn-selected-response-status:btn-selected-response-status, btn-fill:btn-fill, btn-copy:btn-copy,
|
|
62
|
+
schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
|
|
56
63
|
> </api-response>
|
|
57
64
|
</div>
|
|
58
65
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { html } from 'lit
|
|
2
|
-
import { unsafeHTML } from 'lit
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions
|
|
3
3
|
import Prism from 'prismjs';
|
|
4
4
|
import { copyToClipboard } from '~/utils/common-utils';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { html } from 'lit
|
|
2
|
-
import { unsafeHTML } from 'lit
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions
|
|
3
3
|
import { marked } from 'marked';
|
|
4
4
|
import { schemaInObjectNotation } from '~/utils/schema-utils';
|
|
5
5
|
import '~/components/json-tree';
|
|
@@ -21,6 +21,7 @@ function schemaBodyTemplate(sComponent) {
|
|
|
21
21
|
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}",
|
|
22
22
|
schema-hide-read-only = "false"
|
|
23
23
|
schema-hide-write-only = "${this.schemaHideWriteOnly}"
|
|
24
|
+
exportparts = "schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
|
|
24
25
|
> </schema-tree> `
|
|
25
26
|
: html`
|
|
26
27
|
<schema-tree
|
|
@@ -31,6 +32,7 @@ function schemaBodyTemplate(sComponent) {
|
|
|
31
32
|
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}",
|
|
32
33
|
schema-hide-read-only = "false"
|
|
33
34
|
schema-hide-write-only = "${this.schemaHideWriteOnly}"
|
|
35
|
+
exportparts = "schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
|
|
34
36
|
> </schema-tree>`
|
|
35
37
|
}
|
|
36
38
|
</div>`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { html } from 'lit
|
|
2
|
-
import { unsafeHTML } from 'lit
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions
|
|
3
3
|
import { marked } from 'marked';
|
|
4
4
|
import '~/components/api-request';
|
|
5
5
|
import '~/components/api-response';
|
|
@@ -46,9 +46,9 @@ function onExpandCollapseAll(e, action = 'expand-all') {
|
|
|
46
46
|
/* eslint-disable indent */
|
|
47
47
|
function endpointHeadTemplate(path, pathsExpanded = false) {
|
|
48
48
|
return html`
|
|
49
|
-
<summary @click="${(e) => { toggleExpand.call(this, path, e); }}" class='endpoint-head ${path.method} ${path.deprecated ? 'deprecated' : ''} ${pathsExpanded || path.expanded ? 'expanded' : 'collapsed'}'>
|
|
50
|
-
<div class="method ${path.method} ${path.deprecated ? 'deprecated' : ''}"> ${path.method} </div>
|
|
51
|
-
<div class="path ${path.deprecated ? 'deprecated' : ''}">
|
|
49
|
+
<summary @click="${(e) => { toggleExpand.call(this, path, e); }}" part="section-endpoint-head-${path.expanded ? 'expanded' : 'collapsed'}" class='endpoint-head ${path.method} ${path.deprecated ? 'deprecated' : ''} ${pathsExpanded || path.expanded ? 'expanded' : 'collapsed'}'>
|
|
50
|
+
<div part="section-endpoint-head-method" class="method ${path.method} ${path.deprecated ? 'deprecated' : ''}"> ${path.method} </div>
|
|
51
|
+
<div part="section-endpoint-head-path" class="path ${path.deprecated ? 'deprecated' : ''}">
|
|
52
52
|
${path.path}
|
|
53
53
|
${path.isWebhook ? html`<span style="font-family: var(--font-regular); font-size: var(--); font-size: var(--font-size-small); color:var(--primary-color); margin-left: 16px"> Webhook</span>` : ''}
|
|
54
54
|
</div>
|
|
@@ -62,7 +62,7 @@ function endpointHeadTemplate(path, pathsExpanded = false) {
|
|
|
62
62
|
${this.showSummaryWhenCollapsed
|
|
63
63
|
? html`
|
|
64
64
|
<div class="only-large-screen" style="min-width:60px; flex:1"></div>
|
|
65
|
-
<div class="descr">${path.summary || path.shortSummary} </div>`
|
|
65
|
+
<div part="section-endpoint-head-description" class="descr">${path.summary || path.shortSummary} </div>`
|
|
66
66
|
: ''
|
|
67
67
|
}
|
|
68
68
|
</summary>
|
|
@@ -88,19 +88,19 @@ function endpointBodyTemplate(path) {
|
|
|
88
88
|
|
|
89
89
|
const codeSampleTabPanel = path.xCodeSamples ? codeSamplesTemplate(path.xCodeSamples) : '';
|
|
90
90
|
return html`
|
|
91
|
-
<div class='endpoint-body ${path.method} ${path.deprecated ? 'deprecated' : ''}'>
|
|
91
|
+
<div part="section-endpoint-body-${path.expanded ? 'expanded' : 'collapsed'}" class='endpoint-body ${path.method} ${path.deprecated ? 'deprecated' : ''}'>
|
|
92
92
|
<div class="summary">
|
|
93
93
|
${path.summary
|
|
94
|
-
? html`<div class="title">${path.summary}<div>`
|
|
94
|
+
? html`<div class="title" part="section-endpoint-body-title">${path.summary}<div>`
|
|
95
95
|
: path.shortSummary !== path.description
|
|
96
|
-
? html`<div class="title">${path.shortSummary}</div>`
|
|
96
|
+
? html`<div class="title" part="section-endpoint-body-title">${path.shortSummary}</div>`
|
|
97
97
|
: ''
|
|
98
98
|
}
|
|
99
99
|
${path.xBadges && path.xBadges?.length > 0
|
|
100
100
|
? html`
|
|
101
101
|
<div style="display:flex; flex-wrap:wrap;font-size: var(--font-size-small);">
|
|
102
102
|
${path.xBadges.map((v) => (
|
|
103
|
-
html`<span style="margin:1px; margin-right:5px; padding:1px 8px; font-weight:bold; border-radius:12px; background-color: var(--light-${v.color}, var(--input-bg)); color:var(--${v.color}); border:1px solid var(--${v.color})">${v.label}</span>`
|
|
103
|
+
html`<span part="endpoint-badge" style="margin:1px; margin-right:5px; padding:1px 8px; font-weight:bold; border-radius:12px; background-color: var(--light-${v.color}, var(--input-bg)); color:var(--${v.color}); border:1px solid var(--${v.color})">${v.label}</span>`
|
|
104
104
|
))
|
|
105
105
|
}
|
|
106
106
|
</div>
|
|
@@ -108,7 +108,7 @@ function endpointBodyTemplate(path) {
|
|
|
108
108
|
: ''
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
${path.description ? html`<div class="m-markdown"> ${unsafeHTML(marked(path.description))}</div>` : ''}
|
|
111
|
+
${path.description ? html`<div part="section-endpoint-body-description" class="m-markdown"> ${unsafeHTML(marked(path.description))}</div>` : ''}
|
|
112
112
|
<slot name="${path.elementId}"></slot>
|
|
113
113
|
${pathSecurityTemplate.call(this, path.security)}
|
|
114
114
|
${codeSampleTabPanel}
|
|
@@ -128,6 +128,7 @@ function endpointBodyTemplate(path) {
|
|
|
128
128
|
server-url = "${path.servers && path.servers.length > 0 ? path.servers[0].url : this.selectedServer.computedUrl}"
|
|
129
129
|
active-schema-tab = "${this.defaultSchemaTab}"
|
|
130
130
|
fill-request-fields-with-example = "${this.fillRequestFieldsWithExample}"
|
|
131
|
+
use-summary-to-list-example = "${this.useSummaryToListExamples}"
|
|
131
132
|
allow-try = "${this.allowTry}"
|
|
132
133
|
accept = "${accept}"
|
|
133
134
|
render-style="${this.renderStyle}"
|
|
@@ -135,9 +136,12 @@ function endpointBodyTemplate(path) {
|
|
|
135
136
|
schema-expand-level = "${this.schemaExpandLevel}"
|
|
136
137
|
schema-description-expanded = "${this.schemaDescriptionExpanded}"
|
|
137
138
|
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
|
|
138
|
-
schema-hide-read-only = "${this.schemaHideReadOnly}"
|
|
139
|
+
schema-hide-read-only = "${path.isWebhook ? this.schemaHideWriteOnly : this.schemaHideReadOnly}"
|
|
140
|
+
schema-hide-write-only = "${path.isWebhook ? this.schemaHideReadOnly : this.schemaHideWriteOnly}"
|
|
139
141
|
fetch-credentials = "${this.fetchCredentials}"
|
|
140
|
-
exportparts="btn btn-fill btn-outline btn-try
|
|
142
|
+
exportparts = "btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, btn-clear:btn-clear, btn-clear-resp:btn-clear-resp,
|
|
143
|
+
file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param,
|
|
144
|
+
anchor:anchor, anchor-param-example:anchor-param-example, schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
|
|
141
145
|
> </api-request>
|
|
142
146
|
|
|
143
147
|
${path.callbacks ? callbackTemplate.call(this, path.callbacks) : ''}
|
|
@@ -153,9 +157,12 @@ function endpointBodyTemplate(path) {
|
|
|
153
157
|
schema-expand-level = "${this.schemaExpandLevel}"
|
|
154
158
|
schema-description-expanded = "${this.schemaDescriptionExpanded}"
|
|
155
159
|
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
|
|
156
|
-
schema-hide-
|
|
160
|
+
schema-hide-read-only = "${path.isWebhook ? this.schemaHideWriteOnly : this.schemaHideReadOnly}"
|
|
161
|
+
schema-hide-write-only = "${path.isWebhook ? this.schemaHideReadOnly : this.schemaHideWriteOnly}"
|
|
157
162
|
selected-status = "${Object.keys(path.responses || {})[0] || ''}"
|
|
158
|
-
exportparts = "btn
|
|
163
|
+
exportparts = "btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, file-input:file-input,
|
|
164
|
+
textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param, anchor:anchor, anchor-param-example:anchor-param-example, btn-clear-resp:btn-clear-resp,
|
|
165
|
+
schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
|
|
159
166
|
> </api-response>
|
|
160
167
|
</div>
|
|
161
168
|
</div>`;
|
|
@@ -196,7 +203,7 @@ export default function endpointTemplate(showExpandCollapse = true, showTags = t
|
|
|
196
203
|
}
|
|
197
204
|
return true;
|
|
198
205
|
}).map((path) => html`
|
|
199
|
-
<section id='${path.elementId}' class='m-endpoint regular-font ${path.method} ${pathsExpanded || path.expanded ? 'expanded' : 'collapsed'}'>
|
|
206
|
+
<section part="section-endpoint" id='${path.elementId}' class='m-endpoint regular-font ${path.method} ${pathsExpanded || path.expanded ? 'expanded' : 'collapsed'}'>
|
|
200
207
|
${endpointHeadTemplate.call(this, path, pathsExpanded)}
|
|
201
208
|
${pathsExpanded || path.expanded ? endpointBodyTemplate.call(this, path) : ''}
|
|
202
209
|
</section>`)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { html } from 'lit
|
|
2
|
-
import { unsafeHTML } from 'lit
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions
|
|
3
3
|
import { marked } from 'marked';
|
|
4
4
|
import { rapidocApiKey } from '~/utils/common-utils';
|
|
5
5
|
import { pathSecurityTemplate } from '~/templates/security-scheme-template';
|
|
@@ -37,79 +37,85 @@ export function expandedEndpointBodyTemplate(path, tagName = '') {
|
|
|
37
37
|
return html`
|
|
38
38
|
${this.renderStyle === 'read' ? html`<div class='divider' part="operation-divider"></div>` : ''}
|
|
39
39
|
<div class='expanded-endpoint-body observe-me ${path.method} ${path.deprecated ? 'deprecated' : ''} ' part="section-operation ${path.elementId}" id='${path.elementId}'>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
${(this.renderStyle === 'focused' && tagName !== 'General ⦂') ? html`<h3 class="upper" style="font-weight:bold" part="section-operation-tag"> ${tagName} </h3>` : ''}
|
|
41
|
+
${path.deprecated ? html`<div class="bold-text red-text"> DEPRECATED </div>` : ''}
|
|
42
|
+
${html`
|
|
43
|
+
${path.xBadges && path.xBadges?.length > 0
|
|
44
|
+
? html`
|
|
45
|
+
<div style="display:flex; flex-wrap:wrap; margin-bottom: -24px; font-size: var(--font-size-small);">
|
|
46
|
+
${path.xBadges.map((v) => (
|
|
47
|
+
html`<span style="margin:1px; margin-right:5px; padding:1px 8px; font-weight:bold; border-radius:12px; background-color: var(--light-${v.color}, var(--input-bg)); color:var(--${v.color}); border:1px solid var(--${v.color})">${v.label}</span>`
|
|
48
|
+
))
|
|
49
|
+
}
|
|
50
|
+
</div>
|
|
51
|
+
`
|
|
52
|
+
: ''
|
|
53
|
+
}
|
|
54
|
+
<h2 part="section-operation-summary"> ${path.shortSummary || `${path.method.toUpperCase()} ${path.path}`}</h2>
|
|
55
|
+
${path.isWebhook
|
|
56
|
+
? html`<span part="section-operation-webhook style="color:var(--primary-color); font-weight:bold; font-size: var(--font-size-regular);"> WEBHOOK </span>`
|
|
57
|
+
: html`
|
|
58
|
+
<div class='mono-font part="section-operation-webhook-method" regular-font-size' style='text-align:left; direction:ltr; padding: 8px 0; color:var(--fg3)'>
|
|
59
|
+
<span part="label-operation-method" class='regular-font upper method-fg bold-text ${path.method}'>${path.method}</span>
|
|
60
|
+
<span part="label-operation-path">${path.path}</span>
|
|
61
|
+
</div>
|
|
51
62
|
`
|
|
52
|
-
|
|
63
|
+
}
|
|
64
|
+
<slot name="${path.elementId}"></slot>`
|
|
53
65
|
}
|
|
54
|
-
|
|
55
|
-
${path.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
active-schema-tab = "${this.defaultSchemaTab}"
|
|
87
|
-
schema-expand-level = "${this.schemaExpandLevel}"
|
|
88
|
-
schema-description-expanded = "${this.schemaDescriptionExpanded}"
|
|
89
|
-
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
|
|
90
|
-
schema-hide-read-only = "${this.schemaHideReadOnly}"
|
|
91
|
-
fetch-credentials = "${this.fetchCredentials}"
|
|
92
|
-
exportparts = "btn btn-fill btn-outline btn-try"
|
|
93
|
-
> </api-request>
|
|
66
|
+
${path.description ? html`<div class="m-markdown"> ${unsafeHTML(marked(path.description))}</div>` : ''}
|
|
67
|
+
${pathSecurityTemplate.call(this, path.security)}
|
|
68
|
+
${codeSampleTabPanel}
|
|
69
|
+
<div class='expanded-req-resp-container'>
|
|
70
|
+
<api-request
|
|
71
|
+
class = "${this.renderStyle}-mode"
|
|
72
|
+
style = "width:100%;"
|
|
73
|
+
method = "${path.method}"
|
|
74
|
+
path = "${path.path}"
|
|
75
|
+
.security = "${path.security}"
|
|
76
|
+
.parameters = "${path.parameters}"
|
|
77
|
+
.request_body = "${path.requestBody}"
|
|
78
|
+
.api_keys = "${nonEmptyApiKeys}"
|
|
79
|
+
.servers = "${path.servers}"
|
|
80
|
+
server-url = "${path.servers?.[0]?.url || this.selectedServer.computedUrl}"
|
|
81
|
+
fill-request-fields-with-example = "${this.fillRequestFieldsWithExample}"
|
|
82
|
+
use-summary-to-list-example = "${this.useSummaryToListExamples}"
|
|
83
|
+
allow-try = "${this.allowTry}"
|
|
84
|
+
accept = "${accept}"
|
|
85
|
+
render-style="${this.renderStyle}"
|
|
86
|
+
schema-style = "${this.schemaStyle}"
|
|
87
|
+
active-schema-tab = "${this.defaultSchemaTab}"
|
|
88
|
+
schema-expand-level = "${this.schemaExpandLevel}"
|
|
89
|
+
schema-description-expanded = "${this.schemaDescriptionExpanded}"
|
|
90
|
+
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
|
|
91
|
+
schema-hide-read-only = "${path.isWebhook ? false : this.schemaHideReadOnly}"
|
|
92
|
+
schema-hide-write-only = "${path.isWebhook ? this.schemaHideWriteOnly : false}"
|
|
93
|
+
fetch-credentials = "${this.fetchCredentials}"
|
|
94
|
+
exportparts = "btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, btn-clear:btn-clear, btn-clear-resp:btn-clear-resp,
|
|
95
|
+
file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param,
|
|
96
|
+
anchor:anchor, anchor-param-example:anchor-param-example, schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
|
|
97
|
+
> </api-request>
|
|
94
98
|
|
|
95
|
-
|
|
99
|
+
${path.callbacks ? callbackTemplate.call(this, path.callbacks) : ''}
|
|
96
100
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
101
|
+
<api-response
|
|
102
|
+
class = "${this.renderStyle}-mode"
|
|
103
|
+
style = "width:100%;"
|
|
104
|
+
.responses = "${path.responses}"
|
|
105
|
+
render-style = "${this.renderStyle}"
|
|
106
|
+
schema-style = "${this.schemaStyle}"
|
|
107
|
+
active-schema-tab = "${this.defaultSchemaTab}"
|
|
108
|
+
schema-expand-level = "${this.schemaExpandLevel}"
|
|
109
|
+
schema-description-expanded = "${this.schemaDescriptionExpanded}"
|
|
110
|
+
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
|
|
111
|
+
schema-hide-read-only = "${path.isWebhook ? this.schemaHideReadOnly : false}"
|
|
112
|
+
schema-hide-write-only = "${path.isWebhook ? false : this.schemaHideWriteOnly}"
|
|
113
|
+
selected-status = "${Object.keys(path.responses || {})[0] || ''}"
|
|
114
|
+
exportparts = "btn:btn, btn-response-status:btn-response-status, btn-selected-response-status:btn-selected-response-status, btn-fill:btn-fill, btn-copy:btn-copy,
|
|
115
|
+
schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
|
|
116
|
+
> </api-response>
|
|
117
|
+
</div>
|
|
111
118
|
</div>
|
|
112
|
-
</div>
|
|
113
119
|
`;
|
|
114
120
|
}
|
|
115
121
|
|
|
@@ -118,7 +124,7 @@ export default function expandedEndpointTemplate() {
|
|
|
118
124
|
return html`
|
|
119
125
|
${this.resolvedSpec.tags.map((tag) => html`
|
|
120
126
|
<section id="${tag.elementId}" part="section-tag" class="regular-font section-gap--read-mode observe-me" style="border-top:1px solid var(--primary-color);">
|
|
121
|
-
<div class="title tag" part="label-tag-title">${tag.name}</div>
|
|
127
|
+
<div class="title tag" part="section-tag-title label-tag-title">${tag.name}</div>
|
|
122
128
|
<slot name="${tag.elementId}"></slot>
|
|
123
129
|
<div class="regular-font-size">
|
|
124
130
|
${
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { html } from 'lit
|
|
2
|
-
import { unsafeHTML } from 'lit
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions
|
|
3
3
|
import { marked } from 'marked';
|
|
4
4
|
import { expandedEndpointBodyTemplate } from '~/templates/expanded-endpoint-template';
|
|
5
5
|
import '~/components/api-request';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { html } from 'lit
|
|
1
|
+
import { html } from 'lit';
|
|
2
2
|
import logoTemplate from '~/templates/logo-template';
|
|
3
3
|
|
|
4
4
|
/* eslint-disable indent */
|
|
5
5
|
export default function headerTemplate() {
|
|
6
6
|
return html`
|
|
7
|
-
<header class="row header regular-font" part="section-header" style="padding:8px 4px 8px 4px;min-height:48px;">
|
|
7
|
+
<header class="row main-header regular-font" part="section-header" style="padding:8px 4px 8px 4px;min-height:48px;">
|
|
8
8
|
<div class="only-large-screen-flex" style="align-items: center;">
|
|
9
9
|
<slot name="logo" class="logo" part="section-logo">
|
|
10
10
|
${logoTemplate('height:36px;width:36px;margin-left:5px')}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { html } from 'lit
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions
|
|
2
3
|
import { marked } from 'marked';
|
|
3
|
-
import { unsafeHTML } from 'lit-html/directives/unsafe-html';
|
|
4
4
|
|
|
5
5
|
// Templates
|
|
6
6
|
import overviewTemplate from '~/templates/overview-template';
|
|
@@ -154,7 +154,7 @@ export default function jsonSchemaViewerTemplate(isMini = false) {
|
|
|
154
154
|
<!-- Header -->
|
|
155
155
|
${this.showHeader === 'false' ? '' : headerTemplate.call(this)}
|
|
156
156
|
|
|
157
|
-
<div id='the-main-body' class="body" dir= ${this.pageDirection}>
|
|
157
|
+
<div id='the-main-body' class="body ${this.cssClasses}" dir= ${this.pageDirection}>
|
|
158
158
|
|
|
159
159
|
<!-- Side Nav -->
|
|
160
160
|
${jsonSchemaNavTemplate.call(this)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html } from 'lit
|
|
1
|
+
import { html } from 'lit';
|
|
2
2
|
|
|
3
3
|
// Templates
|
|
4
4
|
import expandedEndpointTemplate from '~/templates/expanded-endpoint-template';
|
|
@@ -73,7 +73,7 @@ export default function mainBodyTemplate(isMini = false, showExpandCollapse = tr
|
|
|
73
73
|
<!-- Advanced Search -->
|
|
74
74
|
${this.allowAdvancedSearch === 'false' ? '' : advancedSearchTemplate.call(this)}
|
|
75
75
|
|
|
76
|
-
<div id='the-main-body' class="body" dir= ${this.pageDirection}>
|
|
76
|
+
<div id='the-main-body' class="body ${this.cssClasses}" dir= ${this.pageDirection} >
|
|
77
77
|
<!-- Side Nav -->
|
|
78
78
|
${((this.renderStyle === 'read' || this.renderStyle === 'focused')
|
|
79
79
|
&& this.showSideNav === 'true'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html } from 'lit
|
|
1
|
+
import { html } from 'lit';
|
|
2
2
|
import { marked } from 'marked';
|
|
3
3
|
import { pathIsInSearch } from '~/utils/common-utils';
|
|
4
4
|
|
|
@@ -50,7 +50,7 @@ export default function navbarTemplate() {
|
|
|
50
50
|
${(this.allowSearch === 'false' && this.allowAdvancedSearch === 'false')
|
|
51
51
|
? ''
|
|
52
52
|
: html`
|
|
53
|
-
<div style="display:flex; flex-direction:row; justify-content:center; align-items:
|
|
53
|
+
<div style="display:flex; flex-direction:row; justify-content:center; align-items:stretch; padding:8px 24px 12px 24px; ${this.allowAdvancedSearch === 'false' ? 'border-bottom: 1px solid var(--nav-hover-bg-color)' : ''}">
|
|
54
54
|
${this.allowSearch === 'false'
|
|
55
55
|
? ''
|
|
56
56
|
: html`
|
|
@@ -67,7 +67,9 @@ export default function navbarTemplate() {
|
|
|
67
67
|
</div>
|
|
68
68
|
${this.matchPaths
|
|
69
69
|
? html`
|
|
70
|
-
<
|
|
70
|
+
<button @click = '${this.onClearSearch}' class="m-btn thin-border" style="margin-left:5px; color:var(--nav-text-color); width:75px; padding:6px 8px;" part="btn btn-outline btn-clear-filter">
|
|
71
|
+
CLEAR
|
|
72
|
+
</button>`
|
|
71
73
|
: ''
|
|
72
74
|
}
|
|
73
75
|
`
|
|
@@ -75,8 +77,8 @@ export default function navbarTemplate() {
|
|
|
75
77
|
${this.allowAdvancedSearch === 'false' || this.matchPaths
|
|
76
78
|
? ''
|
|
77
79
|
: html`
|
|
78
|
-
<button class="m-btn primary" part="btn btn-fill btn-search" style="margin-left:5px;" @click="${this.onShowSearchModalClicked}">
|
|
79
|
-
|
|
80
|
+
<button class="m-btn primary" part="btn btn-fill btn-search" style="margin-left:5px; padding:6px 8px; width:75px" @click="${this.onShowSearchModalClicked}">
|
|
81
|
+
SEARCH
|
|
80
82
|
</button>
|
|
81
83
|
`
|
|
82
84
|
}
|
|
@@ -89,7 +91,12 @@ export default function navbarTemplate() {
|
|
|
89
91
|
: html`
|
|
90
92
|
${(this.infoDescriptionHeadingsInNavBar === 'true')
|
|
91
93
|
? html`
|
|
92
|
-
${this.resolvedSpec.infoDescriptionHeaders.length > 0
|
|
94
|
+
${this.resolvedSpec.infoDescriptionHeaders.length > 0
|
|
95
|
+
? html`<div class='nav-bar-info' id='link-overview' data-content-id='overview' @click = '${(e) => this.scrollToEventTarget(e, false)}'>
|
|
96
|
+
${this.resolvedSpec.info?.title?.trim() || 'Overview'}
|
|
97
|
+
</div>`
|
|
98
|
+
: ''
|
|
99
|
+
}
|
|
93
100
|
<div class="overview-headers">
|
|
94
101
|
${this.resolvedSpec.infoDescriptionHeaders.map((header) => html`
|
|
95
102
|
<div
|
|
@@ -104,7 +111,9 @@ export default function navbarTemplate() {
|
|
|
104
111
|
</div>
|
|
105
112
|
${this.resolvedSpec.infoDescriptionHeaders.length > 0 ? html`<hr style='border-top: 1px solid var(--nav-hover-bg-color); border-width:1px 0 0 0; margin: 15px 0 0 0'/>` : ''}
|
|
106
113
|
`
|
|
107
|
-
: html`<div class='nav-bar-info' id='link-overview' data-content-id='overview' @click = '${(e) => this.scrollToEventTarget(e, false)}'>
|
|
114
|
+
: html`<div class='nav-bar-info' id='link-overview' data-content-id='overview' @click = '${(e) => this.scrollToEventTarget(e, false)}'>
|
|
115
|
+
${this.resolvedSpec.info?.title?.trim() || 'Overview'}
|
|
116
|
+
</div>`
|
|
108
117
|
}
|
|
109
118
|
`
|
|
110
119
|
}
|
|
@@ -197,10 +206,14 @@ export default function navbarTemplate() {
|
|
|
197
206
|
this.scrollToEventTarget(e, false);
|
|
198
207
|
}}'
|
|
199
208
|
>
|
|
200
|
-
<span style = "${p.deprecated ? 'filter:opacity(0.5)' : ''}">
|
|
209
|
+
<span style = "display:flex; align-items:start; ${p.deprecated ? 'filter:opacity(0.5)' : ''}">
|
|
210
|
+
${html`<span class="nav-method ${this.showMethodInNavBar} ${p.method}">
|
|
211
|
+
${this.showMethodInNavBar === 'as-colored-block' ? p.method.substring(0, 3).toUpperCase() : p.method.toUpperCase()}
|
|
212
|
+
</span>`
|
|
213
|
+
}
|
|
201
214
|
${p.isWebhook ? html`<span style="font-weight:bold; margin-right:8px; font-size: calc(var(--font-size-small) - 2px)">WEBHOOK</span>` : ''}
|
|
202
215
|
${this.usePathInNavBar === 'true'
|
|
203
|
-
? html`<span class='mono-font'>${p.
|
|
216
|
+
? html`<span class='mono-font'>${p.path}</span>`
|
|
204
217
|
: p.summary || p.shortSummary
|
|
205
218
|
}
|
|
206
219
|
</span>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { html } from 'lit
|
|
2
|
-
import { unsafeHTML } from 'lit
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions
|
|
3
3
|
import { marked } from 'marked';
|
|
4
4
|
import { downloadResource, viewResource } from '~/utils/common-utils';
|
|
5
5
|
|
|
@@ -16,7 +16,7 @@ export default function overviewTemplate() {
|
|
|
16
16
|
class="observe-me ${this.renderStyle === 'view' ? 'section-gap' : 'section-gap--read-mode'}">
|
|
17
17
|
${this.resolvedSpec?.info
|
|
18
18
|
? html`
|
|
19
|
-
<div id="api-title" part="
|
|
19
|
+
<div id="api-title" part="section-overview-title" style="font-size:32px">
|
|
20
20
|
${this.resolvedSpec.info.title}
|
|
21
21
|
${!this.resolvedSpec.info.version ? '' : html`
|
|
22
22
|
<span style = 'font-size:var(--font-size-small);font-weight:bold'>
|