rapidoc 9.3.7 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +193 -61
  2. package/dist/rapidoc-min.js +279 -3912
  3. package/package.json +24 -47
  4. package/.babelrc.json +0 -42
  5. package/.eslintrc +0 -53
  6. package/.github/FUNDING.yml +0 -13
  7. package/.github/workflow/words.yaml +0 -22
  8. package/CONTRIBUTING.md +0 -35
  9. package/dist/index.html +0 -6
  10. package/dist/index.html.gz +0 -0
  11. package/dist/rapidoc-min.js.LICENSE.txt +0 -64
  12. package/dist/rapidoc-min.js.LICENSE.txt.gz +0 -0
  13. package/dist/rapidoc-min.js.gz +0 -0
  14. package/dist/rapidoc-min.js.map +0 -1
  15. package/dist/rapidoc-min.js.map.gz +0 -0
  16. package/dist/rapidoc.js +0 -21594
  17. package/dist/report.html +0 -39
  18. package/index-hashroute.html +0 -65
  19. package/index.html +0 -249
  20. package/index1.html +0 -244
  21. package/jsconfig.json +0 -11
  22. package/logo.png +0 -0
  23. package/performance.html +0 -31
  24. package/src/components/api-request.js +0 -1787
  25. package/src/components/api-response.js +0 -335
  26. package/src/components/dialog-box.js +0 -73
  27. package/src/components/json-tree.js +0 -145
  28. package/src/components/schema-table.js +0 -358
  29. package/src/components/schema-tree.js +0 -378
  30. package/src/components/tag-input.js +0 -135
  31. package/src/index.js +0 -7
  32. package/src/json-schema-viewer.js +0 -345
  33. package/src/oauth-receiver.js +0 -56
  34. package/src/rapidoc-mini.js +0 -380
  35. package/src/rapidoc.js +0 -1082
  36. package/src/styles/border-styles.js +0 -24
  37. package/src/styles/custom-styles.js +0 -10
  38. package/src/styles/dialog-box-styles.js +0 -75
  39. package/src/styles/endpoint-styles.js +0 -202
  40. package/src/styles/flex-styles.js +0 -15
  41. package/src/styles/font-styles.js +0 -268
  42. package/src/styles/info-styles.js +0 -21
  43. package/src/styles/input-styles.js +0 -202
  44. package/src/styles/nav-styles.js +0 -198
  45. package/src/styles/prism-styles.js +0 -105
  46. package/src/styles/schema-styles.js +0 -121
  47. package/src/styles/tab-styles.js +0 -47
  48. package/src/styles/table-styles.js +0 -58
  49. package/src/templates/advance-search-template.js +0 -72
  50. package/src/templates/callback-template.js +0 -73
  51. package/src/templates/code-samples-template.js +0 -34
  52. package/src/templates/components-template.js +0 -76
  53. package/src/templates/endpoint-template.js +0 -249
  54. package/src/templates/expanded-endpoint-template.js +0 -197
  55. package/src/templates/focused-endpoint-template.js +0 -110
  56. package/src/templates/header-template.js +0 -66
  57. package/src/templates/json-schema-viewer-template.js +0 -185
  58. package/src/templates/logo-template.js +0 -18
  59. package/src/templates/main-body-template.js +0 -121
  60. package/src/templates/navbar-template.js +0 -272
  61. package/src/templates/overview-template.js +0 -79
  62. package/src/templates/security-scheme-template.js +0 -610
  63. package/src/templates/server-template.js +0 -115
  64. package/src/utils/color-utils.js +0 -59
  65. package/src/utils/common-utils.js +0 -168
  66. package/src/utils/schema-utils.js +0 -1086
  67. package/src/utils/spec-parser.js +0 -462
  68. package/src/utils/theme.js +0 -288
  69. package/webpack.config.js +0 -142
@@ -1,65 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6
- <meta http-equiv="Content-Type" content="text/html"/>
7
-
8
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootswatch@5.1.3/dist/flatly/bootstrap.min.css" integrity="sha384-JJl14kOPjuUj+o0fDTJGBSCDKpu1A4BuCmARIetHUvTVmopvVZITFd4AhRMJIlz7" crossorigin="anonymous">
9
-
10
- <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
11
- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
12
- </head>
13
- <body>
14
-
15
- <header>
16
- <nav class="navbar navbar-dark bg-dark">
17
- <div class="container-fluid">
18
- <form class="d-flex">
19
- <button
20
- onclick="
21
- document.getElementById('rapidoc-pets').setAttribute('spec-url', 'https://petstore.swagger.io/v2/swagger.json')"
22
- type="button" class="btn btn-primary">Set spec url</button>
23
- </form>
24
-
25
- </div>
26
- </nav>
27
- </header>
28
-
29
- <main>
30
-
31
- <div class="row">
32
-
33
- <div class="list-group rounded-0 d-none" id="services-swagger-list" role="tablist">
34
- <a class="list-group-item list-group-item-action active"
35
- id="list-pets"
36
- href="#tab-pets"
37
- data-bs-toggle="list" role="tab">pets</a>
38
- </div>
39
-
40
- <div class="tab-content" id="nav-tabContent">
41
- <div class="tab-pane active show"
42
- id="tab-pets"
43
- role="tabpanel">
44
-
45
- <rapi-doc
46
- id="rapidoc-pets"
47
- route-prefix="#tab-pets/"
48
- update-route="true"
49
- render-style="read"
50
-
51
- allow-authentication="false"
52
- allow-server-selection="false"
53
- show-header="false"
54
- show-info="true"
55
- allow-spec-file-load="false"
56
- allow-spec-url-load="false"
57
- ></rapi-doc>
58
-
59
- </div>
60
- </div>
61
- </div>
62
- </main>
63
- </body>
64
-
65
- </html>
package/index.html DELETED
@@ -1,249 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="utf-8">
6
- <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
7
- <title>RapiDoc</title>
8
- <link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.1/build/styles/default.min.css">
9
- <script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.1/build/highlight.min.js"></script>
10
- </head>
11
-
12
- <script>
13
- window.addEventListener('DOMContentLoaded', (event) => {
14
- const docEl = document.getElementById('thedoc');
15
- docEl.addEventListener('before-try', (e) => {
16
- e.detail.request.headers.append('AAA-BBB', 'CCC DDDD');
17
- });
18
- });
19
- </script>
20
-
21
- <body>
22
- <!--
23
- Some sample spec to try
24
- https://api.apis.guru/v2/specs/stripe.com/2019-02-19/swagger.json
25
- https://api.apis.guru/v2/specs/github.com/v3/swagger.json
26
- https://api.apis.guru/v2/specs/bitbucket.org/2.0/swagger.json
27
- https://petstore.swagger.io/v2/swagger.json
28
- https://assets.zuora.com/zuora-documentation/swagger.yaml <<< Large spec with lot of markdown
29
- ./specs/petstore_anyof.yaml <<< contains complex one-of with inline primitives and recursive objects
30
- ./specs/oneof1.yaml <<< nested oneof
31
- https://cesdev.eng.sonicwall.com/api/q/openapi
32
- -->
33
- <rapi-doc
34
- spec-url = "./specs/petstore_mini.yaml"
35
- id="thedoc"
36
- theme = "dark"
37
- render-style="focused"
38
- schema-style="tree"
39
- show-method-in-nav-bar = "true"
40
- use-path-in-nav-bar = "true"
41
- show-components = "true"
42
- show-info = "true"
43
- show-header = "true"
44
- allow-search = "true"
45
- allow-advanced-search = "true"
46
- allow-spec-url-load="false"
47
- allow-spec-file-download="true"
48
- allow-server-selection = "true"
49
- allow-authentication = "true"
50
- update-route="false"
51
- remove-endpoints-with-badge-label-as="one"
52
- match-type="regex"
53
- persist-auth="true"
54
- scroll-behavior="smooth"
55
- ></rapi-doc>
56
- <!--
57
- <rapi-doc-mini
58
- style= "width:600px; padding:0 10px"
59
- id = "thedoc"
60
- spec-url="./specs/code-highlight.yaml"
61
- theme = "light"
62
- schema-style = 'table'
63
- sort-endpoints-by = "method"
64
- layout = "column"
65
- match-paths = "post /code"
66
- paths-expanded = "true"
67
- > </rapi-doc-mini>
68
- <br/>
69
- <rapi-doc-mini
70
- style= "width:600px; padding:0 10px"
71
- id = "thedoc"
72
- spec-url="./specs/code-highlight.yaml"
73
- theme = "light"
74
- schema-style = 'table'
75
- sort-endpoints-by = "method"
76
- layout = "column"
77
- match-paths = "get /code"
78
- > </rapi-doc-mini>
79
- -->
80
-
81
- <!--
82
-
83
- <rapi-doc
84
- id = "thedoc"
85
- spec-url="./specs/code-highlight.yaml"
86
- theme = "light"
87
- render-style = "view"
88
- schema-style = 'tree'
89
- sort-endpoints-by = "method"
90
- show-info = "false"
91
- show-header = "false"
92
- allow-server-selection = "false"
93
- allow-authentication = "false"
94
- > </rapi-doc>
95
-
96
-
97
- <rapi-doc
98
- id = "thedoc"
99
- spec-url="https://petstore.swagger.io/v2/swagger.json1"
100
- render-style = "read"
101
- load-fonts = "false"
102
- show-header = "false"
103
- >
104
- <div slot="nav-logo" style="width:100%; display: flex;justify-content: center;">
105
- <button class='btn medium' onclick="document.getElementById('thedoc').setAttribute('schema-style', 'table')" >Table</button>
106
- <button class='btn medium' onclick="document.getElementById('thedoc').setAttribute('schema-style', 'tree')" >Tree</button>
107
- </div>
108
- <div slot="put-/pet" style="width:100%; display: flex;justify-content: center;">
109
- <b style="color:red"> Hello world</b>
110
- </div>
111
- </rapi-doc>
112
- -->
113
- <!--
114
- <rapi-doc id = "thedoc" ></rapi-doc>
115
- <script>
116
- document.addEventListener('DOMContentLoaded', (event) => {
117
- let docEl = document.getElementById("thedoc");
118
- let strSpec = `
119
- {
120
- "openapi": "3.0.1",
121
- "info": {
122
- "title": "My API",
123
- "version": "v1"
124
- },
125
- "paths": {
126
- "/api/Todo/complicated": {
127
- "get": {
128
- "tags": [
129
- "Todo"
130
- ],
131
- "summary": "Complicated action.",
132
- "responses": {
133
- "200": {
134
- "description": "Returns a complicated class.",
135
- "content": {
136
- "application/json": {
137
- "schema": {
138
- "$ref": "#/components/schemas/ComplicatedClass"
139
- }
140
- }
141
- }
142
- }
143
- }
144
- }
145
- }
146
- },
147
- "components": {
148
- "schemas": {
149
- "Tag": {
150
- "enum": [
151
- 0,
152
- 1,
153
- 2
154
- ],
155
- "type": "integer",
156
- "description": "Tag for TodoItem.",
157
- "format": "int32"
158
- },
159
- "InnerEnum": {
160
- "enum": [
161
- 1
162
- ],
163
- "type": "integer",
164
- "description": "Inner enum.",
165
- "format": "int32"
166
- },
167
- "SecondInnerEnum": {
168
- "enum": [
169
- 0
170
- ],
171
- "type": "integer",
172
- "description": "Second inner enum.",
173
- "format": "int32"
174
- },
175
- "SecondInnerEnumSecondInnerClass": {
176
- "type": "object",
177
- "properties": {
178
- "innerEnum": {
179
- "allOf": [
180
- {
181
- "$ref": "#/components/schemas/SecondInnerEnum"
182
- }
183
- ],
184
- "description": "Second inner enum."
185
- }
186
- },
187
- "additionalProperties": false,
188
- "description": "Second inner class."
189
- },
190
- "InnerClass": {
191
- "type": "object",
192
- "properties": {
193
- "innerEnum": {
194
- "type": "array",
195
- "items": {
196
- "$ref": "#/components/schemas/InnerEnum"
197
- },
198
- "description": "List of inner enums.",
199
- "nullable": true
200
- },
201
- "secondInnerClass": {
202
- "allOf": [
203
- {
204
- "$ref": "#/components/schemas/SecondInnerEnumSecondInnerClass"
205
- }
206
- ],
207
- "description": "Second inner class.",
208
- "nullable": true
209
- }
210
- },
211
- "additionalProperties": false,
212
- "description": "Inner class."
213
- },
214
- "ComplicatedClass": {
215
- "type": "object",
216
- "properties": {
217
- "tag": {
218
- "allOf": [
219
- {
220
- "$ref": "#/components/schemas/Tag"
221
- }
222
- ],
223
- "description": "Tag."
224
- },
225
- "innerClass": {
226
- "allOf": [
227
- {
228
- "$ref": "#/components/schemas/InnerClass"
229
- }
230
- ],
231
- "description": "Inner class.",
232
- "nullable": true
233
- }
234
- },
235
- "additionalProperties": false,
236
- "description": "Complicated class for testing enums."
237
- }
238
- }
239
- }
240
- }
241
- `;
242
- let objSpec = JSON.parse(strSpec);
243
- docEl.loadSpec(objSpec);
244
- })
245
- </script>
246
- -->
247
- </body>
248
-
249
- </html>
package/index1.html DELETED
@@ -1,244 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="utf-8">
6
- <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
7
- <title>RapiDoc</title>
8
- </head>
9
-
10
- <script>
11
- window.addEventListener('DOMContentLoaded', (event) => {
12
- const docEl = document.getElementById('thedoc');
13
- docEl.addEventListener('before-try', (e) => {
14
- e.detail.request.headers.append('AAA-BBB', 'CCC DDDD');
15
- });
16
- });
17
- </script>
18
-
19
- <body>
20
- <!--
21
- Some sample spec to try
22
- https://api.apis.guru/v2/specs/stripe.com/2019-02-19/swagger.json
23
- https://api.apis.guru/v2/specs/github.com/v3/swagger.json
24
- https://api.apis.guru/v2/specs/bitbucket.org/2.0/swagger.json
25
- https://petstore.swagger.io/v2/swagger.json
26
- https://assets.zuora.com/zuora-documentation/swagger.yaml <<< Large spec with lot of markdown
27
- ./specs/petstore_anyof.yaml <<< contains complex one-of with inline primitives and recursive objects
28
- ./specs/oneof1.yaml <<< nested oneof
29
- -->
30
- <rapi-doc
31
- spec-url = "./specs/petstore.yaml"
32
- route-prefix="#tab-pets/"
33
- id="thedoc"
34
- theme = "dark"
35
- render-style="read"
36
- schema-style="tree"
37
- use-path-in-nav-bar="true"
38
- show-components = "true"
39
- show-info = "true"
40
- show-header = "true"
41
- allow-search = "false"
42
- allow-advanced-search = "true"
43
- allow-spec-url-load="false"
44
- allow-spec-file-load="false"
45
- allow-spec-file-download="true"
46
- allow-server-selection = "true"
47
- allow-authentication = "true"
48
- match-type="regex"
49
- persist-auth="true"
50
- ></rapi-doc>
51
- <!--
52
- <rapi-doc-mini
53
- style= "width:600px; padding:0 10px"
54
- id = "thedoc"
55
- spec-url="./specs/code-highlight.yaml"
56
- theme = "light"
57
- schema-style = 'table'
58
- sort-endpoints-by = "method"
59
- layout = "column"
60
- match-paths = "post /code"
61
- paths-expanded = "true"
62
- > </rapi-doc-mini>
63
- <br/>
64
- <rapi-doc-mini
65
- style= "width:600px; padding:0 10px"
66
- id = "thedoc"
67
- spec-url="./specs/code-highlight.yaml"
68
- theme = "light"
69
- schema-style = 'table'
70
- sort-endpoints-by = "method"
71
- layout = "column"
72
- match-paths = "get /code"
73
- > </rapi-doc-mini>
74
- -->
75
-
76
- <!--
77
-
78
- <rapi-doc
79
- id = "thedoc"
80
- spec-url="./specs/code-highlight.yaml"
81
- theme = "light"
82
- render-style = "view"
83
- schema-style = 'tree'
84
- sort-endpoints-by = "method"
85
- show-info = "false"
86
- show-header = "false"
87
- allow-server-selection = "false"
88
- allow-authentication = "false"
89
- > </rapi-doc>
90
-
91
-
92
- <rapi-doc
93
- id = "thedoc"
94
- spec-url="https://petstore.swagger.io/v2/swagger.json1"
95
- render-style = "read"
96
- load-fonts = "false"
97
- show-header = "false"
98
- >
99
- <div slot="nav-logo" style="width:100%; display: flex;justify-content: center;">
100
- <button class='btn medium' onclick="document.getElementById('thedoc').setAttribute('schema-style', 'table')" >Table</button>
101
- <button class='btn medium' onclick="document.getElementById('thedoc').setAttribute('schema-style', 'tree')" >Tree</button>
102
- </div>
103
- <div slot="put-/pet" style="width:100%; display: flex;justify-content: center;">
104
- <b style="color:red"> Hello world</b>
105
- </div>
106
- </rapi-doc>
107
- -->
108
- <!--
109
- <rapi-doc id = "thedoc" ></rapi-doc>
110
- <script>
111
- document.addEventListener('DOMContentLoaded', (event) => {
112
- let docEl = document.getElementById("thedoc");
113
- let strSpec = `
114
- {
115
- "openapi": "3.0.1",
116
- "info": {
117
- "title": "My API",
118
- "version": "v1"
119
- },
120
- "paths": {
121
- "/api/Todo/complicated": {
122
- "get": {
123
- "tags": [
124
- "Todo"
125
- ],
126
- "summary": "Complicated action.",
127
- "responses": {
128
- "200": {
129
- "description": "Returns a complicated class.",
130
- "content": {
131
- "application/json": {
132
- "schema": {
133
- "$ref": "#/components/schemas/ComplicatedClass"
134
- }
135
- }
136
- }
137
- }
138
- }
139
- }
140
- }
141
- },
142
- "components": {
143
- "schemas": {
144
- "Tag": {
145
- "enum": [
146
- 0,
147
- 1,
148
- 2
149
- ],
150
- "type": "integer",
151
- "description": "Tag for TodoItem.",
152
- "format": "int32"
153
- },
154
- "InnerEnum": {
155
- "enum": [
156
- 1
157
- ],
158
- "type": "integer",
159
- "description": "Inner enum.",
160
- "format": "int32"
161
- },
162
- "SecondInnerEnum": {
163
- "enum": [
164
- 0
165
- ],
166
- "type": "integer",
167
- "description": "Second inner enum.",
168
- "format": "int32"
169
- },
170
- "SecondInnerEnumSecondInnerClass": {
171
- "type": "object",
172
- "properties": {
173
- "innerEnum": {
174
- "allOf": [
175
- {
176
- "$ref": "#/components/schemas/SecondInnerEnum"
177
- }
178
- ],
179
- "description": "Second inner enum."
180
- }
181
- },
182
- "additionalProperties": false,
183
- "description": "Second inner class."
184
- },
185
- "InnerClass": {
186
- "type": "object",
187
- "properties": {
188
- "innerEnum": {
189
- "type": "array",
190
- "items": {
191
- "$ref": "#/components/schemas/InnerEnum"
192
- },
193
- "description": "List of inner enums.",
194
- "nullable": true
195
- },
196
- "secondInnerClass": {
197
- "allOf": [
198
- {
199
- "$ref": "#/components/schemas/SecondInnerEnumSecondInnerClass"
200
- }
201
- ],
202
- "description": "Second inner class.",
203
- "nullable": true
204
- }
205
- },
206
- "additionalProperties": false,
207
- "description": "Inner class."
208
- },
209
- "ComplicatedClass": {
210
- "type": "object",
211
- "properties": {
212
- "tag": {
213
- "allOf": [
214
- {
215
- "$ref": "#/components/schemas/Tag"
216
- }
217
- ],
218
- "description": "Tag."
219
- },
220
- "innerClass": {
221
- "allOf": [
222
- {
223
- "$ref": "#/components/schemas/InnerClass"
224
- }
225
- ],
226
- "description": "Inner class.",
227
- "nullable": true
228
- }
229
- },
230
- "additionalProperties": false,
231
- "description": "Complicated class for testing enums."
232
- }
233
- }
234
- }
235
- }
236
- `;
237
- let objSpec = JSON.parse(strSpec);
238
- docEl.loadSpec(objSpec);
239
- })
240
- </script>
241
- -->
242
- </body>
243
-
244
- </html>
package/jsconfig.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- // This file is required for VSCode to understand webpack aliases
3
- "compilerOptions": {
4
- // This must be specified if "paths" is set
5
- "baseUrl": ".",
6
- // Relative to "baseUrl"
7
- "paths": {
8
- "@/*": ["./src/*"],
9
- }
10
- }
11
- }
package/logo.png DELETED
Binary file
package/performance.html DELETED
@@ -1,31 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="utf-8">
6
- <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
7
- <title>RapiDoc</title>
8
- <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,600&display=swap" rel="stylesheet">
9
- <link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.1/build/styles/default.min.css">
10
- <script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.1/build/highlight.min.js"></script>
11
- </head>
12
-
13
- <body>
14
- <rapi-doc
15
- id = "thedoc"
16
- spec-url="./specs/examples.yaml"
17
- allow-server-selection = "false"
18
- show-header = "false"
19
- show-info = "false"
20
- theme = "light"
21
- allow-try = "true"
22
- sort-endpoints-by = "summary"
23
- allow-api-list-style-selection = "false"
24
- regular-font = 'Open Sans'
25
- schema-style = 'tree'
26
- render-style = 'read'
27
- default-schema-tab = "model"
28
- >
29
- </rapi-doc>
30
- </body>
31
- </html>