rapidoc 11.0.1 → 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.
- package/README.md +171 -54
- package/dist/rapidoc-flow-min.js +580 -0
- package/dist/rapidoc-flow-min.js.LICENSE.txt +171 -0
- package/dist/rapidoc-min.js +645 -202
- package/dist/rapidoc-min.js.LICENSE.txt +381 -0
- package/package.json +57 -42
- package/src/README.md +150 -0
- package/src/components/README.md +91 -0
- package/src/components/api-request.ts +912 -0
- package/src/components/api-response.ts +514 -0
- package/src/components/json-tree.ts +171 -0
- package/src/components/schema-base-element.ts +329 -0
- package/src/components/schema-table.ts +475 -0
- package/src/components/schema-tree.ts +393 -0
- package/src/components/tag-input.ts +180 -0
- package/src/flow.js +3 -0
- package/src/index.js +6 -0
- package/src/oauth-receiver.ts +29 -0
- package/src/rapi-flow.ts +1178 -0
- package/src/rapidoc-mini.ts +603 -0
- package/src/rapidoc.ts +1854 -0
- package/src/styles/README.md +96 -0
- package/src/styles/auth-styles.js +318 -0
- package/src/styles/border-styles.js +24 -0
- package/src/styles/css-bundle.js +129 -0
- package/src/styles/custom-styles.js +8 -0
- package/src/styles/dialog-box-styles.js +102 -0
- package/src/styles/endpoint-styles.js +564 -0
- package/src/styles/flex-styles.js +16 -0
- package/src/styles/flow-styles.js +248 -0
- package/src/styles/font-styles.js +432 -0
- package/src/styles/info-styles.js +36 -0
- package/src/styles/input-styles.js +555 -0
- package/src/styles/layout-styles.js +396 -0
- package/src/styles/microlighter-styles.js +99 -0
- package/src/styles/nav-styles.js +633 -0
- package/src/styles/param-list-styles.js +261 -0
- package/src/styles/schema-styles.js +296 -0
- package/src/styles/tab-styles.js +106 -0
- package/src/styles/theme-tokens.js +582 -0
- package/src/templates/README.md +89 -0
- package/src/templates/advanced-search-dialog-template.js +94 -0
- package/src/templates/api-response-template.js +223 -0
- package/src/templates/callback-template.js +86 -0
- package/src/templates/code-samples-template.js +52 -0
- package/src/templates/components-template.js +86 -0
- package/src/templates/downloads-template.js +70 -0
- package/src/templates/endpoint-template.js +377 -0
- package/src/templates/expanded-endpoint-template.js +270 -0
- package/src/templates/focused-endpoint-template.js +146 -0
- package/src/templates/header-template.js +92 -0
- package/src/templates/logo-template.js +21 -0
- package/src/templates/main-body-template.js +102 -0
- package/src/templates/navbar-template.js +498 -0
- package/src/templates/overview-template.js +104 -0
- package/src/templates/request-body-template.js +673 -0
- package/src/templates/request-params-template.js +485 -0
- package/src/templates/security-scheme-template.js +1272 -0
- package/src/templates/server-template.js +153 -0
- package/src/utils/README.md +146 -0
- package/src/utils/arazzo/README.md +119 -0
- package/src/utils/arazzo/components.js +15 -0
- package/src/utils/arazzo/graph.js +269 -0
- package/src/utils/arazzo/index.js +52 -0
- package/src/utils/arazzo/operations.js +106 -0
- package/src/utils/arazzo/parse.js +196 -0
- package/src/utils/arazzo/refs.js +40 -0
- package/src/utils/arazzo/svg.js +707 -0
- package/src/utils/auto-color-scheme.js +99 -0
- package/src/utils/bind-navbar.js +175 -0
- package/src/utils/color-utils.js +59 -0
- package/src/utils/common-utils.js +191 -0
- package/src/utils/curl-utils.js +126 -0
- package/src/utils/highlighter.js +419 -0
- package/src/utils/markdown-utils.js +110 -0
- package/src/utils/mcp/README.md +155 -0
- package/src/utils/mcp/common.js +166 -0
- package/src/utils/mcp/manifest.js +382 -0
- package/src/utils/mcp/project/server.ts +53 -0
- package/src/utils/mcp/project.js +88 -0
- package/src/utils/mcp/runtime.js +289 -0
- package/src/utils/mcp/schema.js +98 -0
- package/src/utils/mcp/workflow-runtime.js +374 -0
- package/src/utils/mcp/workflows.js +240 -0
- package/src/utils/mcp/zip.js +102 -0
- package/src/utils/mcp-generator.js +47 -0
- package/src/utils/mock-interceptor.js +557 -0
- package/src/utils/oauth-utils.js +87 -0
- package/src/utils/request-utils.js +264 -0
- package/src/utils/response-utils.js +203 -0
- package/src/utils/sanitize.js +57 -0
- package/src/utils/schema-utils.js +1954 -0
- package/src/utils/slugger.js +187 -0
- package/src/utils/spec-parser.js +941 -0
- package/src/utils/url-utils.js +246 -0
- package/src/utils/xml-utils.js +61 -0
|
@@ -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,66 +1,81 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rapidoc",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.1.0",
|
|
4
4
|
"description": "RapiDoc - Open API spec viewer with built in console",
|
|
5
|
-
"author": "Mrinmoy Majumdar <mrin9@yahoo.com>",
|
|
6
|
-
"homepage": "https://rapidocui.com",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/rapi-doc/RapiDoc.git"
|
|
10
|
-
},
|
|
11
|
-
"license": "MIT",
|
|
12
5
|
"keywords": [
|
|
6
|
+
"API",
|
|
7
|
+
"Custom Element",
|
|
8
|
+
"JSON-Schema",
|
|
9
|
+
"Mock Server",
|
|
13
10
|
"OpenAPI",
|
|
14
11
|
"OpenAPI Specification",
|
|
15
|
-
"JSON-Schema",
|
|
16
|
-
"API",
|
|
17
12
|
"REST",
|
|
18
|
-
"documentation",
|
|
19
|
-
"Custom Element",
|
|
20
13
|
"Web Component",
|
|
14
|
+
"documentation",
|
|
15
|
+
"openapi explorer",
|
|
16
|
+
"openapi parser",
|
|
17
|
+
"openapi preview",
|
|
18
|
+
"openapi renderer",
|
|
19
|
+
"openapi themes",
|
|
20
|
+
"openapi ui",
|
|
21
|
+
"openapi viewer",
|
|
21
22
|
"rapidoc",
|
|
22
23
|
"redoc",
|
|
23
24
|
"scalar",
|
|
24
25
|
"swagger",
|
|
25
|
-
"swagger ui"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
"swagger ui"
|
|
27
|
+
],
|
|
28
|
+
"homepage": "https://rapidocui.com",
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/rapi-doc/RapiDoc/issues"
|
|
31
|
+
},
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"author": "Mrinmoy Majumdar <mrin9@yahoo.com>",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "git+https://github.com/rapi-doc/RapiDoc.git",
|
|
37
|
+
"directory": "packages/rapidoc"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"src"
|
|
34
42
|
],
|
|
35
43
|
"type": "module",
|
|
36
44
|
"main": "dist/rapidoc-min.js",
|
|
37
45
|
"module": "dist/rapidoc-min.js",
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
46
|
+
"exports": {
|
|
47
|
+
".": {
|
|
48
|
+
"browser": "./dist/rapidoc-min.js",
|
|
49
|
+
"default": "./dist/rapidoc-min.js"
|
|
50
|
+
},
|
|
51
|
+
"./flow": {
|
|
52
|
+
"browser": "./dist/rapidoc-flow-min.js",
|
|
53
|
+
"default": "./dist/rapidoc-flow-min.js"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
41
56
|
"scripts": {
|
|
42
|
-
"build": "vite build",
|
|
57
|
+
"build": "vite build && vite build --config vite.config.flow.mjs && node ../../scripts/capture-build-info.js",
|
|
58
|
+
"build:client": "vite build",
|
|
59
|
+
"build:flow": "vite build --config vite.config.flow.mjs",
|
|
43
60
|
"build:dev": "vite build --mode development",
|
|
44
61
|
"build:size": "ANALYZE=true vite build",
|
|
45
|
-
"lint": "
|
|
46
|
-
"format": "
|
|
47
|
-
"format-fix": "
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
},
|
|
51
|
-
"dependencies": {
|
|
52
|
-
"@scalar/openapi-parser": "^0.29.11",
|
|
53
|
-
"github-slugger": "^2.0.0",
|
|
54
|
-
"lit": "^3.3.3",
|
|
55
|
-
"marked": "^18.1.0",
|
|
56
|
-
"microlighter": "^2.2.0",
|
|
57
|
-
"yaml": "^2.9.0"
|
|
62
|
+
"lint": "oxlint --deny-warnings src",
|
|
63
|
+
"format": "oxfmt --check src",
|
|
64
|
+
"format-fix": "oxfmt src",
|
|
65
|
+
"test": "node --import ../../scripts/test-loader.mjs --test ../../tests/unit/*.test.js",
|
|
66
|
+
"prepublishOnly": "npm run build"
|
|
58
67
|
},
|
|
59
68
|
"devDependencies": {
|
|
60
69
|
"@lit-labs/rollup-plugin-minify-html-literals": "^0.2.0",
|
|
70
|
+
"@scalar/openapi-parser": "^0.29.20",
|
|
61
71
|
"esbuild": "^0.28.2",
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
72
|
+
"github-slugger": "^2.0.0",
|
|
73
|
+
"lit": "^3.3.3",
|
|
74
|
+
"marked": "^18.1.3",
|
|
75
|
+
"microlighter": "^2.2.0",
|
|
76
|
+
"rollup-plugin-visualizer": "^7.1.2",
|
|
77
|
+
"vite": "^8.3.6",
|
|
78
|
+
"vite-plugin-banner": "^0.8.1",
|
|
79
|
+
"yaml": "^2.9.1"
|
|
65
80
|
}
|
|
66
|
-
}
|
|
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`.
|