rapidoc 12.0.0 → 12.1.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 (77) hide show
  1. package/README.md +127 -25
  2. package/dist/rapidoc-flow-min.js +580 -0
  3. package/dist/rapidoc-flow-min.js.LICENSE.txt +171 -0
  4. package/dist/rapidoc-min.js +541 -1309
  5. package/dist/rapidoc-min.js.LICENSE.txt +381 -0
  6. package/package.json +21 -18
  7. package/src/README.md +150 -0
  8. package/src/components/README.md +91 -0
  9. package/src/components/api-request.ts +43 -0
  10. package/src/components/api-response.ts +9 -4
  11. package/src/components/schema-base-element.ts +18 -4
  12. package/src/components/schema-table.ts +58 -13
  13. package/src/components/schema-tree.ts +7 -0
  14. package/src/components/tag-input.ts +5 -9
  15. package/src/flow.js +3 -0
  16. package/src/rapi-flow.ts +1178 -0
  17. package/src/rapidoc-mini.ts +27 -6
  18. package/src/rapidoc.ts +108 -62
  19. package/src/styles/README.md +96 -0
  20. package/src/styles/css-bundle.js +2 -2
  21. package/src/styles/endpoint-styles.js +6 -1
  22. package/src/styles/flow-styles.js +248 -0
  23. package/src/styles/nav-styles.js +39 -15
  24. package/src/styles/schema-styles.js +13 -5
  25. package/src/styles/theme-tokens.js +2 -2
  26. package/src/templates/README.md +89 -0
  27. package/src/templates/api-response-template.js +14 -10
  28. package/src/templates/callback-template.js +1 -1
  29. package/src/templates/downloads-template.js +12 -27
  30. package/src/templates/endpoint-template.js +15 -24
  31. package/src/templates/expanded-endpoint-template.js +8 -4
  32. package/src/templates/focused-endpoint-template.js +4 -3
  33. package/src/templates/navbar-template.js +20 -11
  34. package/src/templates/request-body-template.js +29 -7
  35. package/src/templates/request-params-template.js +15 -4
  36. package/src/templates/security-scheme-template.js +11 -2
  37. package/src/templates/server-template.js +3 -2
  38. package/src/utils/README.md +146 -0
  39. package/src/utils/arazzo/README.md +119 -0
  40. package/src/utils/arazzo/components.js +15 -0
  41. package/src/utils/arazzo/graph.js +269 -0
  42. package/src/utils/arazzo/index.js +52 -0
  43. package/src/utils/arazzo/operations.js +106 -0
  44. package/src/utils/arazzo/parse.js +196 -0
  45. package/src/utils/arazzo/refs.js +40 -0
  46. package/src/utils/arazzo/svg.js +707 -0
  47. package/src/utils/curl-utils.js +5 -2
  48. package/src/utils/highlighter.js +3 -0
  49. package/src/utils/mcp/README.md +155 -0
  50. package/src/utils/mcp/common.js +45 -346
  51. package/src/utils/mcp/manifest.js +382 -0
  52. package/src/utils/mcp/project/server.ts +53 -0
  53. package/src/utils/mcp/project.js +88 -0
  54. package/src/utils/mcp/runtime.js +289 -0
  55. package/src/utils/mcp/schema.js +98 -0
  56. package/src/utils/mcp/workflow-runtime.js +374 -0
  57. package/src/utils/mcp/workflows.js +240 -0
  58. package/src/utils/mcp/zip.js +102 -0
  59. package/src/utils/mcp-generator.js +29 -125
  60. package/src/utils/mock-interceptor.js +134 -85
  61. package/src/utils/request-utils.js +61 -0
  62. package/src/utils/schema-utils.js +33 -6
  63. package/src/utils/slugger.js +5 -7
  64. package/src/utils/spec-parser.js +190 -164
  65. package/src/utils/url-utils.js +36 -1
  66. package/dist/rapidoc-static-min.js +0 -13542
  67. package/src/static/index.d.ts +0 -149
  68. package/src/static/index.js +0 -62
  69. package/src/static/navigation.js +0 -497
  70. package/src/static/render.js +0 -490
  71. package/src/static/serializer.js +0 -216
  72. package/src/utils/mcp/generators/csharp.js +0 -242
  73. package/src/utils/mcp/generators/go.js +0 -298
  74. package/src/utils/mcp/generators/java.js +0 -330
  75. package/src/utils/mcp/generators/python.js +0 -248
  76. package/src/utils/mcp/generators/rust.js +0 -281
  77. package/src/utils/mcp/generators/typescript.js +0 -290
@@ -0,0 +1,381 @@
1
+ Third-party software bundled in rapidoc-min.js (rapidoc 12.1.0)
2
+ ===============================================================
3
+
4
+ rapidoc-min.js contains code from the packages below. Their licenses require their
5
+ copyright and license notices to accompany the code; they follow in full.
6
+
7
+ - @lit/reactive-element 2.1.2 (BSD-3-Clause)
8
+ - @scalar/helpers 0.17.0 (MIT)
9
+ - @scalar/json-magic 0.18.0 (MIT)
10
+ - @scalar/openapi-parser 0.29.20 (MIT)
11
+ - @scalar/openapi-upgrader 0.4.7 (MIT)
12
+ - github-slugger 2.0.0 (ISC)
13
+ - lit 3.3.3 (BSD-3-Clause)
14
+ - lit-element 4.2.2 (BSD-3-Clause)
15
+ - lit-html 3.3.3 (BSD-3-Clause)
16
+ - marked 18.1.3 (MIT)
17
+ - microlighter 2.2.0 (MIT)
18
+ - yaml 2.9.1 (ISC)
19
+
20
+ ========================================================================
21
+
22
+ @lit/reactive-element 2.1.2
23
+ License: BSD-3-Clause
24
+ https://lit.dev/
25
+ ------------------------------------------------------------------------
26
+ BSD 3-Clause License
27
+
28
+ Copyright (c) 2017 Google LLC. All rights reserved.
29
+
30
+ Redistribution and use in source and binary forms, with or without
31
+ modification, are permitted provided that the following conditions are met:
32
+
33
+ 1. Redistributions of source code must retain the above copyright notice, this
34
+ list of conditions and the following disclaimer.
35
+
36
+ 2. Redistributions in binary form must reproduce the above copyright notice,
37
+ this list of conditions and the following disclaimer in the documentation
38
+ and/or other materials provided with the distribution.
39
+
40
+ 3. Neither the name of the copyright holder nor the names of its
41
+ contributors may be used to endorse or promote products derived from
42
+ this software without specific prior written permission.
43
+
44
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
45
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
46
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
47
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
48
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
49
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
50
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
51
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
52
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
53
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54
+
55
+ ========================================================================
56
+
57
+ @scalar/helpers 0.17.0
58
+ License: MIT
59
+ https://github.com/scalar/scalar
60
+ ------------------------------------------------------------------------
61
+ MIT License
62
+
63
+ Copyright (c) 2023-present Scalar
64
+
65
+ Permission is hereby granted, free of charge, to any person obtaining a copy
66
+ of this software and associated documentation files (the "Software"), to deal
67
+ in the Software without restriction, including without limitation the rights
68
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
69
+ copies of the Software, and to permit persons to whom the Software is
70
+ furnished to do so, subject to the following conditions:
71
+
72
+ The above copyright notice and this permission notice shall be included in all
73
+ copies or substantial portions of the Software.
74
+
75
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
76
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
77
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
78
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
79
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
80
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
81
+ SOFTWARE.
82
+
83
+ ========================================================================
84
+
85
+ @scalar/json-magic 0.18.0
86
+ License: MIT
87
+ https://github.com/scalar/scalar
88
+ ------------------------------------------------------------------------
89
+ MIT License
90
+
91
+ Copyright (c) 2023-present Scalar
92
+
93
+ Permission is hereby granted, free of charge, to any person obtaining a copy
94
+ of this software and associated documentation files (the "Software"), to deal
95
+ in the Software without restriction, including without limitation the rights
96
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
97
+ copies of the Software, and to permit persons to whom the Software is
98
+ furnished to do so, subject to the following conditions:
99
+
100
+ The above copyright notice and this permission notice shall be included in all
101
+ copies or substantial portions of the Software.
102
+
103
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
104
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
105
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
106
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
107
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
108
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
109
+ SOFTWARE.
110
+
111
+ ========================================================================
112
+
113
+ @scalar/openapi-parser 0.29.20
114
+ License: MIT
115
+ https://github.com/scalar/scalar
116
+ ------------------------------------------------------------------------
117
+ MIT License
118
+
119
+ Copyright (c) 2023-present Scalar
120
+
121
+ Permission is hereby granted, free of charge, to any person obtaining a copy
122
+ of this software and associated documentation files (the "Software"), to deal
123
+ in the Software without restriction, including without limitation the rights
124
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
125
+ copies of the Software, and to permit persons to whom the Software is
126
+ furnished to do so, subject to the following conditions:
127
+
128
+ The above copyright notice and this permission notice shall be included in all
129
+ copies or substantial portions of the Software.
130
+
131
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
132
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
133
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
134
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
135
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
136
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
137
+ SOFTWARE.
138
+
139
+ ========================================================================
140
+
141
+ @scalar/openapi-upgrader 0.4.7
142
+ License: MIT
143
+ https://github.com/scalar/scalar
144
+ ------------------------------------------------------------------------
145
+ MIT License
146
+
147
+ Copyright (c) 2023-present Scalar
148
+
149
+ Permission is hereby granted, free of charge, to any person obtaining a copy
150
+ of this software and associated documentation files (the "Software"), to deal
151
+ in the Software without restriction, including without limitation the rights
152
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
153
+ copies of the Software, and to permit persons to whom the Software is
154
+ furnished to do so, subject to the following conditions:
155
+
156
+ The above copyright notice and this permission notice shall be included in all
157
+ copies or substantial portions of the Software.
158
+
159
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
160
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
161
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
162
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
163
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
164
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
165
+ SOFTWARE.
166
+
167
+ ========================================================================
168
+
169
+ github-slugger 2.0.0
170
+ License: ISC
171
+ https://github.com/Flet/github-slugger
172
+ ------------------------------------------------------------------------
173
+ Copyright (c) 2015, Dan Flettre <fletd01@yahoo.com>
174
+
175
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
176
+
177
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
178
+
179
+ ========================================================================
180
+
181
+ lit 3.3.3
182
+ License: BSD-3-Clause
183
+ https://lit.dev/
184
+ ------------------------------------------------------------------------
185
+ BSD 3-Clause License
186
+
187
+ Copyright (c) 2017 Google LLC. All rights reserved.
188
+
189
+ Redistribution and use in source and binary forms, with or without
190
+ modification, are permitted provided that the following conditions are met:
191
+
192
+ 1. Redistributions of source code must retain the above copyright notice, this
193
+ list of conditions and the following disclaimer.
194
+
195
+ 2. Redistributions in binary form must reproduce the above copyright notice,
196
+ this list of conditions and the following disclaimer in the documentation
197
+ and/or other materials provided with the distribution.
198
+
199
+ 3. Neither the name of the copyright holder nor the names of its
200
+ contributors may be used to endorse or promote products derived from
201
+ this software without specific prior written permission.
202
+
203
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
204
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
205
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
206
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
207
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
208
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
209
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
210
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
211
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
212
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
213
+
214
+ ========================================================================
215
+
216
+ lit-element 4.2.2
217
+ License: BSD-3-Clause
218
+ https://lit.dev/
219
+ ------------------------------------------------------------------------
220
+ BSD 3-Clause License
221
+
222
+ Copyright (c) 2017 Google LLC. All rights reserved.
223
+
224
+ Redistribution and use in source and binary forms, with or without
225
+ modification, are permitted provided that the following conditions are met:
226
+
227
+ 1. Redistributions of source code must retain the above copyright notice, this
228
+ list of conditions and the following disclaimer.
229
+
230
+ 2. Redistributions in binary form must reproduce the above copyright notice,
231
+ this list of conditions and the following disclaimer in the documentation
232
+ and/or other materials provided with the distribution.
233
+
234
+ 3. Neither the name of the copyright holder nor the names of its
235
+ contributors may be used to endorse or promote products derived from
236
+ this software without specific prior written permission.
237
+
238
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
239
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
240
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
241
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
242
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
243
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
244
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
245
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
246
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
247
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
248
+
249
+ ========================================================================
250
+
251
+ lit-html 3.3.3
252
+ License: BSD-3-Clause
253
+ https://lit.dev/
254
+ ------------------------------------------------------------------------
255
+ BSD 3-Clause License
256
+
257
+ Copyright (c) 2017 Google LLC. All rights reserved.
258
+
259
+ Redistribution and use in source and binary forms, with or without
260
+ modification, are permitted provided that the following conditions are met:
261
+
262
+ 1. Redistributions of source code must retain the above copyright notice, this
263
+ list of conditions and the following disclaimer.
264
+
265
+ 2. Redistributions in binary form must reproduce the above copyright notice,
266
+ this list of conditions and the following disclaimer in the documentation
267
+ and/or other materials provided with the distribution.
268
+
269
+ 3. Neither the name of the copyright holder nor the names of its
270
+ contributors may be used to endorse or promote products derived from
271
+ this software without specific prior written permission.
272
+
273
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
274
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
275
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
276
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
277
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
278
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
279
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
280
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
281
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
282
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
283
+
284
+ ========================================================================
285
+
286
+ marked 18.1.3
287
+ License: MIT
288
+ https://marked.js.org
289
+ ------------------------------------------------------------------------
290
+ # License information
291
+
292
+ ## Contribution License Agreement
293
+
294
+ If you contribute code to this project, you are implicitly allowing your code
295
+ to be distributed under the MIT license. You are also implicitly verifying that
296
+ all code is your original work. `</legalese>`
297
+
298
+ ## Marked
299
+
300
+ Copyright (c) 2018+, MarkedJS (https://github.com/markedjs/)
301
+ Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/)
302
+
303
+ Permission is hereby granted, free of charge, to any person obtaining a copy
304
+ of this software and associated documentation files (the "Software"), to deal
305
+ in the Software without restriction, including without limitation the rights
306
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
307
+ copies of the Software, and to permit persons to whom the Software is
308
+ furnished to do so, subject to the following conditions:
309
+
310
+ The above copyright notice and this permission notice shall be included in
311
+ all copies or substantial portions of the Software.
312
+
313
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
314
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
315
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
316
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
317
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
318
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
319
+ THE SOFTWARE.
320
+
321
+ ## Markdown
322
+
323
+ Copyright © 2004, John Gruber
324
+ http://daringfireball.net/
325
+ All rights reserved.
326
+
327
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
328
+
329
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
330
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
331
+ * Neither the name “Markdown” nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
332
+
333
+ This software is provided by the copyright holders and contributors “as is” and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
334
+
335
+ ========================================================================
336
+
337
+ microlighter 2.2.0
338
+ License: MIT
339
+ https://github.com/davatron5000/microlighter#readme
340
+ ------------------------------------------------------------------------
341
+ MIT License
342
+
343
+ Copyright (c) 2026 Dave Rupert
344
+
345
+ Permission is hereby granted, free of charge, to any person obtaining a copy
346
+ of this software and associated documentation files (the "Software"), to deal
347
+ in the Software without restriction, including without limitation the rights
348
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
349
+ copies of the Software, and to permit persons to whom the Software is
350
+ furnished to do so, subject to the following conditions:
351
+
352
+ The above copyright notice and this permission notice shall be included in all
353
+ copies or substantial portions of the Software.
354
+
355
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
356
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
357
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
358
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
359
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
360
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
361
+ SOFTWARE.
362
+
363
+ ========================================================================
364
+
365
+ yaml 2.9.1
366
+ License: ISC
367
+ https://eemeli.org/yaml/
368
+ ------------------------------------------------------------------------
369
+ Copyright Eemeli Aro <eemeli@gmail.com>
370
+
371
+ Permission to use, copy, modify, and/or distribute this software for any purpose
372
+ with or without fee is hereby granted, provided that the above copyright notice
373
+ and this permission notice appear in all copies.
374
+
375
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
376
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
377
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
378
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
379
+ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
380
+ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
381
+ THIS SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rapidoc",
3
- "version": "12.0.0",
3
+ "version": "12.1.0",
4
4
  "description": "RapiDoc - Open API spec viewer with built in console",
5
5
  "keywords": [
6
6
  "API",
@@ -26,11 +26,15 @@
26
26
  "swagger ui"
27
27
  ],
28
28
  "homepage": "https://rapidocui.com",
29
+ "bugs": {
30
+ "url": "https://github.com/rapi-doc/RapiDoc/issues"
31
+ },
29
32
  "license": "MIT",
30
33
  "author": "Mrinmoy Majumdar <mrin9@yahoo.com>",
31
34
  "repository": {
32
35
  "type": "git",
33
- "url": "git+https://github.com/rapi-doc/RapiDoc.git"
36
+ "url": "git+https://github.com/rapi-doc/RapiDoc.git",
37
+ "directory": "packages/rapidoc"
34
38
  },
35
39
  "files": [
36
40
  "dist",
@@ -44,35 +48,34 @@
44
48
  "browser": "./dist/rapidoc-min.js",
45
49
  "default": "./dist/rapidoc-min.js"
46
50
  },
47
- "./static": {
48
- "import": "./dist/rapidoc-static-min.js",
49
- "types": "./src/static/index.d.ts"
51
+ "./flow": {
52
+ "browser": "./dist/rapidoc-flow-min.js",
53
+ "default": "./dist/rapidoc-flow-min.js"
50
54
  }
51
55
  },
52
56
  "scripts": {
53
- "build": "vite build && vite build --config vite.config.static.mjs",
57
+ "build": "vite build && vite build --config vite.config.flow.mjs && node ../../scripts/capture-build-info.js",
54
58
  "build:client": "vite build",
55
- "build:static": "vite build --config vite.config.static.mjs",
59
+ "build:flow": "vite build --config vite.config.flow.mjs",
56
60
  "build:dev": "vite build --mode development",
57
61
  "build:size": "ANALYZE=true vite build",
58
62
  "lint": "oxlint --deny-warnings src",
59
63
  "format": "oxfmt --check src",
60
64
  "format-fix": "oxfmt src",
61
- "test": "node --import ../../scripts/test-loader.mjs --test ../../tests/unit/*.test.js"
65
+ "test": "node --import ../../scripts/test-loader.mjs --test ../../tests/unit/*.test.js",
66
+ "prepublishOnly": "npm run build"
62
67
  },
63
- "dependencies": {
64
- "@scalar/openapi-parser": "^0.29.18",
68
+ "devDependencies": {
69
+ "@lit-labs/rollup-plugin-minify-html-literals": "^0.2.0",
70
+ "@scalar/openapi-parser": "^0.29.20",
71
+ "esbuild": "^0.28.2",
65
72
  "github-slugger": "^2.0.0",
66
73
  "lit": "^3.3.3",
67
- "marked": "^18.1.2",
74
+ "marked": "^18.1.3",
68
75
  "microlighter": "^2.2.0",
76
+ "rollup-plugin-visualizer": "^7.1.2",
77
+ "vite": "^8.3.6",
78
+ "vite-plugin-banner": "^0.8.1",
69
79
  "yaml": "^2.9.1"
70
- },
71
- "devDependencies": {
72
- "@lit-labs/rollup-plugin-minify-html-literals": "^0.2.0",
73
- "esbuild": "^0.28.2",
74
- "rollup-plugin-visualizer": "^7.1.1",
75
- "vite": "^8.3.5",
76
- "vite-plugin-banner": "^0.8.1"
77
80
  }
78
81
  }
package/src/README.md ADDED
@@ -0,0 +1,150 @@
1
+ # `src/` — Custom Element Entry Points
2
+
3
+ ## Overview
4
+
5
+ Source root of the `rapidoc` package. It owns the three custom elements and the bundle entry:
6
+ `rapidoc.ts` (`<rapi-doc>`, the full viewer), `rapidoc-mini.ts` (`<rapi-doc-mini>`, the embeddable
7
+ subset) and `oauth-receiver.ts` (`<oauth-receiver>`, the OAuth 2 return page). `index.js` is the
8
+ entry Vite builds into `dist/rapidoc-min.js`. Two Node packages build on this source and are never imported from it:
9
+ `@rapidoc/prerender` (`packages/rapidoc-prerender`) renders these templates to HTML at build time, and
10
+ `@rapidoc/mcp` (`packages/rapidoc-mcp`) publishes the MCP code in `utils/`.
11
+ `rapi-flow.ts` (`<rapi-flow>`, the Arazzo workflow diagram) has its own entry, `flow.js`, built into
12
+ `dist/rapidoc-flow-min.js` (`rapidoc/flow`), so `rapidoc-min.js` carries no Arazzo code.
13
+
14
+ It does not own parsing, rendering or styling: a spec goes through `ProcessSpec`
15
+ ([`utils/`](./utils/README.md)) into `this.resolvedSpec`, and `render()` hands it to
16
+ [`templates/main-body-template.js`](./templates/README.md), which composes
17
+ [`components/`](./components/README.md). Themes are in [`styles/`](./styles/README.md).
18
+
19
+ Dependents: page authors (attributes, methods, events), `@rapidoc/portal` and
20
+ `utils/bind-navbar.js` (navigation hooks), and the docs site, which renders the attribute, method
21
+ and event reference from `docs/src/page-data/rapidoc-api.yaml`.
22
+
23
+ ## Interface
24
+
25
+ What `rapidoc-api.yaml` documents is the supported API, plus the portal hooks listed below. Every
26
+ other member is internal; templates call internal members freely through `this`.
27
+
28
+ - `index.js`: default export is the object `{ RapiDoc }` (not the class); named exports
29
+ `RapiDocMini` and `OAuthReceiver`. Importing it registers all three elements.
30
+ - `<rapi-doc>` (`[rapidoc.ts:RapiDoc]`):
31
+ - Documented methods: `loadSpec`, `scrollToPath`, `setApiKey`, `setHttpUserNameAndPassword`,
32
+ `setApiServer`, `generateMcpServer`, `downloadMcpServer`, `getMcpBudget`.
33
+ - Portal hooks: `bindNavBar(sidebar, options)`, `scrollTo(elementId)` (alias of `scrollToPath`;
34
+ it shadows `Element.prototype.scrollTo`, so `el.scrollTo({ top })` does not scroll),
35
+ `expandAndGotoOperation`, `getTargetElement`, `resolveOperationAlias`.
36
+ - Events: `before-render` (from `ProcessSpec`, `detail: { spec }`); `spec-loaded` (`detail` is
37
+ the live `resolvedSpec`; not bubbling); `nav-active-change` (`detail: { id, elementId,
38
+ operationId? }`; bubbles, composed).
39
+ - `<rapi-doc-mini>` (`[rapidoc-mini.ts:RapiDocMini]`): `loadSpec`, `setApiKey`,
40
+ `setHttpUserNameAndPassword`, `removeAllSecurityKeys`, `setApiServer`; event `spec-loaded`.
41
+ - `<oauth-receiver>` (`[oauth-receiver.ts:OauthReceiver]`): plain `HTMLElement` for the page named
42
+ by the `oauth-receiver` attribute; relays the provider's reply to the opener.
43
+ - `<rapi-flow>` (`[rapi-flow.ts:RapiFlow]`): attributes `arazzo-url`, `spec-url` (replaces the
44
+ first OpenAPI source's URL, resolved against the page), `workflow-id` (defaults to the first
45
+ workflow), `for` (id of a `<rapi-doc>`: clicking a step calls its `scrollToPath`; without
46
+ `spec-url`, that `<rapi-doc>`'s processed spec stands in for the first OpenAPI source, read
47
+ again on each of its `spec-loaded` events), `view` (`expanded`, the default, or `compact`;
48
+ the header's Compact / Expanded switch sets it), `show-view-toggle` (`"false"` hides that
49
+ switch), `theme`, `color-scheme`; method `load`; events `flow-loaded` (`detail: { doc,
50
+ problems }`), `step-click` (`detail: { workflowId, stepId, operation, workflowRef }`) and
51
+ `view-change` (`detail: { view }`, fired only by the switch), all bubbling and composed;
52
+ getter `arazzoDocument` (the parsed document, null until loaded). The
53
+ element does not store the chosen view; a page that wants it remembered listens for
54
+ `view-change`. The legend lists only the kinds of lines the current diagram draws. Hovering a step, one of its value lines or its rows in the outputs box highlights all of
55
+ them. Clicking a step name in the outputs box (focusable, Enter works too) or a value line that
56
+ reads a step selects that step and scrolls its nearest scrolling ancestor (or the window) to
57
+ center it. Clicking a step selects it; clicking a step that calls another workflow of the same document switches to
58
+ it. Errors and sources that failed to load are listed under the diagram; the graph's authoring
59
+ warnings are not shown. **Run** builds the MCP manifest for the shown workflow
60
+ (`utils/mcp/manifest.js` with the tied `<rapi-doc>`'s processed spec, else the first source this
61
+ element loaded) and runs it in the browser with `utils/mcp/workflow-runtime.js`. The run panel
62
+ under the legend is always open: the inputs form (defaults filled, values coerced by type), the
63
+ Run workflow button, then a log of every step's request, response and outputs and the
64
+ workflow's outputs or the error. While a step's request is out its box carries `rf-running`;
65
+ results are not drawn on the diagram. When the tied `<rapi-doc>` has `mock-server="true"`, the
66
+ form also takes the status codes its in-browser mock answers with (`503`, or a list used in
67
+ turn or at random): they are set on the `<rapi-doc>`'s `mock-server-status-code` /
68
+ `-strategy` for the run and restored after, and log lines say `mocked`. Credentials are the tied `<rapi-doc>`'s
69
+ entered ones (API keys, Basic, Bearer and OAuth tokens); a standalone element shows one
70
+ password field per security scheme of the first source instead (kept in memory only).
71
+ A workflow the runtime cannot run says why instead of a form.
72
+
73
+ ## Invariants
74
+
75
+ - **String flags.** Boolean-like attributes are the strings `"true"` / `"false"`, compared exactly,
76
+ never by truthiness. `[rapidoc.ts:connectedCallback]` replaces an unknown enumerated value with a
77
+ fixed fallback so templates can compare with `===`. `<rapi-doc-mini>` normalizes a smaller set
78
+ (`[rapidoc-mini.ts:connectedCallback]`): its `layout` falls back to `row`, `sort-endpoints-by`
79
+ has no `none`, and it does not move `theme="light|dark"` into `color-scheme`.
80
+ - **Rewrites in `<rapi-doc>`.** `theme="light"|"dark"` moves into `color-scheme`;
81
+ `color-scheme="auto"` is resolved by `AutoColorSchemeController` before normalization; a missing
82
+ or invalid `layout` is derived from `render-style` (`column` for `read`/`focused`, `row` for
83
+ `view`) and written back, while an author-set `row`/`column` is kept; an empty `mcp` becomes
84
+ `none`. `mcp` defaults to `"false"`: the Export MCP Server button shows only for `"true"` (or
85
+ any value that is not `false`/`none`, such as the old language names). The export includes
86
+ workflow tools when `<rapi-flow>` is loaded on the page: the one whose `for` names this
87
+ element, else one without `for`, supplies its `arazzoDocument` (`options.arazzo` overrides).
88
+ - **Spec loading** (`[rapidoc.ts:loadSpec]`). Each load takes a token from `_specLoadSeq`; a load
89
+ whose token is no longer current applies nothing (no `resolvedSpec`, no `loadFailed`, no
90
+ `spec-loaded`), so the newest call wins. `connectedCallback` owns the initial load: an inlined
91
+ `<script type="application/json" slot="rapidoc-spec">` wins over `spec-url`, and the `spec-url`
92
+ value present at connect is then skipped by `attributeChangedCallback`. An inlined spec that
93
+ fails `JSON.parse` is ignored, with no fallback to `spec-url`. A falsy argument is ignored. On
94
+ failure `loadFailed` is set and `resolvedSpec` cleared. `<rapi-doc-mini>` uses the same token
95
+ but loads only from `attributeChangedCallback`.
96
+ - **`spec-loaded`** (`[rapidoc.ts:afterSpecParsedAndValidated]`) fires once per applied load, after
97
+ `updateComplete` resolves true in a loop; `updated()` must not set a reactive property on every
98
+ cycle, or the event never fires. Initial navigation follows: `location.hash`, else `goto-path`,
99
+ else (focused mode) `overview` or the first operation.
100
+ - **Server selection.** `default-api-server` equal to `server-url` selects the added server;
101
+ otherwise the spec server with that `url`; otherwise `resolvedSpec.servers[0]`.
102
+ - **Section ids.** Operation ids come from `OperationSlugger` (`utils/slugger.js`);
103
+ `[rapidoc.ts:getTargetElement]` also accepts a `data-op-slug`, a `<tag>--<op>` suffix or a
104
+ method+path alias. `nav-active-change.detail.id` is the alias-resolved request in `scrollToPath`
105
+ and the observed section's DOM id in `onIntersect`; consumers should not assume the two agree.
106
+ - **Auto height.** Scroll handling treats the element as page-scrolled when `auto-height="true"`
107
+ or the attribute is present with any value.
108
+ - **DSD hydration** (`[rapidoc.ts:_clearDsdIfNeeded]`). With a pre-rendered shadow root, `render()`
109
+ returns `noChange` until `resolvedSpec` is set, then replaces all shadow children before Lit's
110
+ first render.
111
+ - **`<oauth-receiver>`** does no validation; `templates/security-scheme-template.js` in the opener
112
+ checks `state`, origin and source and must stay the sole validator.
113
+
114
+ ## Side Effects
115
+
116
+ - Importing `index.js` defines `rapi-doc`, `rapi-doc-mini` and `oauth-receiver` globally, and
117
+ evaluates `utils/markdown-utils.js`, which configures the global `marked`.
118
+ - `<rapi-doc>` `connectedCallback` sets inline size and margin on a zero-size parent `<body>`; adds
119
+ one capturing `hashchange` listener and first-interaction listeners on `window` (both removed on
120
+ disconnect). Programmatic scrolls add temporary `scroll` / `scrollend` listeners.
121
+ - `[rapidoc.ts:render]` clones the page `<link>` whose `href` contains `css-file` (passed through
122
+ `CSS.escape`) into the shadow root on each render.
123
+ - `history.replaceState` rewrites the hash on navigation only when `update-route="true"`.
124
+ - `mock-server="true"` makes `utils/mock-interceptor.js` replace `window.fetch` and
125
+ `XMLHttpRequest` methods page-wide; disconnect restores them only when the flag is still `"true"`.
126
+ - `AutoColorSchemeController` observes `<html>`/`<body>` and a `matchMedia` query while
127
+ `color-scheme="auto"`, removed on disconnect.
128
+ - `downloadMcpServer` zips the exported project (`utils/mcp/zip.js`) into a Blob URL and clicks a
129
+ temporary `<a>`; the file input uses `FileReader`.
130
+ - `console.error` on load or parse failure (not for superseded loads); `console.warn` when
131
+ `scroll-container` is not an ancestor.
132
+ - `<rapi-flow>` fetches `arazzo-url` and each OpenAPI source description (relative to the Arazzo
133
+ URL); a source that fails to load becomes a warning, not an error. A run sends the workflow's
134
+ requests from the browser with `fetch`, as Try-it does, so the API must allow cross-origin
135
+ requests. The first OpenAPI source is
136
+ not fetched while `for` names a `<rapi-doc>` and `spec-url` is unset; `<rapi-flow>` listens to
137
+ that element's `spec-loaded` until it disconnects.
138
+ - `<oauth-receiver>` clears its URL with `history.replaceState`, posts the reply to
139
+ `window.opener` (when set) with `location.origin` as target, and to
140
+ `BroadcastChannel("rapidoc-oauth")` when that global exists.
141
+
142
+ ## Verification
143
+
144
+ - `npm run test:unit` (repo root; tests in `tests/unit/`): `spec-load-sequence.test.js` (load
145
+ tokens, inlined spec first, one load per `spec-url`), `semantic-markup.test.js` and
146
+ `static-renderer.test.js` (static render path). These run in Node, not a browser.
147
+ - `npm run test:e2e` / `npm run test:component` run the elements in a browser, e.g.
148
+ `tests/e2e/dynamic-attributes.test.js`, `scroll-offset.test.js`, `color-scheme-auto.test.js`,
149
+ `sections-routing.test.js`.
150
+ - After changes: `npm run build:rapidoc`, `npm run lint`, `npm run format-fix`.